Skip to content

Commit

Permalink
Added tests for autocomplete list scroll bar
Browse files Browse the repository at this point in the history
  • Loading branch information
joelit committed Dec 18, 2024
1 parent 622ae67 commit d89d277
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/cypress/template/vocab-search-bar.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,21 @@ describe('Vocab search bar', () => {
cy.get('li').last().find('b').eq(0).should('have.text', '51')
})
})
it('Long autocomplete result list should have a scroll bar', () => {
// go to YSO vocab front page
cy.visit('/yso/fi/')

// resize the window to smaller size
cy.viewport(1200, 600)

// type a search term and wait for the autocomplete to appear
cy.get('#search-field').type('mu')
cy.get('#search-autocomplete-results').should('be.visible')

// the result list should have a CSS-based scroll
cy.get('#search-autocomplete-results').should('have.css', 'overflow-y', 'auto')
cy.get('#search-autocomplete-results').should('have.css', 'max-height', '300px')
});
});

describe('Cookie Management', () => {
Expand Down

0 comments on commit d89d277

Please sign in to comment.