Skip to content

Commit

Permalink
Added tests for the contents of the search bar language menu
Browse files Browse the repository at this point in the history
Translations can be maintained with the Symfony-Lokalise combination (pull, push, extract)  but not yet by extracting from Vue code (#1648)

At first, there was some uncertainty about whether the system was actually updating the data correctly (deletion in Lokalise -> deletion locally as well), but it seems that it worked correctly after all. Although the feature branch can be merged, further testing should still be done just to be sure.

Add cypress tests for alphabetical index + add new test vocab

Add cypress test for alt labels

Add cypress files for alphabetical index and hierarchy

Move alphabetical index cypress tests from vocab-home.cy.js + add checks for spinners

Change test vocab name

Fix uriSpace

Fix uri space in test vocab
  • Loading branch information
joelit committed Oct 8, 2024
1 parent d35e29a commit 3267a3b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/cypress/template/vocab-search-bar.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,23 @@ describe('Vocab search bar', () => {
cy.url().should('include', 'clang=sv');
})

it('available search languages are the ones described in the vocabulary config', () => {
cy.visit('/yso/en/') // go to the YSO home page in English language

// check that the vocabulary languages can be found in the search bar language dropdown menu
cy.window().then((win) => {
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'];

// 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);
expectedLanguages.forEach(lang => { expect(actualLanguages).to.include(lang); });
})
})
})
});

describe('Autocomplete', () => {
Expand Down

0 comments on commit 3267a3b

Please sign in to comment.