test: better itemBarcode test
gitea/salix-front/pipeline/head Build queued...
Details
gitea/salix-front/pipeline/head Build queued...
Details
This commit is contained in:
parent
b65a5f1076
commit
16d550085f
|
@ -94,6 +94,7 @@ const submit = async (rows) => {
|
|||
icon="add_circle"
|
||||
v-shortcut="'+'"
|
||||
flat
|
||||
data-cy="addBarcode_input"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('Add barcode') }}
|
||||
|
|
|
@ -3,23 +3,22 @@ describe('ItemBarcodes', () => {
|
|||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/item/list`);
|
||||
cy.typeSearchbar('1{enter}');
|
||||
cy.visit(`/#/item/1/barcode`);
|
||||
});
|
||||
|
||||
it('should throw an error if the barcode exists', () => {
|
||||
cy.get('[href="#/item/1/barcode"]').click();
|
||||
cy.get('.q-card > .q-btn > .q-btn__content > .q-icon').click();
|
||||
cy.dataCy('Code_input').eq(3).type('1111111111');
|
||||
cy.dataCy('crudModelDefaultSaveBtn').click();
|
||||
newBarcode('1111111111');
|
||||
cy.checkNotification('Codes can not be repeated');
|
||||
});
|
||||
|
||||
it('should create a new barcode', () => {
|
||||
cy.get('[href="#/item/1/barcode"]').click();
|
||||
cy.get('.q-card > .q-btn > .q-btn__content > .q-icon').click();
|
||||
cy.dataCy('Code_input').eq(3).type('1231231231');
|
||||
cy.dataCy('crudModelDefaultSaveBtn').click();
|
||||
newBarcode('1231231231');
|
||||
cy.checkNotification('Data saved');
|
||||
});
|
||||
|
||||
function newBarcode(text) {
|
||||
cy.dataCy('addBarcode_input').click();
|
||||
cy.dataCy('Code_input').eq(3).should('exist').type(text);
|
||||
cy.dataCy('crudModelDefaultSaveBtn').click();
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue