fix: refs #6943 e2e clientList, formModel
gitea/salix-front/pipeline/pr-dev Something is wrong with the build of this commit
Details
gitea/salix-front/pipeline/pr-dev Something is wrong with the build of this commit
Details
This commit is contained in:
parent
ce30276c73
commit
cb034dc406
|
@ -12,7 +12,6 @@ import SkeletonForm from 'components/ui/SkeletonForm.vue';
|
|||
import VnConfirm from './ui/VnConfirm.vue';
|
||||
import { tMobile } from 'src/composables/tMobile';
|
||||
import { useArrayData } from 'src/composables/useArrayData';
|
||||
import { getDifferences, getUpdatedValues } from 'src/filters';
|
||||
|
||||
const { push } = useRouter();
|
||||
const quasar = useQuasar();
|
||||
|
@ -285,12 +284,7 @@ function trimData(data) {
|
|||
}
|
||||
return data;
|
||||
}
|
||||
function onBeforeSave(formData, originalData) {
|
||||
return getUpdatedValues(
|
||||
Object.keys(getDifferences(formData, originalData)),
|
||||
formData,
|
||||
);
|
||||
}
|
||||
|
||||
async function onKeyup(evt) {
|
||||
if (evt.key === 'Enter' && !('prevent-submit' in attrs)) {
|
||||
const input = evt.target;
|
||||
|
@ -327,7 +321,6 @@ defineExpose({
|
|||
class="q-pa-md"
|
||||
:style="maxWidth ? 'max-width: ' + maxWidth : ''"
|
||||
id="formModel"
|
||||
:mapper="onBeforeSave"
|
||||
>
|
||||
<QCard>
|
||||
<slot
|
||||
|
|
|
@ -225,7 +225,7 @@ const toModule = computed(() =>
|
|||
<div class="icons">
|
||||
<slot name="icons" :entity="entity" />
|
||||
</div>
|
||||
<div class="actions justify-center">
|
||||
<div class="actions justify-center" data-cy="descriptor_actions">
|
||||
<slot name="actions" :entity="entity" />
|
||||
</div>
|
||||
<slot name="after" />
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
/// <reference types="cypress" />
|
||||
describe.skip('Client list', () => {
|
||||
describe('Client list', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1280, 720);
|
||||
cy.login('developer');
|
||||
cy.visit('/#/customer/list', {
|
||||
timeout: 5000,
|
||||
|
@ -28,7 +27,7 @@ describe.skip('Client list', () => {
|
|||
Email: { val: `user.test${randomInt}@cypress.com` },
|
||||
'Sales person': { val: 'salesPerson', type: 'select' },
|
||||
Location: { val: '46000', type: 'select' },
|
||||
'Business type': { val: 'Otros', type: 'select' },
|
||||
'Business type': { val: 'others', type: 'select' },
|
||||
};
|
||||
cy.fillInForm(data);
|
||||
|
||||
|
@ -37,6 +36,7 @@ describe.skip('Client list', () => {
|
|||
cy.checkNotification('Data created');
|
||||
cy.url().should('include', '/summary');
|
||||
});
|
||||
|
||||
it('Client list search client', () => {
|
||||
const search = 'Jessica Jones';
|
||||
cy.searchByLabel('Name', search);
|
||||
|
@ -59,6 +59,7 @@ describe.skip('Client list', () => {
|
|||
cy.checkValueForm(1, search);
|
||||
cy.checkValueForm(2, search);
|
||||
});
|
||||
|
||||
it('Client founded create order', () => {
|
||||
const search = 'Jessica Jones';
|
||||
cy.searchByLabel('Name', search);
|
||||
|
|
|
@ -329,8 +329,13 @@ Cypress.Commands.add('openUserPanel', () => {
|
|||
Cypress.Commands.add('checkNotification', (text) => {
|
||||
cy.get('.q-notification', { timeout: 10000 })
|
||||
.should('be.visible')
|
||||
.filter((_, el) => Cypress.$(el).text().includes(text))
|
||||
.should('have.length.greaterThan', 0);
|
||||
.should('have.length.greaterThan', 0)
|
||||
.should(($elements) => {
|
||||
const found = $elements
|
||||
.toArray()
|
||||
.some((el) => Cypress.$(el).text().includes(text));
|
||||
expect(found).to.be.true;
|
||||
});
|
||||
});
|
||||
|
||||
Cypress.Commands.add('openActions', (row) => {
|
||||
|
@ -376,7 +381,13 @@ Cypress.Commands.add('clickButtonWith', (type, value) => {
|
|||
}
|
||||
});
|
||||
Cypress.Commands.add('clickButtonWithIcon', (iconClass) => {
|
||||
cy.get(`.q-icon.${iconClass}`).parent().click();
|
||||
cy.waitForElement('[data-cy="descriptor_actions"]');
|
||||
cy.get('[data-cy="loading-spinner"]', { timeout: 10000 }).should('not.be.visible');
|
||||
cy.get('.q-btn')
|
||||
.filter((index, el) => Cypress.$(el).find('.q-icon.' + iconClass).length > 0)
|
||||
.then(($btn) => {
|
||||
cy.wrap($btn).click();
|
||||
});
|
||||
});
|
||||
Cypress.Commands.add('clickButtonWithText', (buttonText) => {
|
||||
cy.get('.q-btn').contains(buttonText).click();
|
||||
|
|
Loading…
Reference in New Issue