mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-14 12:56:34 +03:00
39 lines
961 B
TypeScript
39 lines
961 B
TypeScript
describe('Search', () => {
|
|
before(() => {
|
|
cy.visit('e2e/standalone.html');
|
|
});
|
|
|
|
it('should be closed by default', function() {
|
|
cy
|
|
.get('.menu-content div')
|
|
.filter('.search-box')
|
|
.should('have.length', 0);
|
|
});
|
|
|
|
it('should not open for less than 3 symbols', function() {
|
|
cy.get('.search-input').type('in', { force: true });
|
|
cy
|
|
.get('.menu-content div')
|
|
.filter('.search-box')
|
|
.should('have.length', 0);
|
|
});
|
|
|
|
it('should find 3 results when typed int', function() {
|
|
cy.get('.search-input').type('t', { force: true });
|
|
cy
|
|
.get('.search-results')
|
|
.find('li')
|
|
.should('have.length', 3)
|
|
.first()
|
|
.should('contain', 'Introduction');
|
|
});
|
|
|
|
it('should clear when ESQ is pressed', function() {
|
|
cy.get('.search-input').type('{esc}', { force: true });
|
|
cy
|
|
.get('.menu-content div')
|
|
.filter('.search-box')
|
|
.should('have.length', 0);
|
|
});
|
|
});
|