Skip to content

Updated cypress tests for when search query doesn't have any results … #448

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Oct 19, 2021
22 changes: 22 additions & 0 deletions cypress/integration/first_tests.specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,26 @@ describe(`My first test`, () => {
cy.get('div.dsb-suggestion:nth-child(1)') // the first entry should be "Quick start"
.contains('Quick start')
})

it('Should test all other subheadings', () => {
cy.get('div.dsb-suggestion:nth-child(2)') // the second entry should be "Download and launch"
.contains('Download and launch')
cy.get('div.dsb-suggestion:nth-child(3)') // the third entry should be "Add documents"
.contains('Add documents')
})

it('Should have valid placeholder text', () => {
cy.get('#docs-searchbar-suggestion').should(
'have.attr',
'placeholder',
'Search the docs',
)
})

it('Should display a no results message when search results are empty', () => {
cy.get('#docs-searchbar-suggestion').type(' empty results')
cy.get('#meilisearch-autocomplete-listbox-0').should('be.visible')
cy.get('div.docs-searchbar-suggestion') // No Results message should be displayed instead
.contains('No results found for query')
})
})