Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions tests/System/integration/api/com_privacy/Consent.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
describe('Test privacy consent API endpoint', () => {
afterEach(() => cy.task('queryDB', 'DELETE FROM #__privacy_consents'));

it('can get a list of consents', () => {
cy.db_createPrivacyConsent({ body: 'test body' })
.then(() => cy.api_get('/privacy/consents'))
.then((response) => cy.api_responseContains(response, 'body', 'test body'));
});

it('can list a single consent', () => {
cy.db_createPrivacyConsent({ body: 'test body' })
.then((id) => cy.api_get(`/privacy/consents/${id}`))
.then((response) => cy.wrap(response).its('body').its('data').its('attributes')
.its('body')
.should('contain', 'test body'));
});
});
2 changes: 1 addition & 1 deletion tests/System/support/commands/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function createInsertQuery(table, values) {
* The privacy consent contains some default values when not all required fields are passed in the given data.
* The id of the inserted privacy consent is returned
*
* @param {Object} privacyRequest The consent data to insert
* @param {Object} privacyConsent The consent data to insert
*
* @returns integer
*/
Expand Down