feat: refs #8612 added summary button & changed e2e tests
gitea/salix-front/pipeline/pr-dev Build queued... Details

This commit is contained in:
PAU ROVIRA ROSALENY 2025-02-21 13:02:12 +01:00
parent cb2d2d1ce0
commit 4ff6971a07
3 changed files with 34 additions and 5 deletions

View File

@ -5,6 +5,7 @@ import { useI18n } from 'vue-i18n';
import VnTable from 'components/VnTable/VnTable.vue';
import VnSection from 'src/components/common/VnSection.vue';
import ShelvingFilter from 'pages/Shelving/Card/ShelvingFilter.vue';
import ShelvingSummary from './Card/ShelvingSummary.vue';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import exprBuilder from './ShelvingExprBuilder.js';
import VnSelect from 'src/components/common/VnSelect.vue';
@ -12,6 +13,7 @@ import { QCheckbox } from 'quasar';
const { t } = useI18n();
const router = useRouter();
const { viewSummary } = useSummaryDialog();
const dataKey = 'ShelvingList';
const filter = {
@ -50,6 +52,19 @@ const columns = computed(() => [
label: t('shelving.summary.recyclable'),
sortable: true,
},
{
align: 'right',
label: '',
name: 'tableActions',
actions: [
{
title: t('components.smartCard.viewSummary'),
icon: 'preview',
action: (row) => viewSummary(row.id, ShelvingSummary),
isPrimary: true,
},
],
},
]);
const onDataSaved = ({ id }) => {

View File

@ -8,13 +8,19 @@ describe('ShelvingList', () => {
cy.visit(`/#/shelving/1/basic-data`);
});
it('should give an error if the code aldready exists', () => {
cy.dataCy('Code_input').should('exist').clear();
cy.dataCy('Code_input').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').type('1');
cy.dataCy('Code_input').clear();
cy.dataCy('Code_input').type('AA1');
cy.dataCy('Priority_input').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');
});
});
});

View File

@ -8,10 +8,18 @@ describe('ShelvingList', () => {
it('should redirect on clicking a shelving', () => {
cy.get('#searchbar input').type('{enter}');
cy.get(':nth-child(2) > .q-card').click();
cy.url().should('include', '/shelving/2/summary');
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.get('#searchbar input').type('{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}');