test: refs #8449 refactor e2e vnLog

This commit is contained in:
Alex Moreno 2025-03-26 09:16:32 +01:00
parent c867d6da52
commit 421b68a031
3 changed files with 13 additions and 12 deletions

View File

@ -362,6 +362,7 @@ watch(
backgroundColor: useColor(modelLog.model), backgroundColor: useColor(modelLog.model),
}" }"
:title="`${modelLog.model} #${modelLog.id}`" :title="`${modelLog.model} #${modelLog.id}`"
data-cy="vnLog-model-chip"
> >
{{ t(modelLog.modelI18n) }} {{ t(modelLog.modelI18n) }}
</QChip> </QChip>
@ -477,6 +478,7 @@ watch(
}`, }`,
) )
" "
data-cy="vnLog-action-icon"
/> />
</div> </div>
</QItem> </QItem>

View File

@ -125,6 +125,7 @@ function getActions() {
@update:model-value="() => searchFn()" @update:model-value="() => searchFn()"
dense dense
filled filled
data-cy="vnLog-entity"
/> />
</template> </template>
<template #filter-userType="{ params, columnName, searchFn }"> <template #filter-userType="{ params, columnName, searchFn }">
@ -188,6 +189,7 @@ function getActions() {
@update:model-value=" @update:model-value="
() => searchFn(undefined, 'action', getActions()) () => searchFn(undefined, 'action', getActions())
" "
data-cy="vnLog-checkbox"
/> />
</div> </div>
</template> </template>

View File

@ -1,26 +1,23 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('VnLog', () => { describe('VnLog', () => {
const chips = [
':nth-child(1) > :nth-child(1) > .q-item__label > .q-chip > .q-chip__content',
':nth-child(2) > :nth-child(1) > .q-item__label > .q-chip > .q-chip__content',
];
beforeEach(() => { beforeEach(() => {
cy.login('developer'); cy.login('developer');
cy.visit(`/#/claim/${1}/log`); cy.visit(`/#/claim/${1}/log`);
cy.openRightMenu();
}); });
it('should filter by insert actions', () => { it('should filter by insert actions', () => {
cy.checkOption(':nth-child(7) > .q-checkbox'); cy.get('[data-cy="vnLog-checkbox"]').eq(0).click();
cy.get('.q-page').click(); cy.get('[data-cy="vnLog-action-icon"]').each(($el) => {
cy.validateContent(chips[0], 'Document'); cy.wrap($el).should('have.attr', 'title', 'Creates');
cy.validateContent(chips[1], 'Beginning'); });
}); });
it('should filter by entity', () => { it('should filter by entity', () => {
cy.selectOption('.q-drawer--right .q-item > .q-select', 'Claim'); const entity = 'Document';
cy.get('.q-page').click(); cy.selectOption('[data-cy="vnLog-entity"]', entity);
cy.validateContent(chips[0], 'Beginning'); cy.get('[data-cy="vnLog-model-chip"]').each(($el) => {
cy.wrap($el).should('have.text', entity);
});
}); });
it('should show claimDescriptor', () => { it('should show claimDescriptor', () => {