Skip to content

Commit 7b7f943

Browse files
authored
Missing System Tests in #41362 (#41479)
* Update Categories.cy.js * Update Categories.cy.js * Update Categories.cy.js * Update Categories.cy.js * Update Categories.cy.js * Update Categories.cy.js added spaces and semicolons * Update Categories.cy.js Missing spaces and semicolons * Update Categories.cy.js Missing spaces and semicolons * Update Categories.cy.js Missing spaces and semicolons * Update Categories.cy.js removed tabs * Update Categories.cy.js Removed tabs * Update Categories.cy.js Removed tabs * Update Categories.cy.js Removed tabs
1 parent 4db71ec commit 7b7f943

File tree

4 files changed

+87
-24
lines changed

4 files changed

+87
-24
lines changed

tests/System/integration/api/com_banners/Categories.cy.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,27 @@ describe('Test that banners categories API endpoint', () => {
1717
});
1818

1919
it('can create a category', () => {
20-
cy.api_post('/banners/categories', { title: 'automated test banner category' })
21-
.then((response) => cy.wrap(response).its('body').its('data').its('attributes')
22-
.its('title')
23-
.should('include', 'automated test banner category'));
20+
cy.api_post('/banners/categories', { title: 'automated test banner category', description: 'automated test banner category description' })
21+
.then((response) => {
22+
cy.wrap(response).its('body').its('data').its('attributes')
23+
.its('title')
24+
.should('include', 'automated test banner category');
25+
cy.wrap(response).its('body').its('data').its('attributes')
26+
.its('description')
27+
.should('include', 'automated test banner category description');
28+
});
2429
});
2530

2631
it('can update a category', () => {
2732
cy.db_createCategory({ title: 'automated test banner category', extension: 'com_banners' })
28-
.then((id) => cy.api_patch(`/banners/categories/${id}`, { title: 'updated automated test banner category' }))
29-
.then((response) => cy.wrap(response).its('body').its('data').its('attributes')
30-
.its('title')
31-
.should('include', 'updated automated test banner category'));
33+
.then((id) => cy.api_patch(`/banners/categories/${id}`, { title: 'updated automated test banner category', description: 'automated test banner category description' }))
34+
.then((response) => {
35+
cy.wrap(response).its('body').its('data').its('attributes')
36+
.its('title')
37+
.should('include', 'updated automated test banner category');
38+
cy.wrap(response).its('body').its('data').its('attributes')
39+
.its('description')
40+
.should('include', 'automated test banner category description');
41+
});
3242
});
3343
});

tests/System/integration/api/com_contact/Categories.cy.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,27 @@ describe('Test that contact categories API endpoint', () => {
1717
});
1818

1919
it('can create a category', () => {
20-
cy.api_post('/contacts/categories', { title: 'automated test contact category' })
21-
.then((response) => cy.wrap(response).its('body').its('data').its('attributes')
22-
.its('title')
23-
.should('include', 'automated test contact category'));
20+
cy.api_post('/contacts/categories', { title: 'automated test contact category', description: 'automated test contact category description' })
21+
.then((response) => {
22+
cy.wrap(response).its('body').its('data').its('attributes')
23+
.its('title')
24+
.should('include', 'automated test contact category');
25+
cy.wrap(response).its('body').its('data').its('attributes')
26+
.its('description')
27+
.should('include', 'automated test contact category description');
28+
});
2429
});
2530

2631
it('can update a category', () => {
2732
cy.db_createCategory({ title: 'automated test contact category', extension: 'com_contact' })
28-
.then((id) => cy.api_patch(`/contacts/categories/${id}`, { title: 'updated automated test contact category' }))
29-
.then((response) => cy.wrap(response).its('body').its('data').its('attributes')
30-
.its('title')
31-
.should('include', 'updated automated test contact category'));
33+
.then((id) => cy.api_patch(`/contacts/categories/${id}`, { title: 'updated automated test contact category', description: 'automated test contact category description' }))
34+
.then((response) => {
35+
cy.wrap(response).its('body').its('data').its('attributes')
36+
.its('title')
37+
.should('include', 'updated automated test contact category');
38+
cy.wrap(response).its('body').its('data').its('attributes')
39+
.its('description')
40+
.should('include', 'automated test contact category description');
41+
});
3242
});
3343
});

tests/System/integration/api/com_content/Categories.cy.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,27 @@ describe('Test that content categories API endpoint', () => {
1717
});
1818

1919
it('can create a category', () => {
20-
cy.api_post('/content/categories', { title: 'automated test content category' })
21-
.then((response) => cy.wrap(response).its('body').its('data').its('attributes')
22-
.its('title')
23-
.should('include', 'automated test content category'));
20+
cy.api_post('/content/categories', { title: 'automated test content category', description: 'automated test content category description' })
21+
.then((response) => {
22+
cy.wrap(response).its('body').its('data').its('attributes')
23+
.its('title')
24+
.should('include', 'automated test content category');
25+
cy.wrap(response).its('body').its('data').its('attributes')
26+
.its('description')
27+
.should('include', 'automated test content category description');
28+
});
2429
});
2530

2631
it('can update a category', () => {
2732
cy.db_createCategory({ title: 'automated test content category', extension: 'com_content' })
28-
.then((id) => cy.api_patch(`/content/categories/${id}`, { title: 'updated automated test content category' }))
29-
.then((response) => cy.wrap(response).its('body').its('data').its('attributes')
30-
.its('title')
31-
.should('include', 'updated automated test content category'));
33+
.then((id) => cy.api_patch(`/content/categories/${id}`, { title: 'updated automated test content category', description: 'automated test content category description' }))
34+
.then((response) => {
35+
cy.wrap(response).its('body').its('data').its('attributes')
36+
.its('title')
37+
.should('include', 'updated automated test content category');
38+
cy.wrap(response).its('body').its('data').its('attributes')
39+
.its('description')
40+
.should('include', 'automated test content category description');
41+
});
3242
});
3343
});

tests/System/integration/api/com_newsfeed/Categories.cy.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,37 @@ describe('Test that newsfeed categories API endpoint', () => {
55
.then(() => cy.api_get('/newsfeeds/categories'))
66
.then((response) => cy.api_responseContains(response, 'title', 'automated test category'));
77
});
8+
9+
it('can display a single category', () => {
10+
cy.db_createCategory({ title: 'automated test feed category', extension: 'com_newsfeeds' })
11+
.then((id) => cy.api_get(`/newsfeeds/categories/${id}`))
12+
.then((response) => cy.wrap(response).its('body').its('data').its('attributes')
13+
.its('title')
14+
.should('include', 'automated test feed category'));
15+
});
16+
17+
it('can create a category', () => {
18+
cy.api_post('/newsfeeds/categories', { title: 'automated test feed category', description: 'automated test feed category description' })
19+
.then((response) => {
20+
cy.wrap(response).its('body').its('data').its('attributes')
21+
.its('title')
22+
.should('include', 'automated test feed category');
23+
cy.wrap(response).its('body').its('data').its('attributes')
24+
.its('description')
25+
.should('include', 'automated test feed category description');
26+
});
27+
});
28+
29+
it('can update a category', () => {
30+
cy.db_createCategory({ title: 'automated test feed category', extension: 'com_newsfeeds' })
31+
.then((id) => cy.api_patch(`/newsfeeds/categories/${id}`, { title: 'updated automated test feed category', description: 'automated test feed category description' }))
32+
.then((response) => {
33+
cy.wrap(response).its('body').its('data').its('attributes')
34+
.its('title')
35+
.should('include', 'updated automated test feed category');
36+
cy.wrap(response).its('body').its('data').its('attributes')
37+
.its('description')
38+
.should('include', 'automated test feed category description');
39+
});
40+
});
841
});

0 commit comments

Comments
 (0)