salix-front/test/cypress/integration/customer/clientNotes.spec.js

38 lines
1.2 KiB
JavaScript

/// <reference types="cypress" />
describe('Client notes', () => {
const obervationType = 'Packager';
const user = 'developer';
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit('#/customer/1102/notes');
});
it('should add and filter notes by observation type', () => {
cy.selectOption("[data-cy='VnNotes-observation-type']", obervationType);
cy.dataCy('VnNotes-text-input').type('Test note {enter}');
cy.selectOption("[data-cy='VnNotes-observation-type-filter']", obervationType);
cy.get('.column.full-width')
.children()
.each(($el) => {
cy.dataCy('VnNotes-observation-type-badge').should(
'include.text',
obervationType,
);
});
});
it('should filter notes by user', () => {
cy.selectOption("[data-cy='VnNotes-user-filter']", user);
cy.get('.column.full-width')
.children()
.each(($el) => {
cy.dataCy('VnNotes-observation-type-badge').should(
'include.text',
obervationType,
);
});
});
});