Add language filter test
This commit is contained in:
parent
0943a49f25
commit
033157b1c8
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
const LANGUAGE_COMMUNICATION = 'LANGUAGE_COMMUNICATION';
|
const LANGUAGE_COMMUNICATION = 'LANGUAGE_COMMUNICATION';
|
||||||
const LANGUAGE_COMMUNICATION_VALUE = 'Sprache & Kommunikation';
|
const LANGUAGE_COMMUNICATION_VALUE = 'Sprache & Kommunikation';
|
||||||
const SOCIETY = 'SOCIETY';
|
const SOCIETY = 'SOCIETY';
|
||||||
|
|
@ -71,6 +72,12 @@ describe('Instruments Page', () => {
|
||||||
language: 'de',
|
language: 'de',
|
||||||
|
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
type: ethik,
|
||||||
|
title: 'Instrument: La éthique, bourgois',
|
||||||
|
slug: 'ethik-burgois',
|
||||||
|
language: 'fr',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
InstrumentCategoriesQuery: {
|
InstrumentCategoriesQuery: {
|
||||||
|
|
@ -154,6 +161,24 @@ describe('Instruments Page', () => {
|
||||||
cy.getByDataCy('filter-input').clear();
|
cy.getByDataCy('filter-input').clear();
|
||||||
cy.getByDataCy('instrument').should('have.length', 3);
|
cy.getByDataCy('instrument').should('have.length', 3);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('filter by language', () => {
|
||||||
|
|
||||||
|
|
||||||
|
cy.visit('instruments/');
|
||||||
|
|
||||||
|
cy.get('.filter-bar__language-selection').invoke('show');
|
||||||
|
cy.getByDataCy('radio_button_de').click();
|
||||||
|
cy.getByDataCy('instrument').should('have.length', 3);
|
||||||
|
|
||||||
|
cy.getByDataCy('radio_button_en').click();
|
||||||
|
cy.getByDataCy('instrument').should('have.length', 0);
|
||||||
|
cy.getByDataCy("info-message-no-entry").should('contain', 'Für die ausgewählten Filtereinstellungen sind keine Einträge vorhanden');
|
||||||
|
|
||||||
|
|
||||||
|
cy.getByDataCy('radio_button_fr').click();
|
||||||
|
cy.getByDataCy('instrument').should('have.length', 1);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
</div>
|
</div>
|
||||||
<language-switcher
|
<language-switcher
|
||||||
class="filter-bar__language-selection"
|
class="filter-bar__language-selection"
|
||||||
v-if="$flavor.showLanguageFilter"
|
v-show="$flavor.showLanguageFilter"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
<div class="pill-radio">
|
<div class="pill-radio">
|
||||||
<button
|
<button
|
||||||
:class="['pill-radio__button', { 'pill-radio__button--active': item === selectedItem }]"
|
:class="['pill-radio__button', { 'pill-radio__button--active': item === selectedItem }]"
|
||||||
|
:data-cy="'radio_button_' + item"
|
||||||
v-for="item in props.items"
|
v-for="item in props.items"
|
||||||
:key="item"
|
:key="item"
|
||||||
@click="updateSelectedItem(item)"
|
@click="updateSelectedItem(item)"
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
<info-message
|
<info-message
|
||||||
class="instrument-overview__no-instruments"
|
class="instrument-overview__no-instruments"
|
||||||
|
data-cy="info-message-no-entry"
|
||||||
v-if="instruments.length > 1 && filteredInstruments.length === 0 && !loading"
|
v-if="instruments.length > 1 && filteredInstruments.length === 0 && !loading"
|
||||||
>
|
>
|
||||||
Für die ausgewählten Filtereinstellungen sind keine Einträge vorhanden
|
Für die ausgewählten Filtereinstellungen sind keine Einträge vorhanden
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue