-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A single ftux integration test (#84)
* chore(ftux): full integration test * chore: update node for tests Addresses: nodejs/undici#1910
- Loading branch information
Showing
35 changed files
with
1,818 additions
and
76 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
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 |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import { act, fireEvent, render, screen } from "@testing-library/react"; | ||
import userEvent from "@testing-library/user-event"; | ||
|
||
import { setupAppIntegrationTest } from "@app/test"; | ||
|
||
describe("Create project flow", () => { | ||
describe("existing user with ssh keys", () => { | ||
it("should successfully provision resources within an environment", async () => { | ||
const { App } = setupAppIntegrationTest({ | ||
initEntries: ["/create"], | ||
}); | ||
render(<App />); | ||
|
||
// deploy code landing page | ||
const el = await screen.findByRole("button"); | ||
expect(el.textContent).toEqual("Deploy your code"); | ||
// go to next page | ||
fireEvent.click(el); | ||
|
||
// create environment page | ||
const nameInput = await screen.findByRole("textbox", { name: "name" }); | ||
await act(async () => { | ||
await userEvent.type(nameInput, "test-project"); | ||
}); | ||
|
||
const btn = await screen.findByRole("button", { | ||
name: /Create Environment/, | ||
}); | ||
// go to next page | ||
fireEvent.click(btn); | ||
|
||
// push your code page | ||
await screen.findByText(/Push your code to continue/); | ||
|
||
// settings page | ||
await screen.findByText(/Review your Settings/); | ||
|
||
const banner = await screen.findByRole("status"); | ||
expect(banner.textContent).toMatch(/Your code has a Dockerfile/); | ||
|
||
const dbBtn = await screen.findByRole("button", { | ||
name: /New Database/, | ||
}); | ||
fireEvent.click(dbBtn); | ||
|
||
const dbSelector = await screen.findByRole("combobox"); | ||
userEvent.selectOptions(dbSelector, "postgres:14"); | ||
const dbEnvVar = await screen.findByRole("textbox", { name: "envvar" }); | ||
expect(dbEnvVar).toHaveDisplayValue("DATABASE_URL"); | ||
|
||
const saveBtn = await screen.findByRole("button", { | ||
name: /Save & Deploy/, | ||
}); | ||
|
||
// go to next page | ||
fireEvent.click(saveBtn); | ||
|
||
// status page | ||
await screen.findByRole("button", { | ||
name: "View Environment", | ||
}); | ||
const status = await screen.findByText(/Deployed today/); | ||
expect(status).toBeInTheDocument(); | ||
|
||
await screen.findByText("Initial configuration"); | ||
await screen.findByText("App deployment"); | ||
await screen.findByText("Database provision test-app-1-postgres"); | ||
let ops = await screen.findAllByText("DONE"); | ||
expect(ops.length).toEqual(3); | ||
|
||
// create https endpoint | ||
await screen.findByText("Which service needs an endpoint?"); | ||
|
||
const vhostSelector = await screen.findAllByRole("radio"); | ||
fireEvent.click(vhostSelector[0]); | ||
const httpBtn = await screen.findByText("Create endpoint"); | ||
fireEvent.click(httpBtn); | ||
|
||
await screen.findByText("HTTPS endpoint provision"); | ||
ops = await screen.findAllByText("DONE"); | ||
expect(ops.length).toEqual(4); | ||
}); | ||
}); | ||
}); |
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.