@@ -60,7 +60,7 @@ test("Should bypass generator prompt", async () => {
60
60
expect ( await findByText ( "What is your name?" ) ) . toBeInTheConsole ( ) ;
61
61
} ) ;
62
62
63
- test ( "Should bypass prompt by input" , async ( ) => {
63
+ test ( "Should bypass input prompt with input" , async ( ) => {
64
64
const { queryByText, findByText } = await renderPlop ( [ "Frank" ] , {
65
65
cwd : resolve ( __dirname , "./examples/prompt-only" ) ,
66
66
} ) ;
@@ -71,7 +71,7 @@ test("Should bypass prompt by input", async () => {
71
71
) . toBeInTheConsole ( ) ;
72
72
} ) ;
73
73
74
- test ( "Should bypass prompt by input placeholder" , async ( ) => {
74
+ test ( "Should bypass input prompt with placeholder" , async ( ) => {
75
75
const { queryByText, findByText, userEvent } = await renderPlop (
76
76
[ "_" , "Cheese" ] ,
77
77
{
@@ -86,7 +86,7 @@ test("Should bypass prompt by input placeholder", async () => {
86
86
) . not . toBeInTheConsole ( ) ;
87
87
} ) ;
88
88
89
- test ( "Should bypass prompt by name" , async ( ) => {
89
+ test ( "Should bypass input prompt with name" , async ( ) => {
90
90
const { queryByText, findByText } = await renderPlop (
91
91
[ "--" , "--name" , "Frank" ] ,
92
92
{
@@ -100,7 +100,7 @@ test("Should bypass prompt by name", async () => {
100
100
) . toBeInTheConsole ( ) ;
101
101
} ) ;
102
102
103
- test ( "Should allow for empty string bypassing " , async ( ) => {
103
+ test ( "Should bypass input prompt with empty string" , async ( ) => {
104
104
const { queryByText, findByText } = await renderPlop ( [ "--" , "--name" , `""` ] , {
105
105
cwd : resolve ( __dirname , "./examples/prompt-only" ) ,
106
106
} ) ;
@@ -111,4 +111,56 @@ test("Should allow for empty string bypassing", async () => {
111
111
) . toBeInTheConsole ( ) ;
112
112
} ) ;
113
113
114
+ test ( "Should bypass checkbox prompt with input" , async ( ) => {
115
+ const { queryByText } = await renderPlop ( [ "Frank" , "Cheese" ] , {
116
+ cwd : resolve ( __dirname , "./examples/prompt-only" ) ,
117
+ } ) ;
118
+
119
+ expect ( await queryByText ( "What is your name?" ) ) . not . toBeInTheConsole ( ) ;
120
+ expect (
121
+ await queryByText ( "What pizza toppings do you like?" )
122
+ ) . not . toBeInTheConsole ( ) ;
123
+ } ) ;
124
+
125
+ test ( "Should bypass checkbox prompt with placeholder" , async ( ) => {
126
+ const { queryByText, findByText } = await renderPlop ( [ "Frank" , "_" ] , {
127
+ cwd : resolve ( __dirname , "./examples/prompt-only" ) ,
128
+ } ) ;
129
+
130
+ expect ( await queryByText ( "What is your name?" ) ) . not . toBeInTheConsole ( ) ;
131
+ expect (
132
+ await findByText ( "What pizza toppings do you like?" )
133
+ ) . toBeInTheConsole ( ) ;
134
+ } ) ;
135
+
136
+ test ( "Should bypass checkbox prompt with name" , async ( ) => {
137
+ const { queryByText, findByText, userEvent } = await renderPlop (
138
+ [ "--" , "--toppings" , "Cheese" ] ,
139
+ {
140
+ cwd : resolve ( __dirname , "./examples/prompt-only" ) ,
141
+ }
142
+ ) ;
143
+
144
+ expect ( await findByText ( "What is your name?" ) ) . toBeInTheConsole ( ) ;
145
+ userEvent . keyboard ( "[Enter]" ) ;
146
+ expect (
147
+ await queryByText ( "What pizza toppings do you like?" )
148
+ ) . not . toBeInTheConsole ( ) ;
149
+ } ) ;
150
+
151
+ test ( "Should bypass checkbox prompt with empty string" , async ( ) => {
152
+ const { queryByText, findByText, userEvent } = await renderPlop (
153
+ [ "--" , "--toppings" , `""` ] ,
154
+ {
155
+ cwd : resolve ( __dirname , "./examples/prompt-only" ) ,
156
+ }
157
+ ) ;
158
+
159
+ expect ( await findByText ( "What is your name?" ) ) . toBeInTheConsole ( ) ;
160
+ userEvent . keyboard ( "[Enter]" ) ;
161
+ expect (
162
+ await queryByText ( "What pizza toppings do you like?" )
163
+ ) . not . toBeInTheConsole ( ) ;
164
+ } ) ;
165
+
114
166
test . todo ( "Dynamic actions" ) ;
0 commit comments