-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added initial Cypress test to for search results
- Loading branch information
1 parent
25ebd4d
commit c623fe0
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import SearchFacetsFactory from "../factories/searchFacets" | ||
import SearchWithPaginationFactory from "../factories/searchWithPagination" | ||
|
||
describe("Search Result Tests", () => { | ||
beforeEach(() => { | ||
// Intercept search request | ||
cy.interceptGraphql({ | ||
operationName: "searchWithPagination", | ||
factory: SearchWithPaginationFactory, | ||
}) | ||
// Intercept search facets | ||
cy.interceptGraphql({ | ||
operationName: "searchFacets", | ||
factory: SearchFacetsFactory, | ||
}) | ||
}) | ||
|
||
it("Should get results when searching", () => { | ||
cy.visit("/") | ||
|
||
// Search for harry potter and press enter | ||
cy.dataCy("search-input").should("exist").focus().type("harry potter{enter}") | ||
|
||
// Check if search results are displayed | ||
cy.dataCy("work-card").should("have.length.above", 6) | ||
}) | ||
}) |