refactor: requested changes
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jon Elias 2025-02-10 12:44:35 +01:00
parent 8c499e3fc3
commit aa6c6f0e69
2 changed files with 13 additions and 8 deletions

View File

@ -121,6 +121,7 @@ function deleteFile(dmsFk) {
hide-selected hide-selected
:is-clearable="false" :is-clearable="false"
:required="true" :required="true"
data-cy="vnSupplierSelect"
/> />
<VnInput <VnInput
clearable clearable
@ -149,6 +150,7 @@ function deleteFile(dmsFk) {
option-value="id" option-value="id"
option-label="id" option-label="id"
:filter-options="['id', 'name']" :filter-options="['id', 'name']"
data-cy="UnDeductibleVatSelect"
> >
<template #option="scope"> <template #option="scope">
<QItem v-bind="scope.itemProps"> <QItem v-bind="scope.itemProps">

View File

@ -1,18 +1,21 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('InvoiceInBasicData', () => { describe('InvoiceInBasicData', () => {
const firstFormSelect = '.q-card > .vn-row:nth-child(1) > .q-select'; const firstFormSelect = '.q-card > .vn-row:nth-child(1) > .q-select';
const documentBtns = '[data-cy="dms-buttons"]';
const dialogInputs = '.q-dialog input'; const dialogInputs = '.q-dialog input';
const resetBtn = '.q-btn-group--push > .q-btn--flat';
const getDocumentBtns = (opt) => `[data-cy="dms-buttons"] > :nth-child(${opt})`;
beforeEach(() => { beforeEach(() => {
cy.login('developer'); cy.login('developer');
cy.visit(`/#/invoice-in/2/basic-data`); cy.visit(`/#/invoice-in/1/basic-data`);
}); });
it('should edit the provideer and supplier ref', () => { it('should edit the provideer and supplier ref', () => {
cy.selectOption('[data-cy="Undeductible VAT_select"]', '4751000000') cy.dataCy('UnDeductibleVatSelect').type('4751000000');
cy.get('[title="Reset"]').click(); cy.get('.q-menu .q-item').contains('4751000000').click();
cy.selectOption(firstFormSelect, 'Bros'); cy.get(resetBtn).click();
cy.dataCy('vnSupplierSelect').type('Bros nick');
cy.get('.q-menu .q-item').contains('Bros nick').click();
cy.saveCard(); cy.saveCard();
cy.get(`${firstFormSelect} input`).invoke('val').should('eq', 'Bros nick'); cy.get(`${firstFormSelect} input`).invoke('val').should('eq', 'Bros nick');
}); });
@ -22,18 +25,18 @@ describe('InvoiceInBasicData', () => {
const secondInput = "I don't know what posting here!"; const secondInput = "I don't know what posting here!";
//edit //edit
cy.get(`${documentBtns} > :nth-child(2)`).click(); cy.get(getDocumentBtns(2)).click();
cy.get(dialogInputs).eq(0).type(`{selectall}${firtsInput}`); cy.get(dialogInputs).eq(0).type(`{selectall}${firtsInput}`);
cy.get('textarea').type(`{selectall}${secondInput}`); cy.get('textarea').type(`{selectall}${secondInput}`);
cy.get('[data-cy="FormModelPopup_save"]').click(); cy.get('[data-cy="FormModelPopup_save"]').click();
cy.get(`${documentBtns} > :nth-child(2)`).click(); cy.get(getDocumentBtns(2)).click();
cy.get(dialogInputs).eq(0).invoke('val').should('eq', firtsInput); cy.get(dialogInputs).eq(0).invoke('val').should('eq', firtsInput);
cy.get('textarea').invoke('val').should('eq', secondInput); cy.get('textarea').invoke('val').should('eq', secondInput);
cy.get('[data-cy="FormModelPopup_save"]').click(); cy.get('[data-cy="FormModelPopup_save"]').click();
cy.checkNotification('Data saved'); cy.checkNotification('Data saved');
//remove //remove
cy.get(`${documentBtns} > :nth-child(3)`).click(); cy.get(getDocumentBtns(3)).click();
cy.get('[data-cy="VnConfirm_confirm"]').click(); cy.get('[data-cy="VnConfirm_confirm"]').click();
cy.checkNotification('Data saved'); cy.checkNotification('Data saved');