feat: refs #8602 refactor EntryBuys component and enhance observation tests
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
2b2f4bb8ab
commit
913049ac3d
|
@ -59,31 +59,6 @@ const columns = [
|
||||||
createOrder: 12,
|
createOrder: 12,
|
||||||
width: '25px',
|
width: '25px',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: t('Buyer'),
|
|
||||||
name: 'workerFk',
|
|
||||||
component: 'select',
|
|
||||||
attrs: {
|
|
||||||
url: 'TicketRequests/getItemTypeWorker',
|
|
||||||
fields: ['id', 'nickname'],
|
|
||||||
optionLabel: 'nickname',
|
|
||||||
sortBy: 'nickname ASC',
|
|
||||||
optionValue: 'id',
|
|
||||||
},
|
|
||||||
visible: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('Family'),
|
|
||||||
name: 'itemTypeFk',
|
|
||||||
component: 'select',
|
|
||||||
attrs: {
|
|
||||||
url: 'itemTypes',
|
|
||||||
fields: ['id', 'name'],
|
|
||||||
optionLabel: 'name',
|
|
||||||
optionValue: 'id',
|
|
||||||
},
|
|
||||||
visible: false,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'id',
|
name: 'id',
|
||||||
isId: true,
|
isId: true,
|
||||||
|
@ -115,15 +90,8 @@ const columns = [
|
||||||
{
|
{
|
||||||
align: 'center',
|
align: 'center',
|
||||||
label: t('Article'),
|
label: t('Article'),
|
||||||
|
component: 'input',
|
||||||
name: 'name',
|
name: 'name',
|
||||||
component: 'select',
|
|
||||||
attrs: {
|
|
||||||
url: 'Items',
|
|
||||||
fields: ['id', 'name'],
|
|
||||||
optionLabel: 'name',
|
|
||||||
optionValue: 'id',
|
|
||||||
sortBy: 'name ASC',
|
|
||||||
},
|
|
||||||
width: '85px',
|
width: '85px',
|
||||||
isEditable: false,
|
isEditable: false,
|
||||||
},
|
},
|
||||||
|
@ -423,6 +391,8 @@ const itemTypeFk = ref(null);
|
||||||
const inkFk = ref(null);
|
const inkFk = ref(null);
|
||||||
const tag1 = ref(null);
|
const tag1 = ref(null);
|
||||||
const tag2 = ref(null);
|
const tag2 = ref(null);
|
||||||
|
const tag1Filter = ref(null);
|
||||||
|
const tag2Filter = ref(null);
|
||||||
const filter = computed(() => {
|
const filter = computed(() => {
|
||||||
const where = {};
|
const where = {};
|
||||||
if (buyerFk.value) {
|
if (buyerFk.value) {
|
||||||
|
@ -434,6 +404,7 @@ const filter = computed(() => {
|
||||||
if (inkFk.value) {
|
if (inkFk.value) {
|
||||||
where.inkFk = inkFk.value;
|
where.inkFk = inkFk.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tag1.value) {
|
if (tag1.value) {
|
||||||
where.tag1 = tag1.value;
|
where.tag1 = tag1.value;
|
||||||
}
|
}
|
||||||
|
@ -710,8 +681,16 @@ onMounted(() => {
|
||||||
option-label="name"
|
option-label="name"
|
||||||
sort-by="name ASC"
|
sort-by="name ASC"
|
||||||
/>
|
/>
|
||||||
<VnInput v-model="tag1" :label="t('Tag')" :placeholder="t('Tag')" />
|
<VnInput
|
||||||
<VnInput v-model="tag2" :label="t('Tag')" :placeholder="t('Tag')" />
|
v-model="tag1Filter"
|
||||||
|
:label="t('Tag')"
|
||||||
|
@keyup.enter="tag1 = tag1Filter"
|
||||||
|
/>
|
||||||
|
<VnInput
|
||||||
|
v-model="tag2Filter"
|
||||||
|
:label="t('Tag')"
|
||||||
|
@keyup.enter="tag2 = tag2Filter"
|
||||||
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
</template>
|
</template>
|
||||||
<template #column-hex="{ row }">
|
<template #column-hex="{ row }">
|
||||||
|
|
|
@ -7,14 +7,44 @@ describe('EntryNotes', () => {
|
||||||
cy.visit(`/#/entry/list`);
|
cy.visit(`/#/entry/list`);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Create delete and edit', () => {
|
const createObservation = (type, description) => {
|
||||||
|
cy.dataCy('vnTableCreateBtn').click();
|
||||||
|
cy.dataCy('Observation type_select').eq(1).should('be.visible').type(type);
|
||||||
|
cy.get('div[role="listbox"] > div > div[role="option"]').eq(0).click();
|
||||||
|
cy.dataCy('Description_input').should('be.visible').type(description);
|
||||||
|
cy.dataCy('FormModelPopup_save').should('be.enabled').click();
|
||||||
|
};
|
||||||
|
|
||||||
|
const editObservation = (rowIndex, type, description) => {
|
||||||
|
cy.get(`td[data-col-field="description"][data-row-index="${rowIndex}"]`)
|
||||||
|
.click()
|
||||||
|
.clear()
|
||||||
|
.type(description);
|
||||||
|
cy.get(`td[data-col-field="observationTypeFk"][data-row-index="${rowIndex}"]`)
|
||||||
|
.click()
|
||||||
|
.clear()
|
||||||
|
.type(type);
|
||||||
|
cy.get('div[role="listbox"] > div > div[role="option"]').eq(0).click();
|
||||||
|
cy.saveCard();
|
||||||
|
};
|
||||||
|
|
||||||
|
it('Create, delete, and edit observations', () => {
|
||||||
cy.createEntry();
|
cy.createEntry();
|
||||||
cy.waitForElement('[data-cy="entry-buys"]');
|
cy.waitForElement('[data-cy="entry-buys"]');
|
||||||
|
|
||||||
cy.dataCy('EntryNotes-menu-item').click();
|
cy.dataCy('EntryNotes-menu-item').click();
|
||||||
cy.dataCy('vnTableCreateBtn').click();
|
|
||||||
cy.dataCy('Observation type_select').eq(1).should('be.visible').type('Packager');
|
createObservation('Packager', 'test');
|
||||||
cy.dataCy('Description_input').should('be.visible').type('test');
|
cy.get('.q-notification__message').eq(0).should('have.text', 'Data created');
|
||||||
cy.dataCy('FormModelPopup_save').should('be.enabled').click();
|
|
||||||
|
editObservation(0, 'Administrative', 'test2');
|
||||||
|
|
||||||
|
createObservation('Administrative', 'test');
|
||||||
|
cy.get('.q-notification__message')
|
||||||
|
.eq(2)
|
||||||
|
.should('have.text', "The observation type can't be repeated");
|
||||||
|
cy.dataCy('FormModelPopup_cancel').click();
|
||||||
|
|
||||||
cy.deleteEntry();
|
cy.deleteEntry();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -7,20 +7,12 @@ describe('Entry', () => {
|
||||||
cy.visit(`/#/entry/list`);
|
cy.visit(`/#/entry/list`);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Filter deleted entries and view popup summary', () => {
|
it('View popup summary', () => {
|
||||||
cy.createEntry();
|
cy.createEntry();
|
||||||
cy.get('.q-notification__message').eq(0).should('have.text', 'Data created');
|
cy.get('.q-notification__message').eq(0).should('have.text', 'Data created');
|
||||||
cy.waitForElement('[data-cy="entry-buys"]');
|
cy.waitForElement('[data-cy="entry-buys"]');
|
||||||
cy.deleteEntry();
|
cy.deleteEntry();
|
||||||
cy.typeSearchbar('{enter}');
|
cy.typeSearchbar('{enter}');
|
||||||
cy.get('span[title="Date"]').click().click();
|
|
||||||
cy.typeSearchbar('{enter}');
|
|
||||||
cy.url().should('include', 'order');
|
|
||||||
cy.get('td[data-row-index="0"][data-col-field="landed"]').should(
|
|
||||||
'have.text',
|
|
||||||
'-',
|
|
||||||
);
|
|
||||||
|
|
||||||
cy.get('button[title="Summary"]').eq(1).should('be.visible').click();
|
cy.get('button[title="Summary"]').eq(1).should('be.visible').click();
|
||||||
cy.dataCy('entry-summary').should('be.visible');
|
cy.dataCy('entry-summary').should('be.visible');
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue