Skip to content

Commit

Permalink
test: fix add subnet test
Browse files Browse the repository at this point in the history
  • Loading branch information
petermakowski committed Apr 5, 2024
1 parent 1697892 commit 65c8f5a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions cypress/e2e/with-users/subnets/add.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,27 +90,27 @@ context("Subnets - Add", () => {
});

it("can add and delete a new subnet", () => {
const fabricName = `cy-fabric-${generateId()}`;
const fabric = `cy-fabric-${generateId()}`;
const spaceName = `cy-space-${generateId()}`;
const vid = generateVid();
const vlanName = `cy-vlan-${vid}`;
const vlan = `cy-vlan-${vid}`;
const cidr = "192.168.122.18";
const subnetName = `cy-subnet-${generateId()}`;

completeForm("Fabric", fabricName);
completeForm("Fabric", fabric);
completeForm("Space", spaceName);
completeAddVlanForm(vid, vlanName, fabricName, spaceName);
cy.addSubnet(subnetName, cidr, fabricName, vid, vlanName);
completeAddVlanForm(vid, vlan, fabric, spaceName);
cy.addSubnet({ subnetName, cidr, fabric, vid, vlan });

cy.findAllByRole("link", { name: fabricName }).should("have.length", 2);
cy.findAllByRole("link", { name: fabric }).should("have.length", 2);

// Check it groups items added to the same fabric correctly
cy.findAllByRole("row", { name: fabricName })
cy.findAllByRole("row", { name: fabric })
.eq(1)
.within(() => {
cy.findAllByRole("gridcell")
.eq(1)
.should("have.text", `${vid} (${vlanName})`);
.should("have.text", `${vid} (${vlan})`);
cy.findAllByRole("gridcell").eq(3).should("contain.text", subnetName);
cy.findAllByRole("gridcell").eq(5).should("have.text", spaceName);
});
Expand Down

0 comments on commit 65c8f5a

Please sign in to comment.