8000 fix(site): Only patch version name if name is changed by BrunoQuaresma · Pull Request #6878 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

fix(site): Only patch version name if name is changed #6878

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 2 commits into from
Mar 30, 2023
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
Fix test
  • Loading branch information
BrunoQuaresma committed Mar 30, 2023
commit abab525659f50a303f0107d5f6e7e4bbd9afee1a
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ test("Do not mark as active if promote is not checked", async () => {
expect(updateActiveTemplateVersion).toBeCalledTimes(0)
})

test("The default version name is used when a new one is not used", async () => {
test("Patch request is not send when the name is not updated", async () => {
const user = userEvent.setup()
renderWithAuth(<TemplateVersionEditorPage />, {
extraRoutes: [
Expand Down Expand Up @@ -172,12 +172,12 @@ test("The default version name is used when a new one is not used", async () =>
})
await user.click(publishButton)
const publishDialog = await screen.findByTestId("dialog")
// It is using the name from the template version
const nameField = within(publishDialog).getByLabelText("Version name")
expect(nameField).toHaveValue(MockTemplateVersion.name)
// Publish
await user.click(
within(publishDialog).getByRole("button", { name: "Publish" }),
)
await waitFor(() => {
expect(patchTemplateVersion).toBeCalledWith("new-version-id", {
name: MockTemplateVersion.name,
})
})
expect(patchTemplateVersion).toBeCalledTimes(0)
})
0