-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '4.4-dev' into 5.0/upmerge
- Loading branch information
Showing
15 changed files
with
477 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,33 @@ | ||
describe('Test that content categories API endpoint', () => { | ||
describe('Test that banners categories API endpoint', () => { | ||
afterEach(() => cy.task('queryDB', "DELETE FROM #__categories WHERE title = 'automated test banner category'")); | ||
|
||
it('can display a list of categories', () => { | ||
cy.db_createCategory({ title: 'automated test category', extension: 'com_banners' }) | ||
cy.db_createCategory({ title: 'automated test banner category', extension: 'com_banners' }) | ||
.then((id) => cy.db_createBanner({ name: 'automated test banner', catid: id })) | ||
.then(() => cy.api_get('/banners/categories')) | ||
.then((response) => cy.api_responseContains(response, 'title', 'automated test category')); | ||
.then((response) => cy.api_responseContains(response, 'title', 'automated test banner category')); | ||
}); | ||
|
||
it('can display a single category', () => { | ||
cy.db_createCategory({ title: 'automated test banner category', extension: 'com_banners' }) | ||
.then((id) => cy.api_get(`/banners/categories/${id}`)) | ||
.then((response) => cy.wrap(response).its('body').its('data').its('attributes') | ||
.its('title') | ||
.should('include', 'automated test banner category')); | ||
}); | ||
|
||
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')); | ||
}); | ||
|
||
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')); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
describe('Test that banners clients API endpoint', () => { | ||
afterEach(() => cy.task('queryDB', 'DELETE FROM #__banner_clients')); | ||
|
||
it('can deliver a list of clients', () => { | ||
cy.db_createBannerClient({ name: 'automated test banner client' }) | ||
.then(() => cy.api_get('/banners/clients')) | ||
.then((response) => cy.wrap(response).its('body').its('data.0').its('attributes') | ||
.its('name') | ||
.should('include', 'automated test banner client')); | ||
}); | ||
|
||
it('can deliver a single client', () => { | ||
cy.db_createBannerClient({ name: 'automated test banner client' }) | ||
.then((bannerclient) => cy.api_get(`/banners/clients/${bannerclient.id}`)) | ||
.then((response) => cy.wrap(response).its('body').its('data').its('attributes') | ||
.its('name') | ||
.should('include', 'automated test banner client')); | ||
}); | ||
|
||
it('can create a client', () => { | ||
cy.api_post('/banners/clients', { | ||
name: 'automated test banner client', | ||
contact: 'automated test banner client', | ||
state: 1, | ||
extrainfo: '', | ||
}) | ||
.then((response) => cy.wrap(response).its('body').its('data').its('attributes') | ||
.its('name') | ||
.should('include', 'automated test banner client')); | ||
}); | ||
|
||
it('can update a client', () => { | ||
cy.db_createBannerClient({ name: 'automated test banner client' }) | ||
.then((bannerclient) => cy.api_patch(`/banners/clients/${bannerclient.id}`, { name: 'updated automated test banner client' })) | ||
.then((response) => cy.wrap(response).its('body').its('data').its('attributes') | ||
.its('name') | ||
.should('include', 'updated automated test banner client')); | ||
}); | ||
|
||
it('can delete a client', () => { | ||
cy.db_createBannerClient({ name: 'automated test banner client', state: -2 }) | ||
.then((bannerclient) => cy.api_delete(`/banners/clients/${bannerclient.id}`)); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,33 @@ | ||
describe('Test that content categories API endpoint', () => { | ||
describe('Test that contact categories API endpoint', () => { | ||
afterEach(() => cy.task('queryDB', "DELETE FROM #__categories WHERE title = 'automated test contact category'")); | ||
|
||
it('can display a list of categories', () => { | ||
cy.db_createCategory({ title: 'automated test category', extension: 'com_contact' }) | ||
cy.db_createCategory({ title: 'automated test contact category', extension: 'com_contact' }) | ||
.then((id) => cy.db_createContact({ name: 'automated test contact', catid: id })) | ||
.then(() => cy.api_get('/contacts/categories')) | ||
.then((response) => cy.api_responseContains(response, 'title', 'automated test category')); | ||
.then((response) => cy.api_responseContains(response, 'title', 'automated test contact category')); | ||
}); | ||
|
||
it('can display a single category', () => { | ||
cy.db_createCategory({ title: 'automated test contact category', extension: 'com_contact' }) | ||
.then((id) => cy.api_get(`/contacts/categories/${id}`)) | ||
.then((response) => cy.wrap(response).its('body').its('data').its('attributes') | ||
.its('title') | ||
.should('include', 'automated test contact category')); | ||
}); | ||
|
||
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')); | ||
}); | ||
|
||
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')); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
112 changes: 61 additions & 51 deletions
112
tests/System/integration/api/com_contact/Field_Group.cy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,69 @@ | ||
describe('Test that group field contact API endpoint', () => { | ||
afterEach(() => cy.task('queryDB', 'DELETE FROM #__fields_groups')); | ||
|
||
it('can deliver a list of group fields', () => { | ||
cy.db_createFieldGroup({ title: 'automated test group field', context: 'com_contact.contact' }) | ||
.then(() => cy.api_get('/fields/groups/contacts/contact')) | ||
.then((response) => cy.wrap(response).its('body').its('data.0').its('attributes') | ||
.its('title') | ||
.should('include', 'automated test group field')); | ||
}); | ||
['contact', 'mail', 'categories'].forEach((context) => { | ||
it(`can deliver a list of group fields (${context})`, () => { | ||
cy.db_createFieldGroup({ title: `automated test group field contacts ${context}`, context: `com_contact.${context}` }) | ||
.then(() => cy.api_get(`/fields/groups/contacts/${context}`)) | ||
.then((response) => cy.wrap(response).its('body').its('data.0').its('attributes') | ||
.its('title') | ||
.should('include', `automated test group field contacts ${context}`)); | ||
}); | ||
|
||
it.only('can create a group field', () => { | ||
cy.api_post('/fields/groups/contacts/contact', { | ||
title: 'automated test group field', | ||
access: 1, | ||
context: 'com_contact.contact', | ||
default_value: '', | ||
description: '', | ||
group_id: 0, | ||
label: 'contact group field', | ||
language: '*', | ||
name: 'contact-group_field', | ||
note: '', | ||
params: { | ||
class: '', | ||
display: '2', | ||
display_readonly: '2', | ||
hint: '', | ||
label_class: '', | ||
label_render_class: '', | ||
layout: '', | ||
prefix: '', | ||
render_class: '', | ||
show_on: '', | ||
showlabel: '1', | ||
suffix: '', | ||
}, | ||
required: 0, | ||
state: 1, | ||
type: 'text', | ||
}) | ||
.then((response) => cy.wrap(response).its('body').its('data').its('attributes') | ||
.its('title') | ||
.should('include', 'automated test group field')); | ||
}); | ||
it(`can deliver a single group field (${context})`, () => { | ||
cy.db_createFieldGroup({ title: `automated test group field contacts ${context}`, context: `com_contact.${context}` }) | ||
.then((id) => cy.api_get(`/fields/groups/contacts/${context}/${id}`)) | ||
.then((response) => cy.wrap(response).its('body').its('data').its('attributes') | ||
.its('title') | ||
.should('include', `automated test group field contacts ${context}`)); | ||
}); | ||
|
||
it('can update a group field', () => { | ||
cy.db_createFieldGroup({ title: 'automated test group field', access: 1, context: 'com_contact.contact' }) | ||
.then((id) => cy.api_patch(`/fields/groups/contacts/contact/${id}`, { title: 'updated automated test group field', context: 'com_contact.contact' })) | ||
.then((response) => cy.wrap(response).its('body').its('data').its('attributes') | ||
.its('title') | ||
.should('include', 'updated automated test group field')); | ||
}); | ||
it(`can create a group field (${context})`, () => { | ||
cy.api_post(`/fields/groups/contacts/${context}`, { | ||
title: `automated test group field contacts ${context}`, | ||
access: 1, | ||
context: `com_contact.${context}`, | ||
default_value: '', | ||
description: '', | ||
group_id: 0, | ||
label: 'contact group field', | ||
language: '*', | ||
name: 'contact-group_field', | ||
note: '', | ||
params: { | ||
class: '', | ||
display: '2', | ||
display_readonly: '2', | ||
hint: '', | ||
label_class: '', | ||
label_render_class: '', | ||
layout: '', | ||
prefix: '', | ||
render_class: '', | ||
show_on: '', | ||
showlabel: '1', | ||
suffix: '', | ||
}, | ||
required: 0, | ||
state: 1, | ||
type: 'text', | ||
}) | ||
.then((response) => cy.wrap(response).its('body').its('data').its('attributes') | ||
.its('title') | ||
.should('include', `automated test group field contacts ${context}`)); | ||
}); | ||
|
||
it(`can update a group field (${context})`, () => { | ||
cy.db_createFieldGroup({ title: 'automated test group field', access: 1, context: `com_contact.${context}` }) | ||
.then((id) => cy.api_patch(`/fields/groups/contacts/${context}/${id}`, { title: `updated automated test group field ${context}` })) | ||
.then((response) => cy.wrap(response).its('body').its('data').its('attributes') | ||
.its('title') | ||
.should('include', `updated automated test group field ${context}`)); | ||
}); | ||
|
||
it('can delete a group field', () => { | ||
cy.db_createFieldGroup({ title: 'automated test group field', state: -2 }) | ||
.then((id) => cy.api_delete(`/fields/groups/contacts/contact/${id}`)); | ||
it(`can delete a group field (${context})`, () => { | ||
cy.db_createFieldGroup({ title: 'automated test group field', context: `com_contact.${context}`, state: -2 }) | ||
.then((id) => cy.api_delete(`/fields/groups/contacts/${context}/${id}`)); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.