7
7
MockTemplateVersionVariable1 ,
8
8
MockTemplateVersionVariable2 ,
9
9
MockTemplateVersionVariable3 ,
10
- MockTemplateVersionVariable4 ,
11
- MockTemplateVersionVariable5 ,
12
10
renderWithAuth ,
13
11
} from "testHelpers/renderHelpers"
14
12
import CreateTemplatePage from "./CreateTemplatePage"
@@ -55,8 +53,6 @@ test("Create template with variables", async () => {
55
53
MockTemplateVersionVariable1 ,
56
54
MockTemplateVersionVariable2 ,
57
55
MockTemplateVersionVariable3 ,
58
- MockTemplateVersionVariable4 ,
59
- MockTemplateVersionVariable5 ,
60
56
] )
61
57
62
58
// Render page, fill the name and submit
@@ -69,6 +65,7 @@ test("Create template with variables", async () => {
69
65
70
66
// Wait for the variables form to be rendered and fill it
71
67
await screen . findByText ( / V a r i a b l e s / )
68
+
72
69
// Type first variable
73
70
await userEvent . clear ( screen . getByLabelText ( / v a r .f i r s t _ v a r i a b l e / ) )
74
71
await userEvent . type (
@@ -80,18 +77,6 @@ test("Create template with variables", async () => {
80
77
await userEvent . type ( screen . getByLabelText ( / v a r .s e c o n d _ v a r i a b l e / ) , "2" )
81
78
// Select third variable on radio
82
79
await userEvent . click ( screen . getByLabelText ( / T r u e / ) )
83
- // Type fourth variable
84
- await userEvent . clear ( screen . getByLabelText ( / v a r .f o u r t h _ v a r i a b l e / ) )
85
- await userEvent . type (
86
- screen . getByLabelText ( / v a r .f o u r t h _ v a r i a b l e / ) ,
87
- "Fourth value" ,
88
- )
89
- // Type fifth variable
90
- await userEvent . clear ( screen . getByLabelText ( / v a r .f i f t h _ v a r i a b l e / ) )
91
- await userEvent . type (
92
- screen . getByLabelText ( / v a r .f i f t h _ v a r i a b l e / ) ,
93
- "Fifth value" ,
94
- )
95
80
// Setup the mock for the second template version creation before submit the form
96
81
jest . clearAllMocks ( )
97
82
jest
@@ -101,7 +86,6 @@ test("Create template with variables", async () => {
101
86
await userEvent . click (
102
87
within ( form ) . getByRole ( "button" , { name : / c r e a t e t e m p l a t e / i } ) ,
103
88
)
104
-
105
89
await waitFor ( ( ) => expect ( API . createTemplate ) . toBeCalledTimes ( 1 ) )
106
90
expect ( router . state . location . pathname ) . toEqual (
107
91
`/templates/${ MockTemplate . name } ` ,
@@ -116,8 +100,6 @@ test("Create template with variables", async () => {
116
100
{ name : "first_variable" , value : "First value" } ,
117
101
{ name : "second_variable" , value : "2" } ,
118
102
{ name : "third_variable" , value : "true" } ,
119
- { name : "fourth_variable" , value : "Fourth value" } ,
120
- { name : "fifth_variable" , value : "Fifth value" } ,
121
103
] ,
122
104
} )
123
105
} )
0 commit comments