diff --git a/tests/System/integration/api/com_banners/Categories.cy.js b/tests/System/integration/api/com_banners/Categories.cy.js index 66f54b16f50a5..20d30909877db 100644 --- a/tests/System/integration/api/com_banners/Categories.cy.js +++ b/tests/System/integration/api/com_banners/Categories.cy.js @@ -17,17 +17,27 @@ describe('Test that banners categories API endpoint', () => { }); it('can create a category', () => { - cy.api_post('/banners/categories', { title: 'automated test banner category' }) - .then((response) => cy.wrap(response).its('body').its('data').its('attributes') - .its('title') - .should('include', 'automated test banner category')); + cy.api_post('/banners/categories', { title: 'automated test banner category', description: 'automated test banner category description' }) + .then((response) => { + cy.wrap(response).its('body').its('data').its('attributes') + .its('title') + .should('include', 'automated test banner category'); + cy.wrap(response).its('body').its('data').its('attributes') + .its('description') + .should('include', 'automated test banner category description'); + }); }); it('can update a category', () => { cy.db_createCategory({ title: 'automated test banner category', extension: 'com_banners' }) - .then((id) => cy.api_patch(`/banners/categories/${id}`, { title: 'updated automated test banner category' })) - .then((response) => cy.wrap(response).its('body').its('data').its('attributes') - .its('title') - .should('include', 'updated automated test banner category')); + .then((id) => cy.api_patch(`/banners/categories/${id}`, { title: 'updated automated test banner category', description: 'automated test banner category description' })) + .then((response) => { + cy.wrap(response).its('body').its('data').its('attributes') + .its('title') + .should('include', 'updated automated test banner category'); + cy.wrap(response).its('body').its('data').its('attributes') + .its('description') + .should('include', 'automated test banner category description'); + }); }); }); diff --git a/tests/System/integration/api/com_contact/Categories.cy.js b/tests/System/integration/api/com_contact/Categories.cy.js index 78093a74b6635..83478d45d09a1 100644 --- a/tests/System/integration/api/com_contact/Categories.cy.js +++ b/tests/System/integration/api/com_contact/Categories.cy.js @@ -17,17 +17,27 @@ describe('Test that contact categories API endpoint', () => { }); it('can create a category', () => { - cy.api_post('/contacts/categories', { title: 'automated test contact category' }) - .then((response) => cy.wrap(response).its('body').its('data').its('attributes') - .its('title') - .should('include', 'automated test contact category')); + cy.api_post('/contacts/categories', { title: 'automated test contact category', description: 'automated test contact category description' }) + .then((response) => { + cy.wrap(response).its('body').its('data').its('attributes') + .its('title') + .should('include', 'automated test contact category'); + cy.wrap(response).its('body').its('data').its('attributes') + .its('description') + .should('include', 'automated test contact category description'); + }); }); it('can update a category', () => { cy.db_createCategory({ title: 'automated test contact category', extension: 'com_contact' }) - .then((id) => cy.api_patch(`/contacts/categories/${id}`, { title: 'updated automated test contact category' })) - .then((response) => cy.wrap(response).its('body').its('data').its('attributes') - .its('title') - .should('include', 'updated automated test contact category')); + .then((id) => cy.api_patch(`/contacts/categories/${id}`, { title: 'updated automated test contact category', description: 'automated test contact category description' })) + .then((response) => { + cy.wrap(response).its('body').its('data').its('attributes') + .its('title') + .should('include', 'updated automated test contact category'); + cy.wrap(response).its('body').its('data').its('attributes') + .its('description') + .should('include', 'automated test contact category description'); + }); }); }); diff --git a/tests/System/integration/api/com_content/Categories.cy.js b/tests/System/integration/api/com_content/Categories.cy.js index ae7629fe3a27e..a3dc570774889 100644 --- a/tests/System/integration/api/com_content/Categories.cy.js +++ b/tests/System/integration/api/com_content/Categories.cy.js @@ -17,17 +17,27 @@ describe('Test that content categories API endpoint', () => { }); it('can create a category', () => { - cy.api_post('/content/categories', { title: 'automated test content category' }) - .then((response) => cy.wrap(response).its('body').its('data').its('attributes') - .its('title') - .should('include', 'automated test content category')); + cy.api_post('/content/categories', { title: 'automated test content category', description: 'automated test content category description' }) + .then((response) => { + cy.wrap(response).its('body').its('data').its('attributes') + .its('title') + .should('include', 'automated test content category'); + cy.wrap(response).its('body').its('data').its('attributes') + .its('description') + .should('include', 'automated test content category description'); + }); }); it('can update a category', () => { cy.db_createCategory({ title: 'automated test content category', extension: 'com_content' }) - .then((id) => cy.api_patch(`/content/categories/${id}`, { title: 'updated automated test content category' })) - .then((response) => cy.wrap(response).its('body').its('data').its('attributes') - .its('title') - .should('include', 'updated automated test content category')); + .then((id) => cy.api_patch(`/content/categories/${id}`, { title: 'updated automated test content category', description: 'automated test content category description' })) + .then((response) => { + cy.wrap(response).its('body').its('data').its('attributes') + .its('title') + .should('include', 'updated automated test content category'); + cy.wrap(response).its('body').its('data').its('attributes') + .its('description') + .should('include', 'automated test content category description'); + }); }); }); diff --git a/tests/System/integration/api/com_newsfeed/Categories.cy.js b/tests/System/integration/api/com_newsfeed/Categories.cy.js index 3174fb9abb1f9..3f323ceafc83b 100644 --- a/tests/System/integration/api/com_newsfeed/Categories.cy.js +++ b/tests/System/integration/api/com_newsfeed/Categories.cy.js @@ -5,4 +5,37 @@ describe('Test that newsfeed categories API endpoint', () => { .then(() => cy.api_get('/newsfeeds/categories')) .then((response) => cy.api_responseContains(response, 'title', 'automated test category')); }); + + it('can display a single category', () => { + cy.db_createCategory({ title: 'automated test feed category', extension: 'com_newsfeeds' }) + .then((id) => cy.api_get(`/newsfeeds/categories/${id}`)) + .then((response) => cy.wrap(response).its('body').its('data').its('attributes') + .its('title') + .should('include', 'automated test feed category')); + }); + + it('can create a category', () => { + cy.api_post('/newsfeeds/categories', { title: 'automated test feed category', description: 'automated test feed category description' }) + .then((response) => { + cy.wrap(response).its('body').its('data').its('attributes') + .its('title') + .should('include', 'automated test feed category'); + cy.wrap(response).its('body').its('data').its('attributes') + .its('description') + .should('include', 'automated test feed category description'); + }); + }); + + it('can update a category', () => { + cy.db_createCategory({ title: 'automated test feed category', extension: 'com_newsfeeds' }) + .then((id) => cy.api_patch(`/newsfeeds/categories/${id}`, { title: 'updated automated test feed category', description: 'automated test feed category description' })) + .then((response) => { + cy.wrap(response).its('body').its('data').its('attributes') + .its('title') + .should('include', 'updated automated test feed category'); + cy.wrap(response).its('body').its('data').its('attributes') + .its('description') + .should('include', 'automated test feed category description'); + }); + }); });