Skip to content

feat(site): support match option for auto create workspace flow #13836

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add test to check if invalid match erros are displayed
  • Loading branch information
BrunoQuaresma committed Jul 8, 2024
commit d9cb7ba2a29cda0f9f46d73cd11f2e024a05b6eb
18 changes: 18 additions & 0 deletions site/e2e/tests/workspaces/autoCreateWorkspace.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,21 @@ test("use an existing workspace that matches the `match` parameter instead of cr
);
await expect(page).toHaveTitle(`${username}/${prevWorkspace} - Coder`);
});

test("show error if `match` parameter is invalid", async ({ page }) => {
const richParameters: RichParameter[] = [
{ ...emptyParameter, name: "repo", type: "string" },
];
const template = await createTemplate(
page,
echoResponsesWithParameters(richParameters),
);
const prevWorkspace = await createWorkspace(page, template);
await page.goto(
`/templates/${template}/workspace?mode=auto&param.repo=example&name=new-name&match=not-valid-query:${prevWorkspace}`,
{
waitUntil: "domcontentloaded",
},
);
await expect(page.getByText("Invalid match value")).toBeVisible();
});
Loading