Skip to content

Commit

Permalink
Update datatable component tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminCharmes committed Sep 24, 2024
1 parent 8025485 commit 9dfc4f6
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
26 changes: 26 additions & 0 deletions webapp/cypress/component/EquipmentTableTest.cy.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,30 @@ describe("EquipmentTable Component Tests", () => {
cy.get("td").eq(5).find(".avatar").should("have.length", 2);
});
});

it("renders the component FormattedItemName", () => {
cy.get(".p-datatable-tbody tr")
.eq(0)
.within(() => {
cy.get("td").eq(1).find(".formatted-item-name").should("exist");
});
cy.get(".p-datatable-tbody tr")
.eq(1)
.within(() => {
cy.get("td").eq(1).find(".formatted-item-name").should("exist");
});
});

it("renders the component Creators", () => {
cy.get(".p-datatable-tbody tr")
.eq(0)
.within(() => {
cy.get("td").eq(5).find(".avatar").should("exist");
});
cy.get(".p-datatable-tbody tr")
.eq(1)
.within(() => {
cy.get("td").eq(5).find(".avatar").should("exist");
});
});
});
13 changes: 13 additions & 0 deletions webapp/cypress/component/StartingMaterialTableTest.cy.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,17 @@ describe("StartingMaterialTable Component Tests", () => {
cy.get("td").eq(6).should("contain.text", "2");
});
});

it("renders the component FormattedItemName", () => {
cy.get(".p-datatable-tbody tr")
.eq(0)
.within(() => {
cy.get("td").eq(1).find(".formatted-item-name").should("exist");
});
cy.get(".p-datatable-tbody tr")
.eq(1)
.within(() => {
cy.get("td").eq(1).find(".formatted-item-name").should("exist");
});
});
});

0 comments on commit 9dfc4f6

Please sign in to comment.