diff --git a/packages/manager/.changeset/pr-10384-tests-1713976558483.md b/packages/manager/.changeset/pr-10384-tests-1713976558483.md new file mode 100644 index 00000000000..330718e47e3 --- /dev/null +++ b/packages/manager/.changeset/pr-10384-tests-1713976558483.md @@ -0,0 +1,5 @@ +--- +"@linode/manager": Tests +--- + +Add Cypress test coverage for Firewall renaming ([#10384](https://github.com/linode/manager/pull/10384)) diff --git a/packages/manager/cypress/e2e/core/firewalls/update-firewall.spec.ts b/packages/manager/cypress/e2e/core/firewalls/update-firewall.spec.ts index c8e25a1fbc6..dbbde69165f 100644 --- a/packages/manager/cypress/e2e/core/firewalls/update-firewall.spec.ts +++ b/packages/manager/cypress/e2e/core/firewalls/update-firewall.spec.ts @@ -396,4 +396,65 @@ describe('update firewall', () => { }); }); }); + + /* + * - Confirms that firewall's label can be updated on landing page. + */ + it("updates a firewall's label", () => { + const region = chooseRegion(); + + const linodeRequest = createLinodeRequestFactory.build({ + label: randomLabel(), + region: region.id, + root_pass: randomString(16), + }); + + const firewallRequest = firewallFactory.build({ + label: randomLabel(), + rules: { + inbound: [], + outbound: [], + }, + }); + + const newFirewallLabel = randomLabel(); + + cy.defer( + createLinodeAndFirewall(linodeRequest, firewallRequest), + 'creating Linode and firewall' + ).then(([_linode, firewall]) => { + cy.visitWithLogin('/firewalls'); + + // Confirm that firewall is listed on landing page with expected configuration. + cy.findByText(firewall.label) + .closest('tr') + .within(() => { + cy.findByText(firewall.label).should('be.visible'); + cy.findByText('Enabled').should('be.visible'); + cy.findByText('No rules').should('be.visible'); + cy.findByText('None assigned').should('be.visible'); + }); + + cy.visitWithLogin(`/firewalls/${firewall.id}`); + + cy.findByLabelText(`Edit ${firewall.label}`).click(); + cy.get(`[id="edit-${firewall.label}-label"]`) + .click() + .clear() + .type(`${newFirewallLabel}{enter}`); + + // Confirm Firewall label updates in breadcrumbs. + ui.entityHeader.find().within(() => { + cy.findByText(newFirewallLabel).should('be.visible'); + cy.findByText('firewalls').click(); + }); + + // Confirm firewall label is updated on landing page without refresh. + cy.findByText(newFirewallLabel).should('be.visible'); + + // Confirm firewall label is updated on landing page after refresh. + cy.reload(); + cy.findByText(newFirewallLabel).should('be.visible'); + }); + }); });