diff --git a/src/pages/Claim/Card/ClaimPhoto.vue b/src/pages/Claim/Card/ClaimPhoto.vue index d4acc9bbe..4ced7e862 100644 --- a/src/pages/Claim/Card/ClaimPhoto.vue +++ b/src/pages/Claim/Card/ClaimPhoto.vue @@ -210,6 +210,7 @@ function onDrag() { class="all-pointer-events absolute delete-button zindex" @click.stop="viewDeleteDms(index)" round + :data-cy="`delete-button-${index+1}`" /> diff --git a/src/pages/Customer/Card/CustomerDescriptor.vue b/src/pages/Customer/Card/CustomerDescriptor.vue index 89f9d9449..e3156dd6d 100644 --- a/src/pages/Customer/Card/CustomerDescriptor.vue +++ b/src/pages/Customer/Card/CustomerDescriptor.vue @@ -118,14 +118,6 @@ const debtWarning = computed(() => { > {{ t('Allowed substitution') }} - - {{ t('customer.card.isFrozen') }} - { > {{ t('customer.card.notChecked') }} + + {{ t('customer.card.isFrozen') }} + { {{ t('unpaidDated', { - dated: toDate(customer.unpaid?.dated), + dated: toDate(entity.unpaid?.dated), }) }} {{ t('unpaidAmount', { - amount: toCurrency(customer.unpaid?.amount), + amount: toCurrency(entity.unpaid?.amount), }) }} diff --git a/src/pages/Shelving/ShelvingList.vue b/src/pages/Shelving/ShelvingList.vue index 4e0c21100..651121de8 100644 --- a/src/pages/Shelving/ShelvingList.vue +++ b/src/pages/Shelving/ShelvingList.vue @@ -1,14 +1,17 @@ @@ -37,48 +87,75 @@ function navigate(id) { - - - - - - - - - - - - - - - - - - - - - {{ $t('shelving.list.newShelving') }} - - - - + + + + + + + + + + + es: + shelving: + list: + parking: Estacionamiento + priority: Prioridad + + summary: + recyclable: Reciclable + en: + shelving: + list: + parking: Parking + priority: Priority + + summary: + recyclable: Recyclable + diff --git a/src/router/modules/shelving.js b/src/router/modules/shelving.js index c085dd8dc..94ff274dc 100644 --- a/src/router/modules/shelving.js +++ b/src/router/modules/shelving.js @@ -111,15 +111,6 @@ export default { shelvingCard, ], }, - { - path: 'create', - name: 'ShelvingCreate', - meta: { - title: 'shelvingCreate', - icon: 'add', - }, - component: () => import('src/pages/Shelving/Card/ShelvingForm.vue'), - }, { path: 'parking', name: 'ParkingMain', diff --git a/test/cypress/integration/claim/claimPhoto.spec.js b/test/cypress/integration/claim/claimPhoto.spec.js index c3522cbfe..592642f4d 100755 --- a/test/cypress/integration/claim/claimPhoto.spec.js +++ b/test/cypress/integration/claim/claimPhoto.spec.js @@ -1,6 +1,6 @@ /// -// redmine.verdnatura.es/issues/8417 -describe.skip('ClaimPhoto', () => { +describe('ClaimPhoto', () => { + const carrouselClose = '.q-dialog__inner > .q-toolbar > .q-btn > .q-btn__content > .q-icon'; beforeEach(() => { const claimId = 1; cy.login('developer'); @@ -16,6 +16,7 @@ describe.skip('ClaimPhoto', () => { }); it('should add new file with drag and drop', () => { + cy.get('.container').should('be.visible').and('exist'); cy.get('.container').selectFile('test/cypress/fixtures/image.jpg', { action: 'drag-drop', }); @@ -23,33 +24,23 @@ describe.skip('ClaimPhoto', () => { }); it('should open first image dialog change to second and close', () => { - cy.get(':nth-last-child(1) > .q-card').click(); - cy.get('.q-carousel__slide > .q-img > .q-img__container > .q-img__image').should( - 'be.visible', - ); + cy.dataCy('file-1').click(); + cy.get(carrouselClose).click(); - cy.get('.q-carousel__control > button').click(); - - cy.get( - '.q-dialog__inner > .q-toolbar > .q-btn > .q-btn__content > .q-icon', - ).click(); - cy.get('.q-carousel__slide > .q-img > .q-img__container > .q-img__image').should( - 'not.be.visible', - ); + cy.dataCy('file-1').click(); + cy.get('.q-carousel__control > button').as('nextButton').click(); + cy.get('.q-carousel__slide > .q-ma-none').should('be.visible'); + cy.get(carrouselClose).click(); }); it('should remove third and fourth file', () => { - cy.get( - '.multimediaParent > :nth-last-child(1) > .q-btn > .q-btn__content > .q-icon', - ).click(); + cy.dataCy('delete-button-4').click(); cy.get( '.q-card__actions > .q-btn--unelevated > .q-btn__content > .block', ).click(); cy.get('.q-notification__message').should('have.text', 'Data deleted'); - cy.get( - '.multimediaParent > :nth-last-child(1) > .q-btn > .q-btn__content > .q-icon', - ).click(); + cy.dataCy('delete-button-3').click(); cy.get( '.q-card__actions > .q-btn--unelevated > .q-btn__content > .block', ).click(); diff --git a/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js b/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js index 29d841acc..8370ac6fd 100644 --- a/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js +++ b/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js @@ -17,7 +17,6 @@ describe('InvoiceOut summary', () => { cy.login('developer'); cy.visit(`/#/invoice-out/1/summary`); }); - it('open the descriptors', () => { cy.get(firstRowDescriptors(1)).click(); cy.get('.descriptor').should('be.visible'); @@ -33,9 +32,8 @@ describe('InvoiceOut summary', () => { cy.get('.q-item > .q-item__label').should('include.text', '1101'); }); - it.skip('should open the ticket list', () => { + it('should open the ticket list', () => { cy.get(toTicketList).click(); - cy.get('.descriptor').should('be.visible'); cy.dataCy('vnFilterPanelChip').should('include.text', 'T1111111'); }); diff --git a/test/cypress/integration/shelving/parking/parkingList.spec.js b/test/cypress/integration/shelving/parking/parkingList.spec.js index ecee8aab7..ca1877621 100644 --- a/test/cypress/integration/shelving/parking/parkingList.spec.js +++ b/test/cypress/integration/shelving/parking/parkingList.spec.js @@ -1,7 +1,7 @@ /// describe('ParkingList', () => { const searchbar = '#searchbar input'; - const firstCard = ':nth-child(1) > .q-card > .no-margin > .q-py-none'; + const firstCard = ':nth-child(1) > .q-card > .no-margin > .q-py-none'; const summaryHeader = '.summaryBody .header'; beforeEach(() => { diff --git a/test/cypress/integration/shelving/shelvingBasicData.spec.js b/test/cypress/integration/shelving/shelvingBasicData.spec.js new file mode 100644 index 000000000..d7b0dc692 --- /dev/null +++ b/test/cypress/integration/shelving/shelvingBasicData.spec.js @@ -0,0 +1,24 @@ +/// +describe('ShelvingList', () => { + const parking = + '.q-card > :nth-child(1) > .q-select > .q-field__inner > .q-field__control > .q-field__control-container'; + beforeEach(() => { + cy.viewport(1920, 1080); + cy.login('developer'); + cy.visit(`/#/shelving/1/basic-data`); + }); + + it('should give an error if the code aldready exists', () => { + cy.dataCy('Code_input').should('exist').clear().type('AA7'); + cy.saveCard(); + cy.get('.q-notification__message').should('have.text', 'The code already exists'); + }); + it('should edit the data and save', () => { + cy.selectOption(parking, 'P-01-1'); + cy.dataCy('Code_input').clear().type('AA1'); + cy.dataCy('Priority_input').clear().type('10'); + cy.get(':nth-child(2) > .q-checkbox > .q-checkbox__inner').click(); + cy.saveCard(); + cy.get('.q-notification__message').should('have.text', 'Data saved'); + }); +}); diff --git a/test/cypress/integration/shelving/shelvingList.spec.js b/test/cypress/integration/shelving/shelvingList.spec.js new file mode 100644 index 000000000..745dd1b78 --- /dev/null +++ b/test/cypress/integration/shelving/shelvingList.spec.js @@ -0,0 +1,41 @@ +/// +describe('ShelvingList', () => { + beforeEach(() => { + cy.viewport(1920, 1080); + cy.login('developer'); + cy.visit(`/#/shelving/list`); + }); + + it('should redirect on clicking a shelving', () => { + cy.typeSearchbar('{enter}'); + cy.dataCy('cardBtn').eq(0).click(); + cy.get('.summaryHeader > .header > .q-icon').click(); + cy.url().should('include', '/shelving/1/summary'); + }); + + it('should redirect from preview to basic-data', () => { + cy.typeSearchbar('{enter}'); + cy.dataCy('cardBtn').eq(0).click(); + cy.get('.q-card > .header').click(); + cy.url().should('include', '/shelving/1/basic-data'); + }); + + it('should filter and redirect if only one result', () => { + cy.selectOption('[data-cy="Parking_select"]', 'P-02-2'); + cy.dataCy('Parking_select').type('{enter}'); + cy.url().should('match', /\/shelving\/\d+\/summary/); + }); + + it('should create a new shelving', () => { + cy.dataCy('vnTableCreateBtn').click(); + cy.dataCy('code-create-popup').type('Test'); + cy.dataCy('Priority_input').type('10'); + cy.selectOption( + '.grid-create > .q-select > .q-field__inner > .q-field__control > .q-field__control-container', + '100-01', + ); + cy.dataCy('FormModelPopup_save').click(); + cy.checkNotification('Data created'); + cy.url().should('match', /\/shelving\/\d+\/basic-data/); + }); +});