2021-02-07 00:28:14 -08:00
|
|
|
// Give network requests a bit of breathing room!
|
|
|
|
const networkTimeout = { timeout: 6000 };
|
2021-02-04 23:34:43 -08:00
|
|
|
|
|
|
|
describe("WardrobePage: SearchPanel", () => {
|
|
|
|
// NOTE: This test depends on specific search results on certain pages, and
|
|
|
|
// could break if a lot of matching items are added to the site!
|
2021-02-07 00:31:15 -08:00
|
|
|
it.only("Searches by keyword", () => {
|
2021-02-04 23:34:43 -08:00
|
|
|
cy.visit("/outfits/new");
|
|
|
|
|
|
|
|
// The first page should contain this item.
|
|
|
|
cy.get("[data-test-id=item-search-input]").type("winter");
|
|
|
|
cy.contains("A Warm Winters Night Background", networkTimeout).should(
|
|
|
|
"exist"
|
|
|
|
);
|
|
|
|
|
|
|
|
// And the second page should contain this item.
|
|
|
|
cy.get("[data-test-id=search-panel-scroll-container]").scrollTo("bottom");
|
|
|
|
cy.contains(
|
2021-02-07 00:31:15 -08:00
|
|
|
"Dyeworks Purple: Winter Rose Foreground",
|
2021-02-04 23:34:43 -08:00
|
|
|
networkTimeout
|
|
|
|
).should("exist");
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Only shows items that fit", () => {
|
|
|
|
cy.visit("/outfits/new");
|
|
|
|
|
|
|
|
// Searching for Christmas paintbrush items should show the Acara items,
|
|
|
|
// but not the Aisha items.
|
|
|
|
cy.get("[data-test-id=item-search-input]")
|
|
|
|
.type("pb{enter}")
|
|
|
|
.type("christmas");
|
|
|
|
cy.contains("Christmas Acara Coat", networkTimeout).should("exist");
|
|
|
|
cy.contains("Christmas Aisha Collar").should("not.exist");
|
|
|
|
});
|
|
|
|
});
|