Add new tests for instrument label

This commit is contained in:
Ramon Wenger 2022-05-24 14:56:28 +02:00
parent 428e51f254
commit e05edc0867
2 changed files with 20 additions and 3 deletions

View File

@ -1,9 +1,6 @@
describe('Instruments Page', () => {
beforeEach(() => {
cy.setup();
});
it('opens the instruments page', () => {
const analyse = {
name: 'Analyse',
category: 'LANGUAGE_COMMUNICATION',
@ -63,6 +60,9 @@ describe('Instruments Page', () => {
},
},
});
});
it('opens the instruments page', () => {
cy.visit('instruments/');
cy.getByDataCy('instrument').should('have.length', 3);
@ -85,4 +85,11 @@ describe('Instruments Page', () => {
cy.getByDataCy('filter-all-instruments').click();
cy.getByDataCy('instrument').should('have.length', 3);
});
it('shows the correct instrument label', () => {
cy.visit('instruments/');
cy.getByDataCy('instrument').first().within(() => {
cy.getByDataCy('instrument-subheader').should('contain', 'Instrumente - Sprache & Kommunikation');
});
});
});

View File

@ -0,0 +1,10 @@
describe('Instruments on Module page', () => {
it('shows the correct instrument label', () => {
cy.visit('modules/module-with-instrument');
cy.getByDataCy('instrument').first().within(() => {
cy.getByDataCy('instrument-subheader').should('contain', 'Instrumente - Sprache & Kommunikation');
});
// also check that other content blocks don't have the label
});
});