Skip to content

Commit

Permalink
Removed the language list from SKOSMOS object and hardcoded the relev…
Browse files Browse the repository at this point in the history
…ant cypress test to avoid a false positive test result
  • Loading branch information
joelit committed Oct 8, 2024
1 parent 43b7a1f commit 75d806a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion src/view/scripts.inc.twig
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ window.SKOSMOS = {
"uri": "{{ concept.uri }}",
{% endif %}
{%- if request.vocab ~%}
"languages": [{% for lang in request.vocab.config.languages %}"{{ lang }}"{% if not loop.last %}, {% endif %}{% endfor %}],
"languageOrder": [{% for lang in request.vocab.config.languageOrder(request.contentLang) %}"{{ lang }}"{% if not loop.last %}, {% endif %}{% endfor %}],
"showNotation": {{ request.vocab.config.showNotation ? "true" : "false" }},
"sortByNotation": {% if request.vocab.config.sortByNotation %}"{{ request.vocab.config.sortByNotation }}"{% else %}null{% endif ~%},
Expand Down
3 changes: 1 addition & 2 deletions tests/cypress/template/vocab-search-bar.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ describe('Vocab search bar', () => {
cy.get('#language-list .dropdown-item').then($elements => {
const actualLanguages = $elements.map((index, el) => Cypress.$(el).attr('value')).get();

// The expected languages should be those found in vocabulary configuration with an additional 'all' language
const expectedLanguages = [...win.SKOSMOS.languages, 'all'];
const expectedLanguages = ['fi', 'sv', 'se', 'en', 'all'];

// The two language lists should be of equal length and all of the expected languages can be found
expect(expectedLanguages).to.have.lengthOf(actualLanguages.length);
Expand Down

0 comments on commit 75d806a

Please sign in to comment.