perf: refs #6943 #6943 merge command
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Javier Segarra 2024-10-25 10:33:59 +02:00
parent 21c4468fce
commit ff559384aa
3 changed files with 14 additions and 16 deletions

View File

@ -11,16 +11,16 @@ describe('AgencyWorkCenter', () => {
// create
cy.get(createButton).click();
cy.get(workCenterCombobox).type('workCenterOne{enter}');
cy.hasNotify('Data created');
cy.checkNotification('created');
// expect error when duplicate
cy.get(createButton).click();
cy.get('[data-cy="FormModelPopup_save"]').click();
cy.hasNotify('This workCenter is already assigned to this agency');
cy.checkNotification('This workCenter is already assigned to this agency');
cy.get('[data-cy="FormModelPopup_cancel"]').click();
// delete
cy.get('.q-item__section--side > .q-btn > .q-btn__content > .q-icon').click();
cy.hasNotify('WorkCenter removed successfully');
cy.checkNotification('WorkCenter removed successfully');
});
});

View File

@ -17,7 +17,9 @@ describe('WorkerNotificationsManager', () => {
cy.login('developer');
cy.visit(`/#/worker/${salesPersonId}/notifications`);
cy.get(firstAvailableNotification).click();
cy.hasNotify('The notification subscription of this worker cant be modified');
cy.checkNotification(
'The notification subscription of this worker cant be modified'
);
});
it('should active a notification that is yours', () => {

View File

@ -274,21 +274,13 @@ Cypress.Commands.add('openActions', (row) => {
cy.get('tbody > tr').eq(row).find('.actions > .q-btn').click();
});
Cypress.Commands.add('checkNotification', (type) => {
const values = {
Cypress.Commands.add('checkNotification', (tag) => {
const defaultTags = {
created: 'Data created',
updated: 'Data saved',
deleted: 'Data deleted',
};
cy.get('.q-notification__message').should('have.text', values[type]);
});
Cypress.Commands.add('searchByLabel', (label, value) => {
cy.get(`[label="${label}"] > .q-field > .q-field__inner`).type(`${value}{enter}`);
});
Cypress.Commands.add('hasNotify', (text) => {
//last
}; //last
const text = defaultTags[tag] ?? tag;
cy.get('.q-notification')
.should('be.visible')
.last()
@ -297,3 +289,7 @@ Cypress.Commands.add('hasNotify', (text) => {
throw new Error(`Notification not found: "${text}"`);
});
});
Cypress.Commands.add('searchByLabel', (label, value) => {
cy.get(`[label="${label}"] > .q-field > .q-field__inner`).type(`${value}{enter}`);
});