@@ -5,90 +5,3 @@ const questions = require('../questions');
5
5
test ( 'questions array can be loaded' , t => {
6
6
t . true ( Array . isArray ( questions ) ) ;
7
7
} ) ;
8
-
9
- test ( 'TailwindCSS question is properly included' , t => {
10
- const tailwindQuestion = questions . find ( q =>
11
- q . message && q . message . includes ( 'TailwindCSS' )
12
- ) ;
13
-
14
- t . truthy ( tailwindQuestion , 'TailwindCSS question should exist' ) ;
15
- t . is ( tailwindQuestion . message , 'Do you want to use TailwindCSS?' ) ;
16
- t . true ( Array . isArray ( tailwindQuestion . choices ) , 'TailwindCSS question should have choices' ) ;
17
- t . is ( tailwindQuestion . choices . length , 2 , 'TailwindCSS question should have 2 choices' ) ;
18
-
19
- // Check "No" option
20
- const noChoice = tailwindQuestion . choices [ 0 ] ;
21
- t . is ( noChoice . title , 'No' ) ;
22
- t . is ( noChoice . value , undefined ) ;
23
-
24
- // Check "Yes" option
25
- const yesChoice = tailwindQuestion . choices [ 1 ] ;
26
- t . is ( yesChoice . value , 'tailwindcss' ) ;
27
- t . is ( yesChoice . title , 'Yes' ) ;
28
- t . truthy ( yesChoice . hint ) ;
29
- t . true ( yesChoice . hint . includes ( 'utility-first' ) ) ;
30
- } ) ;
31
-
32
- test ( 'TailwindCSS question comes after CSS preprocessor question' , t => {
33
- const cssQuestionIndex = questions . findIndex ( q =>
34
- q . message && q . message . includes ( 'CSS preprocessor' )
35
- ) ;
36
- const tailwindQuestionIndex = questions . findIndex ( q =>
37
- q . message && q . message . includes ( 'TailwindCSS' )
38
- ) ;
39
-
40
- t . true ( cssQuestionIndex >= 0 , 'CSS preprocessor question should exist' ) ;
41
- t . true ( tailwindQuestionIndex >= 0 , 'TailwindCSS question should exist' ) ;
42
- t . true ( tailwindQuestionIndex > cssQuestionIndex , 'TailwindCSS question should come after CSS preprocessor question' ) ;
43
- } ) ;
44
-
45
- test ( 'TailwindCSS question comes before unit testing question' , t => {
46
- const tailwindQuestionIndex = questions . findIndex ( q =>
47
- q . message && q . message . includes ( 'TailwindCSS' )
48
- ) ;
49
- const testingQuestionIndex = questions . findIndex ( q =>
50
- q . message && q . message . includes ( 'unit testing' )
51
- ) ;
52
-
53
- t . true ( tailwindQuestionIndex >= 0 , 'TailwindCSS question should exist' ) ;
54
- t . true ( testingQuestionIndex >= 0 , 'Unit testing question should exist' ) ;
55
- t . true ( tailwindQuestionIndex < testingQuestionIndex , 'TailwindCSS question should come before unit testing question' ) ;
56
- } ) ;
57
-
58
- test ( 'Storybook question is properly included' , t => {
59
- const storybookQuestion = questions . find ( q =>
60
- q . message && q . message . includes ( 'Storybook' )
61
- ) ;
62
-
63
- t . truthy ( storybookQuestion , 'Storybook question should exist' ) ;
64
- t . is ( storybookQuestion . message , 'Do you want to add Storybook?' ) ;
65
- t . true ( Array . isArray ( storybookQuestion . choices ) , 'Storybook question should have choices' ) ;
66
- t . is ( storybookQuestion . choices . length , 2 , 'Storybook question should have 2 choices' ) ;
67
-
68
- // Check "No" option
69
- const noChoice = storybookQuestion . choices [ 0 ] ;
70
- t . is ( noChoice . title , 'No' ) ;
71
- t . is ( noChoice . value , undefined ) ;
72
-
73
- // Check "Yes" option
74
- const yesChoice = storybookQuestion . choices [ 1 ] ;
75
- t . is ( yesChoice . value , 'storybook' ) ;
76
- t . is ( yesChoice . title , 'Yes' ) ;
77
- t . truthy ( yesChoice . hint ) ;
78
- t . true ( yesChoice . hint . includes ( 'Vite or Webpack' ) ) ;
79
- t . truthy ( yesChoice . if ) ;
80
- t . is ( yesChoice . if , '(app && (vite || webpack)) || (plugin && webpack)' ) ;
81
- } ) ;
82
-
83
- test ( 'Storybook question comes after e2e testing question' , t => {
84
- const e2eQuestionIndex = questions . findIndex ( q =>
85
- q . message && q . message . includes ( 'e2e test' )
86
- ) ;
87
- const storybookQuestionIndex = questions . findIndex ( q =>
88
- q . message && q . message . includes ( 'Storybook' )
89
- ) ;
90
-
91
- t . true ( e2eQuestionIndex >= 0 , 'E2E testing question should exist' ) ;
92
- t . true ( storybookQuestionIndex >= 0 , 'Storybook question should exist' ) ;
93
- t . true ( storybookQuestionIndex > e2eQuestionIndex , 'Storybook question should come after e2e testing question' ) ;
94
- } ) ;
0 commit comments