Skip to content

Commit

Permalink
DEVPROD-7046: Fix e2e tests (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
sophstad authored May 31, 2024
1 parent bab9c18 commit fcae119
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
3 changes: 3 additions & 0 deletions apps/spruce/cypress/integration/hosts/hosts_sorting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const sortByTests = [
sortBy: "CURRENT_TASK",
expectedIds: [
"i-04ade558e1e26b0ad",
"i-07669e7a3cd2c238c",
"i-0d0ae8b83366d22",
"i-0d0ae8b83366d22b",
"i-0d0ae8b83366d22be",
Expand Down Expand Up @@ -68,6 +69,7 @@ const sortByTests = [
sortBy: "ELAPSED",
expectedIds: [
"i-04ade558e1e26b0ad",
"i-07669e7a3cd2c238c",
"i-0d0ae8b83366d22",
"i-0d0ae8b83366d22b",
"i-0d0ae8b83366d22be",
Expand Down Expand Up @@ -119,6 +121,7 @@ const sortDirectionTests = [
order: "ascending",
expectedIds: [
"i-04ade558e1e26b0ad",
"i-07669e7a3cd2c238c",
"i-0d0ae8b83366d22",
"i-0d0ae8b83366d22b",
"i-0d0ae8b83366d22be",
Expand Down
16 changes: 10 additions & 6 deletions apps/spruce/cypress/integration/spawn/host.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
const ascendingSortSpawnHostOrderByHostId = [
"i-04ade558e1e26b0ad",
"i-07669e7a3cd2c238c",
"i-092593689871a50dc",
];
const descendingSortSpawnHostOrderByHostId = [
"i-092593689871a50dc",
"i-07669e7a3cd2c238c",
"i-04ade558e1e26b0ad",
];

const descendingSortSpawnHostOrderByExpiration = [
"i-04ade558e1e26b0ad",
"i-092593689871a50dc",
"i-07669e7a3cd2c238c",
"i-04ade558e1e26b0ad",
];
const ascendingSortSpawnHostOrderByExpiration = [
"i-092593689871a50dc",
"i-04ade558e1e26b0ad",
"i-07669e7a3cd2c238c",
"i-092593689871a50dc",
];

const hostTaskId =
Expand All @@ -25,7 +29,7 @@ describe("Navigating to Spawn Host page", () => {
cy.visit("/spawn/host");
});
it("Visiting the spawn host page should display all of your spawned hosts", () => {
cy.dataCy("leafygreen-table-row").should("have.length", 2);
cy.dataCy("leafygreen-table-row").should("have.length", 3);
});
it("Visiting the spawn host page should not have any cards expanded by default", () => {
cy.dataCy("spawn-host-card").should("not.exist");
Expand Down Expand Up @@ -55,7 +59,7 @@ describe("Navigating to Spawn Host page", () => {
});

it("Visiting the spawn host page should display all of your spawned hosts not sorted by default", () => {
cy.dataCy("leafygreen-table-row").should("have.length", 2);
cy.dataCy("leafygreen-table-row").should("have.length", 3);
});

it("Clicking on the host column header should sort spawn hosts by ascending order, then descending, then remove sort", () => {
Expand All @@ -68,7 +72,7 @@ describe("Navigating to Spawn Host page", () => {
cy.wrap($el).contains(descendingSortSpawnHostOrderByHostId[index]),
);
cy.get("@hostSortControl").click();
cy.dataCy("leafygreen-table-row").should("have.length", 2);
cy.dataCy("leafygreen-table-row").should("have.length", 3);
});

it("Clicking on the expiration column header should sort the hosts by ascending order, then descending, then remove sort", () => {
Expand All @@ -83,7 +87,7 @@ describe("Navigating to Spawn Host page", () => {
cy.wrap($el).contains(descendingSortSpawnHostOrderByExpiration[index]),
);
cy.get("@expiresInSortControl").click();
cy.dataCy("leafygreen-table-row").should("have.length", 2);
cy.dataCy("leafygreen-table-row").should("have.length", 3);
});
});

Expand Down

0 comments on commit fcae119

Please sign in to comment.