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
EVG-19946: Support Docker on provider settings page #2017
Merged
Merged
Changes from 4 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
46ae0f3
EVG-19946: Add Docker to provider settings page
minnakt 32cd128
Merge branch 'main' into EVG-19946
minnakt d7d501d
Merge branch 'main' into EVG-19946
minnakt 07b316c
Change form schema and address feedback
minnakt 9383586
Merge branch 'main' into EVG-19946
minnakt 405ce37
Address comments
minnakt 0a7ea2f
Surface types
minnakt 2f14006
Prevent `undefined` error
minnakt 9c5beb2
Merge branch 'main' into EVG-19946
minnakt 8e32f60
Use a different distro for test
minnakt f2ab0cc
Merge branch 'main' into EVG-19946
minnakt e3ee2db
Update SpruceConfig mock to contain container pools
minnakt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,72 @@ | ||
import { save } from "./utils"; | ||
|
||
describe("provider section", () => { | ||
beforeEach(() => { | ||
cy.visit("/distro/localhost/settings/provider"); | ||
}); | ||
describe("static", () => { | ||
beforeEach(() => { | ||
cy.visit("/distro/localhost/settings/provider"); | ||
}); | ||
|
||
it("successfully updates static provider fields", () => { | ||
cy.dataCy("provider-select").contains("Static IP/VM"); | ||
|
||
// Correct section is displayed. | ||
cy.dataCy("static-provider-settings").should("exist"); | ||
|
||
it("successfully updates static provider fields", () => { | ||
cy.dataCy("provider-select").contains("Static IP/VM"); | ||
// Change field values. | ||
cy.getInputByLabel("User Data").type("my user data"); | ||
cy.getInputByLabel("Merge with existing user data").check({ | ||
force: true, | ||
}); | ||
cy.contains("button", "Add security group").click(); | ||
cy.getInputByLabel("Security Group ID").type("group-1234"); | ||
save(); | ||
cy.validateToast("success"); | ||
|
||
// Correct fields are displayed | ||
cy.dataCy("provider-settings").within(() => { | ||
cy.get("button").should("have.length", 1); | ||
cy.get("textarea").should("have.length", 1); | ||
cy.get("input[type=checkbox]").should("have.length", 1); | ||
cy.get("input[type=text]").should("have.length", 0); | ||
// Revert fields to original values. | ||
cy.getInputByLabel("User Data").clear(); | ||
cy.getInputByLabel("Merge with existing user data").uncheck({ | ||
force: true, | ||
}); | ||
cy.dataCy("delete-item-button").click(); | ||
save(); | ||
cy.validateToast("success"); | ||
}); | ||
}); | ||
|
||
cy.getInputByLabel("User Data").type("my user data"); | ||
cy.getInputByLabel("Merge with existing user data").check({ | ||
force: true, | ||
describe("docker", () => { | ||
beforeEach(() => { | ||
cy.visit("/distro/ubuntu1604-container-test/settings/provider"); | ||
}); | ||
cy.contains("button", "Add security group").click(); | ||
cy.getInputByLabel("Security Group ID").type("group-1234"); | ||
|
||
save(); | ||
cy.validateToast("success"); | ||
it("successfully updates docker provider fields", () => { | ||
cy.dataCy("provider-select").contains("Docker"); | ||
|
||
cy.getInputByLabel("User Data").clear(); | ||
cy.getInputByLabel("Merge with existing user data").uncheck({ | ||
force: true, | ||
}); | ||
cy.dataCy("delete-item-button").click(); | ||
// Correct section is displayed. | ||
cy.dataCy("docker-provider-settings").should("exist"); | ||
|
||
save(); | ||
cy.validateToast("success"); | ||
// Change field values. | ||
cy.selectLGOption("Image Build Method", "Pull"); | ||
cy.selectLGOption("Container Pool ID", "test-pool-2"); | ||
cy.getInputByLabel("Username for Registries").type("username"); | ||
cy.getInputByLabel("Password for Registries").type("password"); | ||
cy.getInputByLabel("User Data").type("my user data"); | ||
cy.getInputByLabel("Merge with existing user data").check({ | ||
force: true, | ||
}); | ||
save(); | ||
cy.validateToast("success"); | ||
|
||
// Revert fields to original values. | ||
cy.selectLGOption("Image Build Method", "Import"); | ||
cy.selectLGOption("Container Pool ID", "test-pool-1"); | ||
cy.getInputByLabel("Username for Registries").clear(); | ||
cy.getInputByLabel("Password for Registries").clear(); | ||
cy.getInputByLabel("User Data").clear(); | ||
cy.getInputByLabel("Merge with existing user data").uncheck({ | ||
force: true, | ||
}); | ||
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] No need to rename this var (even though I think we have been doing it unnecessarily in every tab 😂)