Skip to content

Commit fd260bb

Browse files
bors[bot]devcer
andauthored
Merge #448
448: Updated cypress tests for when search query doesn't have any results … r=bidoubiwa a=devcer …and placeholder text check Fixes: #339 Co-authored-by: devcer <[email protected]> Co-authored-by: Santosh Viswanatham <[email protected]>
2 parents f56b8b4 + 285e2d9 commit fd260bb

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

cypress/integration/first_tests.specs.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,26 @@ describe(`My first test`, () => {
1919
cy.get('div.dsb-suggestion:nth-child(1)') // the first entry should be "Quick start"
2020
.contains('Quick start')
2121
})
22+
23+
it('Should test all other subheadings', () => {
24+
cy.get('div.dsb-suggestion:nth-child(2)') // the second entry should be "Download and launch"
25+
.contains('Download and launch')
26+
cy.get('div.dsb-suggestion:nth-child(3)') // the third entry should be "Add documents"
27+
.contains('Add documents')
28+
})
29+
30+
it('Should have valid placeholder text', () => {
31+
cy.get('#docs-searchbar-suggestion').should(
32+
'have.attr',
33+
'placeholder',
34+
'Search the docs',
35+
)
36+
})
37+
38+
it('Should display a no results message when search results are empty', () => {
39+
cy.get('#docs-searchbar-suggestion').type(' empty results')
40+
cy.get('#meilisearch-autocomplete-listbox-0').should('be.visible')
41+
cy.get('div.docs-searchbar-suggestion') // No Results message should be displayed instead
42+
.contains('No results found for query')
43+
})
2244
})

0 commit comments

Comments
 (0)