Add test filter by title

This commit is contained in:
Lorenz Padberg 2023-12-12 15:54:16 +01:00
parent 8c9dfaf98c
commit 0943a49f25
3 changed files with 20 additions and 0 deletions

View File

@ -55,16 +55,21 @@ describe('Instruments Page', () => {
type: analyse, type: analyse,
title: 'Instrument: Analyse', title: 'Instrument: Analyse',
slug: 'analyse', slug: 'analyse',
language: 'de',
}, },
{ {
type: argumentation, type: argumentation,
title: 'Instrument: Argumentation', title: 'Instrument: Argumentation',
slug: 'argumentation', slug: 'argumentation',
language: 'de',
}, },
{ {
type: ethik, type: ethik,
title: 'Instrument: Ethik', title: 'Instrument: Ethik',
slug: 'ethik', slug: 'ethik',
language: 'de',
}, },
], ],
}, },
@ -138,4 +143,17 @@ describe('Instruments Page', () => {
cy.getByDataCy('instrument-subheader').should('contain', 'Instrumente Sprache & Kommunikation'); cy.getByDataCy('instrument-subheader').should('contain', 'Instrumente Sprache & Kommunikation');
}); });
}); });
it('filter by title', () => {
cy.visit('instruments/');
cy.getByDataCy('instrument').should('have.length', 3);
cy.getByDataCy('filter-input').type('Analyse');
cy.getByDataCy('instrument').should('have.length', 1);
cy.getByDataCy('filter-input').clear();
cy.getByDataCy('instrument').should('have.length', 3);
});
}); });

View File

@ -1,6 +1,7 @@
<template> <template>
<div class="language-switcher"> <div class="language-switcher">
<pill-radio-buttons <pill-radio-buttons
data-cy="language-switcher-buttons"
:items="languages" :items="languages"
:selected-item="language" :selected-item="language"
@update:selected-item="changeLanguage" @update:selected-item="changeLanguage"

View File

@ -5,6 +5,7 @@
class="filter-bar__search-input skillbox-input" class="filter-bar__search-input skillbox-input"
type="text" type="text"
placeholder="Suchbegriff eingeben..." placeholder="Suchbegriff eingeben..."
data-cy="filter-input"
ref="searchInputRef" ref="searchInputRef"
v-model="searchQuery" v-model="searchQuery"
@input="updateSearchQuery" @input="updateSearchQuery"