Skip to content

Commit 5c49c60

Browse files
committed
update tests
1 parent 9546150 commit 5c49c60

File tree

3 files changed

+35
-15
lines changed

3 files changed

+35
-15
lines changed

__tests__/dark-mode.test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ test('only dark variables with default options and `class` mode', async () => {
2323
},
2424
},
2525

26-
plugins: [tailwindcssVariables()],
26+
plugins: [tailwindcssVariables],
2727
})
2828
).toMatchInlineSnapshot(`
2929
"
@@ -61,7 +61,7 @@ test('only dark variables with default options and `media` mode', async () => {
6161
},
6262
},
6363

64-
plugins: [tailwindcssVariables()],
64+
plugins: [tailwindcssVariables],
6565
})
6666
).toMatchInlineSnapshot(`
6767
"
@@ -190,7 +190,7 @@ test('only dark variables with custom options and `class` mode', async () => {
190190

191191
plugins: [
192192
tailwindcssVariables({
193-
variablePrefix: '.my-prefix',
193+
variablePrefix: 'my-prefix',
194194
darkSelector: '.custom-dark-selector',
195195
darkToRoot: true,
196196
}),
@@ -234,7 +234,7 @@ test('only dark variables with variablePrefix and `media` mode', async () => {
234234

235235
plugins: [
236236
tailwindcssVariables({
237-
variablePrefix: '.my-prefix',
237+
variablePrefix: 'my-prefix',
238238
}),
239239
],
240240
})
@@ -290,7 +290,7 @@ test('variables and dark variables with default options and `class` mode', async
290290
},
291291
},
292292

293-
plugins: [tailwindcssVariables()],
293+
plugins: [tailwindcssVariables],
294294
})
295295
).toMatchInlineSnapshot(`
296296
"
@@ -348,7 +348,7 @@ test('variables and dark variables with default options and `media` mode', async
348348
},
349349
},
350350

351-
plugins: [tailwindcssVariables()],
351+
plugins: [tailwindcssVariables],
352352
})
353353
).toMatchInlineSnapshot(`
354354
"
@@ -534,7 +534,7 @@ test('variables and dark variables with custom options and `class` mode', async
534534

535535
plugins: [
536536
tailwindcssVariables({
537-
variablePrefix: '.my-prefix',
537+
variablePrefix: 'my-prefix',
538538
darkSelector: '.custom-dark-selector',
539539
darkToRoot: true,
540540
}),

__tests__/format-variables.test.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,23 @@ test('format variables [special characters must be removed from variable names]'
1111
variables: {
1212
DEFAULT: {
1313
colors: {
14-
"hello[$&+,:;=?@#|'<>.-^*()%!]world": '100%',
14+
"hello[$&+,:;=?@#|'<>.-^*()%!]WORLD": '100%',
1515
underscore_to_dash: '100%',
1616
'underscore_to_dash-with-dash': '100%',
1717
auto_dash: '100%',
1818
},
19+
20+
sizes: {
21+
1.5: '1rem',
22+
'foo2.0bar3.0': '2rem',
23+
baz: {
24+
'foo3.0bar4.0': '3rem',
25+
},
26+
},
1927
},
2028

2129
"[type='button']": {
22-
"hello[$&+,:;=?@#|'<>.-^*()%!]world": '100%',
30+
"hello[$&+,:;=?@#|'<>-^*()%!]world": '100%',
2331
underscore_to_dash: '100%',
2432
'underscore_to_dash-with-dash': '100%',
2533
auto_dash: '100%',
@@ -37,10 +45,13 @@ test('format variables [special characters must be removed from variable names]'
3745
3846
3947
+ :root {
40-
+ --colors-hello-world: 100%;
48+
+ --colors-hello\\\\.-WORLD: 100%;
4149
+ --colors-underscore-to-dash: 100%;
4250
+ --colors-underscore-to-dash-with-dash: 100%;
43-
+ --colors-auto-dash: 100%
51+
+ --colors-auto-dash: 100%;
52+
+ --sizes-1\\\\.5: 1rem;
53+
+ --sizes-foo2\\\\.0bar3\\\\.0: 2rem;
54+
+ --sizes-baz-foo3\\\\.0bar4\\\\.0: 3rem
4455
+ }
4556
+ [type='button'] {
4657
+ --hello-world: 100%;

__tests__/readme.test.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -376,15 +376,22 @@ test('naming conventions for variable keys', async () => {
376376
variables: {
377377
DEFAULT: {
378378
colors: {
379-
"hello[$&+,:;=?@#|'<>.-^*()%!]world": '100%',
379+
"hello[$&+,:;=?@#|'<>-^*()%!]WORLD": '100%',
380380
underscore_to_dash: '100%',
381381
'underscore_to_dash-with-dash': '100%',
382382
auto_dash: '100%',
383383
},
384+
385+
sizes: {
386+
1.5: '1rem',
387+
xl: {
388+
'3.0': '2rem',
389+
},
390+
},
384391
},
385392

386393
"[type='button']": {
387-
"hello[$&+,:;=?@#|'<>.-^*()%!]world": '100%',
394+
"hello[$&+,:;=?@#|'<>-^*()%!]world": '100%',
388395
underscore_to_dash: '100%',
389396
'underscore_to_dash-with-dash': '100%',
390397
auto_dash: '100%',
@@ -402,10 +409,12 @@ test('naming conventions for variable keys', async () => {
402409
403410
404411
+ :root {
405-
+ --colors-hello-world: 100%;
412+
+ --colors-hello-WORLD: 100%;
406413
+ --colors-underscore-to-dash: 100%;
407414
+ --colors-underscore-to-dash-with-dash: 100%;
408-
+ --colors-auto-dash: 100%
415+
+ --colors-auto-dash: 100%;
416+
+ --sizes-1\\\\.5: 1rem;
417+
+ --sizes-xl-3\\\\.0: 2rem
409418
+ }
410419
+ [type='button'] {
411420
+ --hello-world: 100%;

0 commit comments

Comments
 (0)