Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Update modal
Browse files Browse the repository at this point in the history
  • Loading branch information
khelif96 committed Sep 14, 2023
1 parent 191c515 commit b161419
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 128 deletions.
16 changes: 11 additions & 5 deletions cypress/integration/version/name_change_modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ describe("Name change modal", () => {
cy.contains(originalName);
cy.dataCy("name-change-modal-trigger").click();
const newName = "a different name";
cy.get("textarea").clear().type(newName);
cy.get("textarea").clear();
cy.get("textarea").type(newName);
cy.contains("Confirm").click();
cy.get("textarea").should("not.exist");
cy.contains(newName);
cy.validateToast("success", "Patch name was successfully updated.", true);
// revert name change
cy.dataCy("name-change-modal-trigger").click();
cy.get("textarea").clear().type(originalName);
cy.get("textarea").clear();
cy.get("textarea").type(originalName);
cy.contains("Confirm").click();
cy.get("textarea").should("not.exist");
cy.validateToast("success", "Patch name was successfully updated.", true);
Expand All @@ -25,13 +27,17 @@ describe("Name change modal", () => {
it("The confirm button is disabled when the text area value is empty or greater than 300 characters", () => {
cy.dataCy("name-change-modal-trigger").click();
cy.get("textarea").clear();
cy.contains("button", "Confirm").should("be.disabled");
cy.contains("button", "Confirm").should("have.attr", "aria-disabled", true);
cy.get("textarea").type("lol");
cy.contains("button", "Confirm").should("not.be.disabled");
cy.contains("button", "Confirm").should(
"have.attr",
"aria-disabled",
false
);
const over300Chars =
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
cy.get("textarea").type(over300Chars);
cy.contains("button", "Confirm").should("be.disabled");
cy.contains("button", "Confirm").should("have.attr", "aria-disabled", true);
cy.contains("Value cannot exceed 300 characters");
});
});
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"@leafygreen-ui/checkbox": "12.0.5",
"@leafygreen-ui/code": "14.0.1",
"@leafygreen-ui/combobox": "5.0.7",
"@leafygreen-ui/confirmation-modal": "4.0.3",
"@leafygreen-ui/confirmation-modal": "5.0.6",
"@leafygreen-ui/emotion": "4.0.3",
"@leafygreen-ui/expandable-card": "3.0.5",
"@leafygreen-ui/guide-cue": "3.0.0",
Expand All @@ -78,9 +78,9 @@
"@leafygreen-ui/interaction-ring": "7.0.2",
"@leafygreen-ui/leafygreen-provider": "3.1.0",
"@leafygreen-ui/loading-indicator": "2.0.5",
"@leafygreen-ui/marketing-modal": "^4.0.5",
"@leafygreen-ui/marketing-modal": "^4.1.0",
"@leafygreen-ui/menu": "20.0.1",
"@leafygreen-ui/modal": "14.0.1",
"@leafygreen-ui/modal": "16.0.1",
"@leafygreen-ui/number-input": "1.0.4",
"@leafygreen-ui/pagination": "1.0.12",
"@leafygreen-ui/palette": "4.0.7",
Expand Down
14 changes: 14 additions & 0 deletions src/gql/generated/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,19 @@ export enum CommunicationMethod {
Ssh = "SSH",
}

export type ContainerPool = {
__typename?: "ContainerPool";
distro: Scalars["String"]["output"];
id: Scalars["String"]["output"];
maxContainers: Scalars["Int"]["output"];
port: Scalars["Int"]["output"];
};

export type ContainerPoolsConfig = {
__typename?: "ContainerPoolsConfig";
pools: Array<ContainerPool>;
};

export type ContainerResources = {
__typename?: "ContainerResources";
cpu: Scalars["Int"]["output"];
Expand Down Expand Up @@ -2330,6 +2343,7 @@ export type SpruceConfig = {
__typename?: "SpruceConfig";
banner?: Maybe<Scalars["String"]["output"]>;
bannerTheme?: Maybe<Scalars["String"]["output"]>;
containerPools?: Maybe<ContainerPoolsConfig>;
githubOrgs: Array<Scalars["String"]["output"]>;
jira?: Maybe<JiraConfig>;
keys: Array<SshKey>;
Expand Down
Loading

0 comments on commit b161419

Please sign in to comment.