test: refs #8224 fix bad test
gitea/salix-front/pipeline/pr-dev This commit is unstable Details

This commit is contained in:
Alex Moreno 2025-04-28 10:10:17 +02:00
parent c6d4e2ffe5
commit b911211000
1 changed files with 18 additions and 22 deletions

View File

@ -8,28 +8,24 @@ describe('UserPanel', () => {
cy.openUserPanel(); cy.openUserPanel();
}); });
it('should notify when update user warehouse', () => {
const userWarehouse = '.q-menu .q-gutter-xs > :nth-child(3) > .q-field';
const oldOption = 'VNL';
const newOption = 'VNH';
cy.get(userWarehouse).contains(oldOption);
cy.selectOption(userWarehouse, newOption);
cy.checkNotification('Data saved');
cy.get(userWarehouse).contains(newOption);
// Restore
cy.selectOption(userWarehouse, oldOption);
});
it('should notify when update user company', () => { it('should notify when update user company', () => {
const userCompany = '.q-menu .q-gutter-xs > :nth-child(2) > .q-field'; changeSelect('User company', 'VNH', 'VNL');
const oldOption = 'Warehouse One';
const newOption = 'TestingWarehouse';
cy.get(userCompany).contains(oldOption);
cy.selectOption(userCompany, newOption);
cy.checkNotification('Data saved');
cy.get(userCompany).contains(newOption);
// Restore
cy.selectOption(userCompany, oldOption);
}); });
it('should notify when update user warehouse', () => {
changeSelect('User warehouse', 'TestingWarehouse', 'Warehouse One');
});
function changeSelect(field, newOption, oldOption) {
cy.get('.q-menu')
.contains(field)
.then(($field) => {
cy.wrap($field).contains(oldOption);
cy.selectOption($field, newOption);
cy.checkNotification('Data saved');
cy.wrap($field).contains(newOption);
// Restore
cy.selectOption($field, oldOption);
});
}
}); });