Skip to content

Commit e33f573

Browse files
authored
api tests for endpoints for com_privacy consent (#41544)
1 parent e109bd3 commit e33f573

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
describe('Test privacy consent API endpoint', () => {
2+
afterEach(() => cy.task('queryDB', 'DELETE FROM #__privacy_consents'));
3+
4+
it('can get a list of consents', () => {
5+
cy.db_createPrivacyConsent({ body: 'test body' })
6+
.then(() => cy.api_get('/privacy/consents'))
7+
.then((response) => cy.api_responseContains(response, 'body', 'test body'));
8+
});
9+
10+
it('can list a single consent', () => {
11+
cy.db_createPrivacyConsent({ body: 'test body' })
12+
.then((id) => cy.api_get(`/privacy/consents/${id}`))
13+
.then((response) => cy.wrap(response).its('body').its('data').its('attributes')
14+
.its('body')
15+
.should('contain', 'test body'));
16+
});
17+
});

tests/System/support/commands/db.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function createInsertQuery(table, values) {
4848
* The privacy consent contains some default values when not all required fields are passed in the given data.
4949
* The id of the inserted privacy consent is returned
5050
*
51-
* @param {Object} privacyRequest The consent data to insert
51+
* @param {Object} privacyConsent The consent data to insert
5252
*
5353
* @returns integer
5454
*/

0 commit comments

Comments
 (0)