forked from verdnatura/salix-front
chore: correct checkNotification
This commit is contained in:
parent
e210ad7de4
commit
0b5be9e67f
|
@ -280,13 +280,14 @@ Cypress.Commands.add('openActions', (row) => {
|
||||||
cy.get('tbody > tr').eq(row).find('.actions > .q-btn').click();
|
cy.get('tbody > tr').eq(row).find('.actions > .q-btn').click();
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('checkNotification', (type) => {
|
Cypress.Commands.add('checkNotification', (text) => {
|
||||||
const values = {
|
cy.get('.q-notification')
|
||||||
created: 'Data created',
|
.should('be.visible')
|
||||||
updated: 'Data saved',
|
.last()
|
||||||
deleted: 'Data deleted',
|
.then(($lastNotification) => {
|
||||||
};
|
if (!Cypress.$($lastNotification).text().includes(text))
|
||||||
cy.get('.q-notification__message').should('have.text', values[type]);
|
throw new Error(`Notification not found: "${text}"`);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('checkValueForm', (id, search) => {
|
Cypress.Commands.add('checkValueForm', (id, search) => {
|
||||||
|
|
Loading…
Reference in New Issue