Skip to content

Commit 70e80c0

Browse files
committed
Do less things
1 parent f3ebd3f commit 70e80c0

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

site/src/pages/CreateTemplatePage/CreateTemplatePage.test.tsx

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import {
77
MockTemplateVersionVariable1,
88
MockTemplateVersionVariable2,
99
MockTemplateVersionVariable3,
10-
MockTemplateVersionVariable4,
11-
MockTemplateVersionVariable5,
1210
renderWithAuth,
1311
} from "testHelpers/renderHelpers"
1412
import CreateTemplatePage from "./CreateTemplatePage"
@@ -55,8 +53,6 @@ test("Create template with variables", async () => {
5553
MockTemplateVersionVariable1,
5654
MockTemplateVersionVariable2,
5755
MockTemplateVersionVariable3,
58-
MockTemplateVersionVariable4,
59-
MockTemplateVersionVariable5,
6056
])
6157

6258
// Render page, fill the name and submit
@@ -69,6 +65,7 @@ test("Create template with variables", async () => {
6965

7066
// Wait for the variables form to be rendered and fill it
7167
await screen.findByText(/Variables/)
68+
7269
// Type first variable
7370
await userEvent.clear(screen.getByLabelText(/var.first_variable/))
7471
await userEvent.type(
@@ -80,18 +77,6 @@ test("Create template with variables", async () => {
8077
await userEvent.type(screen.getByLabelText(/var.second_variable/), "2")
8178
// Select third variable on radio
8279
await userEvent.click(screen.getByLabelText(/True/))
83-
// Type fourth variable
84-
await userEvent.clear(screen.getByLabelText(/var.fourth_variable/))
85-
await userEvent.type(
86-
screen.getByLabelText(/var.fourth_variable/),
87-
"Fourth value",
88-
)
89-
// Type fifth variable
90-
await userEvent.clear(screen.getByLabelText(/var.fifth_variable/))
91-
await userEvent.type(
92-
screen.getByLabelText(/var.fifth_variable/),
93-
"Fifth value",
94-
)
9580
// Setup the mock for the second template version creation before submit the form
9681
jest.clearAllMocks()
9782
jest
@@ -101,7 +86,6 @@ test("Create template with variables", async () => {
10186
await userEvent.click(
10287
within(form).getByRole("button", { name: /create template/i }),
10388
)
104-
10589
await waitFor(() => expect(API.createTemplate).toBeCalledTimes(1))
10690
expect(router.state.location.pathname).toEqual(
10791
`/templates/${MockTemplate.name}`,
@@ -116,8 +100,6 @@ test("Create template with variables", async () => {
116100
{ name: "first_variable", value: "First value" },
117101
{ name: "second_variable", value: "2" },
118102
{ name: "third_variable", value: "true" },
119-
{ name: "fourth_variable", value: "Fourth value" },
120-
{ name: "fifth_variable", value: "Fifth value" },
121103
],
122104
})
123105
})

0 commit comments

Comments
 (0)