Skip to content

Commit

Permalink
Remove chained gets, they don't work as expected: cypress-io/cypress#…
Browse files Browse the repository at this point in the history
  • Loading branch information
casewalker committed Apr 29, 2024
1 parent ecdcff0 commit 1019dcf
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions webapp/src/components/filesList.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,24 @@ describe("<FilesList />", () => {
cy.mount(<FilesList files={["file1.png", "file2.txt"]} />);
cy.get("tbody").should("contain.html", "tr");
cy.get("tbody > tr").should("have.length", 2);
cy.get("tbody > tr").eq(0).should("contain.text", "file1.png")
.get('svg[data-testid="downarrow-svg"]').should("exist");
cy.get("tbody > tr").eq(1).should("contain.text", "file2.txt")
.get('svg[data-testid="downarrow-svg"]').should("exist");
cy.get("tbody > tr").eq(0).should("contain.text", "file1.png");
cy.get("tbody > tr").eq(1).should("contain.text", "file2.txt");
cy.get('svg[data-testid="downarrow-svg"]').should("exist");
cy.get('svg[data-testid="downarrow-svg"]').should("have.length", 2);

});

it("should have the Image SVGs for an image", () => {
cy.mount(<FilesList files={["file1.png"]} />);
cy.get("tbody > tr").eq(0).should("contain.text", "file1.png")
.get('svg[data-testid="image-svg"]').should("exist")
.get('svg[data-testid="file-svg"]').should("not.exist");
cy.get("tbody > tr").eq(0).should("contain.text", "file1.png");
cy.get('svg[data-testid="image-svg"]').should("exist");
cy.get('svg[data-testid="file-svg"]').should("not.exist");
});

it("should have the File SVGs for a text file", () => {
cy.mount(<FilesList files={["file2.txt"]} />);
cy.get("tbody > tr").eq(0).should("contain.text", "file2.txt")
.get('svg[data-testid="file-svg"]').should("exist")
.get('svg[data-testid="image-svg"]').should("not.exist");
cy.get("tbody > tr").eq(0).should("contain.text", "file2.txt");
cy.get('svg[data-testid="file-svg"]').should("exist");
cy.get('svg[data-testid="image-svg"]').should("not.exist");
});
});

0 comments on commit 1019dcf

Please sign in to comment.