diff --git a/cypress/integration/app/teamflow.spec.ts b/cypress/integration/app/teamflow.spec.ts new file mode 100644 index 0000000000..a1dac2ec01 --- /dev/null +++ b/cypress/integration/app/teamflow.spec.ts @@ -0,0 +1,44 @@ +describe("Teams flow", () => { + beforeEach(() => { + cy.setup(); + cy.login(); + }); + + it("Create, edit, and delete a team successfully", () => { + cy.visit("/settings/teams"); + + cy.findByRole("button", { name: /create team/i }).click(); + + cy.findByLabelText(/team name/i) + .click() + .type("Valor"); + + // ^$ forces exact match + cy.findByRole("button", { name: /^create$/i }).click(); + + cy.visit("/settings/teams"); + + cy.get(".Select-arrow").click(); + + // need force:true for dropdown + cy.findByText(/edit/i).click({ force: true }); + + cy.findByLabelText(/team name/i) + .click() + .type("{selectall}{backspace}Mystic"); + + cy.findByRole("button", { name: /save/i }).click(); + + cy.visit("/settings/teams"); + + cy.get(".Select-arrow").click(); + + cy.findByText(/delete/i).click({ force: true }); + + cy.findByRole("button", { name: /delete/i }).click(); + + cy.findByText(/successfully deleted/i).should("be.visible"); + + cy.findByText(/mystic/i).should("not.exist"); + }); +}); diff --git a/frontend/components/forms/fields/InputFieldWithIcon/InputFieldWithIcon.jsx b/frontend/components/forms/fields/InputFieldWithIcon/InputFieldWithIcon.jsx index 1c3530fb23..4fa34a4b46 100644 --- a/frontend/components/forms/fields/InputFieldWithIcon/InputFieldWithIcon.jsx +++ b/frontend/components/forms/fields/InputFieldWithIcon/InputFieldWithIcon.jsx @@ -22,7 +22,7 @@ class InputFieldWithIcon extends InputField { }; renderHeading = () => { - const { error, placeholder } = this.props; + const { error, placeholder, name } = this.props; const labelClasses = classnames(`${baseClass}__label`); @@ -30,7 +30,11 @@ class InputFieldWithIcon extends InputField { return