This repository has been archived by the owner on Jul 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
56 changed files
with
2,972 additions
and
1,338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,32 @@ | ||
describe("Auth", () => { | ||
it("Unauthenticated user is redirected to login page after visiting a private route", () => { | ||
cy.clearCookie("mci-token"); | ||
cy.logout(); | ||
cy.visit("/version/123123"); | ||
cy.url().should("include", "/login"); | ||
cy.location("pathname").should("equal", "/login"); | ||
}); | ||
|
||
it("Redirects user to My Patches page after logging in", () => { | ||
cy.clearCookie("mci-token"); | ||
cy.logout(); | ||
cy.visit("/"); | ||
cy.enterLoginCredentials(); | ||
cy.url().should("include", "/user/admin/patches"); | ||
cy.location("pathname").should("equal", "/user/admin/patches"); | ||
}); | ||
|
||
it("Can log out via the dropdown", () => { | ||
cy.visit("/"); | ||
cy.location("pathname").should("equal", "/user/admin/patches"); | ||
cy.dataCy("user-dropdown-link").click(); | ||
cy.dataCy("log-out").click(); | ||
cy.location("pathname").should("equal", "/login"); | ||
}); | ||
|
||
it("Automatically authenticates user if they are logged in", () => { | ||
cy.visit("/version/123123"); | ||
cy.url().should("include", "/version/123123"); | ||
cy.location("pathname").should("equal", "/version/123123"); | ||
}); | ||
|
||
it("Redirects user to their patches page if they are already logged in and visit login page", () => { | ||
cy.visit("/login"); | ||
cy.url().should("include", "/user/admin/patches"); | ||
cy.location("pathname").should("equal", "/user/admin/patches"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { save } from "./utils"; | ||
|
||
describe("host section", () => { | ||
describe("using legacy ssh", () => { | ||
beforeEach(() => { | ||
cy.visit("/distro/localhost/settings/host"); | ||
}); | ||
|
||
it("shows the correct fields when distro has static provider", () => { | ||
cy.dataCy("authorized-keys-input").should("exist"); | ||
cy.dataCy("minimum-hosts-input").should("not.exist"); | ||
cy.dataCy("maximum-hosts-input").should("not.exist"); | ||
cy.dataCy("idle-time-input").should("not.exist"); | ||
cy.dataCy("future-fraction-input").should("not.exist"); | ||
}); | ||
|
||
it("errors when selecting an incompatible host communication method", () => { | ||
cy.selectLGOption("Host Communication Method", "RPC"); | ||
save(); | ||
cy.validateToast( | ||
"error", | ||
"validating changes for distro 'localhost': 'ERROR: bootstrapping hosts using legacy SSH is incompatible with non-legacy host communication'" | ||
); | ||
cy.selectLGOption("Host Communication Method", "Legacy SSH"); | ||
}); | ||
|
||
it("updates host fields", () => { | ||
cy.selectLGOption("Agent Architecture", "Linux ARM 64-bit"); | ||
cy.getInputByLabel("Working Directory").clear(); | ||
cy.getInputByLabel("Working Directory").type("/usr/local/bin"); | ||
cy.getInputByLabel("SSH User").clear(); | ||
cy.getInputByLabel("SSH User").type("sudo"); | ||
cy.contains("button", "Add SSH option").click(); | ||
cy.getInputByLabel("SSH Option").type("BatchMode=yes"); | ||
cy.selectLGOption("Host Allocator Rounding Rule", "Round down"); | ||
cy.selectLGOption("Host Allocator Feedback Rule", "No feedback"); | ||
cy.selectLGOption( | ||
"Host Overallocation Rule", | ||
"Terminate hosts when overallocated" | ||
); | ||
|
||
save(); | ||
cy.validateToast("success"); | ||
|
||
// Reset fields | ||
cy.selectLGOption("Agent Architecture", "Linux 64-bit"); | ||
cy.getInputByLabel("Working Directory").clear(); | ||
cy.getInputByLabel("Working Directory").type("/home/ubuntu/smoke"); | ||
cy.getInputByLabel("SSH User").clear(); | ||
cy.getInputByLabel("SSH User").type("ubuntu"); | ||
cy.dataCy("delete-item-button").click(); | ||
cy.selectLGOption("Host Allocator Rounding Rule", "Default"); | ||
cy.selectLGOption("Host Allocator Feedback Rule", "Default"); | ||
cy.selectLGOption("Host Overallocation Rule", "Default"); | ||
|
||
save(); | ||
cy.validateToast("success"); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "spruce", | ||
"version": "3.0.132", | ||
"version": "3.0.135", | ||
"private": true, | ||
"scripts": { | ||
"bootstrap-logkeeper": "./scripts/bootstrap-logkeeper.sh", | ||
|
@@ -77,7 +77,7 @@ | |
"@leafygreen-ui/inline-definition": "6.0.0", | ||
"@leafygreen-ui/interaction-ring": "7.0.2", | ||
"@leafygreen-ui/leafygreen-provider": "3.1.0", | ||
"@leafygreen-ui/loading-indicator": "2.0.0", | ||
"@leafygreen-ui/loading-indicator": "2.0.5", | ||
"@leafygreen-ui/marketing-modal": "^4.0.5", | ||
"@leafygreen-ui/menu": "20.0.1", | ||
"@leafygreen-ui/modal": "14.0.1", | ||
|
@@ -88,11 +88,11 @@ | |
"@leafygreen-ui/radio-box-group": "12.0.1", | ||
"@leafygreen-ui/radio-group": "10.1.1", | ||
"@leafygreen-ui/search-input": "2.0.8", | ||
"@leafygreen-ui/segmented-control": "7.0.2", | ||
"@leafygreen-ui/segmented-control": "8.2.6", | ||
"@leafygreen-ui/select": "10.2.0", | ||
"@leafygreen-ui/side-nav": "13.0.2", | ||
"@leafygreen-ui/table": "10.0.1", | ||
"@leafygreen-ui/table/new": "npm:@leafygreen-ui/[email protected].0", | ||
"@leafygreen-ui/table/new": "npm:@leafygreen-ui/[email protected].10", | ||
"@leafygreen-ui/tabs": "11.0.4", | ||
"@leafygreen-ui/text-area": "8.0.4", | ||
"@leafygreen-ui/text-input": "12.1.0", | ||
|
@@ -142,13 +142,14 @@ | |
"@graphql-codegen/typescript-operations": "4.0.1", | ||
"@graphql-eslint/eslint-plugin": "3.18.0", | ||
"@originjs/vite-plugin-commonjs": "1.0.3", | ||
"@storybook/addon-actions": "7.0.21", | ||
"@storybook/addon-essentials": "7.0.21", | ||
"@storybook/addon-interactions": "7.0.21", | ||
"@storybook/addon-links": "7.0.21", | ||
"@storybook/addon-storyshots": "7.0.21", | ||
"@storybook/react": "7.0.21", | ||
"@storybook/react-vite": "7.0.21", | ||
"@sentry/vite-plugin": "2.6.2", | ||
"@storybook/addon-actions": "7.4.0", | ||
"@storybook/addon-essentials": "7.4.0", | ||
"@storybook/addon-interactions": "7.4.0", | ||
"@storybook/addon-links": "7.4.0", | ||
"@storybook/addon-storyshots": "7.4.0", | ||
"@storybook/react": "7.4.0", | ||
"@storybook/react-vite": "7.4.0", | ||
"@storybook/testing-library": "0.2.0", | ||
"@styled/typescript-styled-plugin": "1.0.0", | ||
"@testing-library/jest-dom": "6.1.2", | ||
|
@@ -208,7 +209,7 @@ | |
"rollup-plugin-visualizer": "^5.9.2", | ||
"serve-handler": "^6.1.5", | ||
"simple-git": "3.19.1", | ||
"storybook": "7.0.21", | ||
"storybook": "7.4.0", | ||
"storybook-addon-apollo-client": "^4.1.4", | ||
"ts-node": "10.9.1", | ||
"typescript": "5.0.3", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.