From 51fdfb4c49be0879fa0f9cf1113fdc0b0522db89 Mon Sep 17 00:00:00 2001 From: Zain Fathoni Date: Tue, 14 Sep 2021 23:53:03 +0800 Subject: [PATCH] test(e2e): displays the empty state when there's no matching item --- cypress/e2e/contacts/search.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cypress/e2e/contacts/search.js b/cypress/e2e/contacts/search.js index 2aaed12d..aa1ad677 100644 --- a/cypress/e2e/contacts/search.js +++ b/cypress/e2e/contacts/search.js @@ -36,4 +36,14 @@ describe("contacts page typed search", () => { cy.findAllByText(/dompet dhuafa/i).should("be.visible"), ); }); + + it("displays the empty state when the search keyword matches nothing", () => { + cy.findByRole("textbox", { + name: /cari kontak:/i, + }).type("aoeu{enter}"); + + cy.findByRole("heading", { + name: /fasilitas tidak ditemukan/i, + }).should("be.visible"); + }); });