test: Fix failing test for icon & phone

- for some reason findBYRole("searchbox") stopped working
- there are no changes to related DOM recently
- There's pending issue related to this
https://github.com/testing-library/cypress-testing-library/issues/205#issuecomment-1572230102
This commit is contained in:
Suraj Shetty 2023-06-16 10:23:05 +05:30
parent 1283ece760
commit 9a963bedb5
2 changed files with 4 additions and 4 deletions

View file

@ -42,14 +42,14 @@ context("Control Icon", () => {
it("search for icon and clear search input", () => {
let search_text = "ed";
cy.get(".icon-picker").findByRole("searchbox").click().type(search_text);
cy.get(".icon-picker").get(".search-icons > input").click().type(search_text);
cy.get(".icon-section .icon-wrapper:not(.hidden)").then((i) => {
cy.get(`.icon-section .icon-wrapper[id*='${search_text}']`).then((icons) => {
expect(i.length).to.equal(icons.length);
});
});
cy.get(".icon-picker").findByRole("searchbox").clear().blur();
cy.get(".icon-picker").get(".search-icons > input").clear().blur();
cy.get(".icon-section .icon-wrapper").should("not.have.class", "hidden");
});
});

View file

@ -47,7 +47,7 @@ context("Control Phone", () => {
it("case insensitive search for country and clear search", () => {
let search_text = "india";
cy.get(".selected-phone").click().first();
cy.get(".phone-picker").findByRole("searchbox").click().type(search_text);
cy.get(".phone-picker").get(".search-phones").click().type(search_text);
cy.get(".phone-section .phone-wrapper:not(.hidden)").then((i) => {
cy.get(`.phone-section .phone-wrapper[id*="${search_text.toLowerCase()}"]`).then(
(countries) => {
@ -56,7 +56,7 @@ context("Control Phone", () => {
);
});
cy.get(".phone-picker").findByRole("searchbox").clear().blur();
cy.get(".phone-picker").get(".search-phones").clear();
cy.get(".phone-section .phone-wrapper").should("not.have.class", "hidden");
});