diff --git a/src/pages/Shelving/Parking/Card/ParkingSummary.vue b/src/pages/Shelving/Parking/Card/ParkingSummary.vue index 95620ebfd..7188ebeb6 100644 --- a/src/pages/Shelving/Parking/Card/ParkingSummary.vue +++ b/src/pages/Shelving/Parking/Card/ParkingSummary.vue @@ -45,8 +45,6 @@ const filter = { :label="t('parking.sector')" :value="entity.sector?.description" /> - - diff --git a/src/pages/Shelving/Parking/ParkingList.vue b/src/pages/Shelving/Parking/ParkingList.vue index fe6c93ba5..7c5058a74 100644 --- a/src/pages/Shelving/Parking/ParkingList.vue +++ b/src/pages/Shelving/Parking/ParkingList.vue @@ -1,19 +1,15 @@ + - - - - - - - - - - - - - - - - - + + + + + diff --git a/test/cypress/integration/parking/parkingBasicData.spec.js b/test/cypress/integration/parking/parkingBasicData.spec.js deleted file mode 100644 index f64f23ec8..000000000 --- a/test/cypress/integration/parking/parkingBasicData.spec.js +++ /dev/null @@ -1,23 +0,0 @@ -/// -describe('ParkingBasicData', () => { - const codeInput = 'form .q-card .q-input input'; - const sectorSelect = 'form .q-card .q-select input'; - const sectorOpt = '.q-menu .q-item'; - beforeEach(() => { - cy.login('developer'); - cy.visit(`/#/shelving/parking/1/basic-data`); - }); - - it('should edit the code and sector', () => { - cy.get(sectorSelect).type('Second'); - cy.get(sectorOpt).click(); - - cy.get(codeInput).eq(0).clear(); - cy.get(codeInput).eq(0).type('900-001'); - - cy.saveCard(); - - cy.get(sectorSelect).should('have.value', 'Second sector'); - cy.get(codeInput).should('have.value', '900-001'); - }); -}); diff --git a/test/cypress/integration/parking/parkingList.spec.js b/test/cypress/integration/parking/parkingList.spec.js deleted file mode 100644 index 8b7152ca4..000000000 --- a/test/cypress/integration/parking/parkingList.spec.js +++ /dev/null @@ -1,33 +0,0 @@ -/// -describe('ParkingList', () => { - const searchbar = '#searchbar input'; - const firstCard = '.q-card:nth-child(1)'; - const firstChipId = - ':nth-child(1) > :nth-child(1) > .justify-between > .flex > .q-chip > .q-chip__content'; - const firstDetailBtn = - ':nth-child(1) > :nth-child(1) > .card-list-body > .actions > .q-btn'; - const summaryHeader = '.summaryBody .header'; - - beforeEach(() => { - cy.viewport(1920, 1080); - cy.login('developer'); - cy.visit(`/#/shelving/parking/list`); - }); - - it('should redirect on clicking a parking', () => { - cy.get(searchbar).type('{enter}'); - cy.get(firstChipId) - .invoke('text') - .then((content) => { - const id = content.substring(4); - cy.get(firstCard).click(); - cy.url().should('include', `/parking/${id}/summary`); - }); - }); - - it('should open the details', () => { - cy.get(searchbar).type('{enter}'); - cy.get(firstDetailBtn).click(); - cy.get(summaryHeader).contains('Basic data'); - }); -}); diff --git a/test/cypress/integration/shelving/parking/parkingBasicData.spec.js b/test/cypress/integration/shelving/parking/parkingBasicData.spec.js new file mode 100644 index 000000000..e28d7eeca --- /dev/null +++ b/test/cypress/integration/shelving/parking/parkingBasicData.spec.js @@ -0,0 +1,32 @@ +/// +describe('ParkingBasicData', () => { + const codeInput = 'form .q-card .q-input input'; + const sectorSelect = 'form .q-card .q-select input'; + const sectorOpt = '.q-menu .q-item'; + beforeEach(() => { + cy.login('developer'); + cy.visit(`/#/shelving/parking/1/basic-data`); + }); + + it('should give an error if the code aldready exists', () => { + cy.get(codeInput).eq(0).should('have.value', '700-01').clear(); + cy.get(codeInput).eq(0).type('700-02'); + cy.saveCard(); + cy.get('.q-notification__message').should('have.text', 'The code already exists'); + }); + + it('should edit the code and sector', () => { + cy.get(sectorSelect).type('First'); + cy.get(sectorOpt).click(); + + cy.get(codeInput).eq(0).clear(); + cy.get(codeInput).eq(0).type('700-01'); + cy.dataCy('Picking order_input').clear().type(80230); + + cy.saveCard(); + cy.get('.q-notification__message').should('have.text', 'Data saved'); + cy.get(sectorSelect).should('have.value', 'First sector'); + cy.get(codeInput).should('have.value', '700-01'); + cy.dataCy('Picking order_input').should('have.value', 80230); + }); +}); diff --git a/test/cypress/integration/shelving/parking/parkingList.spec.js b/test/cypress/integration/shelving/parking/parkingList.spec.js new file mode 100644 index 000000000..ecee8aab7 --- /dev/null +++ b/test/cypress/integration/shelving/parking/parkingList.spec.js @@ -0,0 +1,30 @@ +/// +describe('ParkingList', () => { + const searchbar = '#searchbar input'; + const firstCard = ':nth-child(1) > .q-card > .no-margin > .q-py-none'; + const summaryHeader = '.summaryBody .header'; + + beforeEach(() => { + cy.viewport(1920, 1080); + cy.login('developer'); + cy.visit(`/#/shelving/parking/list`); + }); + + it('should redirect on clicking a parking', () => { + cy.get(searchbar).type('{enter}'); + cy.get(firstCard).click(); + cy.get(summaryHeader).contains('Basic data'); + }); + + it('should filter and redirect if there is only one result', () => { + cy.dataCy('Code_input').type('1{enter}'); + cy.dataCy('Sector_select').type('Normal{enter}'); + cy.get(summaryHeader).contains('Basic data'); + }); + + it('should filter and redirect to summary if only one result', () => { + cy.dataCy('Code_input').type('A{enter}'); + cy.dataCy('Sector_select').type('First Sector{enter}'); + cy.url().should('match', /\/shelving\/parking\/\d+\/summary/); + }); +});