@@ -32,13 +32,22 @@ expect.extend({
3232 toMatchCss : cssMatcher ,
3333} ) ;
3434
35- test ( 'there is no output by default' , ( ) => {
35+ test ( 'only one utility is generated by default' , ( ) => {
3636 return generatePluginCss ( ) . then ( css => {
37- expect ( css ) . toMatchCss ( `` ) ;
37+ expect ( css ) . toMatchCss ( `
38+ .bg-none {
39+ background-image: none;
40+ }
41+ @media (min-width: 640px) {
42+ .sm\\:bg-none {
43+ background-image: none;
44+ }
45+ }
46+ ` ) ;
3847 } ) ;
3948} ) ;
4049
41- test ( 'there is no output without directions or positions' , ( ) => {
50+ test ( 'no gradient is generated without directions or positions' , ( ) => {
4251 return generatePluginCss ( {
4352 theme : {
4453 linearGradients : {
@@ -59,11 +68,20 @@ test('there is no output without directions or positions', () => {
5968 } ,
6069 } ,
6170 } ) . then ( css => {
62- expect ( css ) . toMatchCss ( `` ) ;
71+ expect ( css ) . toMatchCss ( `
72+ .bg-none {
73+ background-image: none;
74+ }
75+ @media (min-width: 640px) {
76+ .sm\\:bg-none {
77+ background-image: none;
78+ }
79+ }
80+ ` ) ;
6381 } ) ;
6482} ) ;
6583
66- test ( 'there is no output without colors' , ( ) => {
84+ test ( 'no gradient is generated without colors' , ( ) => {
6785 return generatePluginCss ( {
6886 theme : {
6987 linearGradients : {
@@ -87,7 +105,16 @@ test('there is no output without colors', () => {
87105 } ,
88106 } ,
89107 } ) . then ( css => {
90- expect ( css ) . toMatchCss ( `` ) ;
108+ expect ( css ) . toMatchCss ( `
109+ .bg-none {
110+ background-image: none;
111+ }
112+ @media (min-width: 640px) {
113+ .sm\\:bg-none {
114+ background-image: none;
115+ }
116+ }
117+ ` ) ;
91118 } ) ;
92119} ) ;
93120
@@ -101,10 +128,14 @@ test('linear gradients have default directions', () => {
101128 } ,
102129 } ,
103130 variants : {
131+ backgroundImage : [ ] ,
104132 linearGradients : [ ] ,
105133 } ,
106134 } ) . then ( css => {
107135 expect ( css ) . toMatchCss ( `
136+ .bg-none {
137+ background-image: none;
138+ }
108139 .bg-gradient-t-red {
109140 background-image: linear-gradient(to top, rgba(255, 0, 0, 0), #f00);
110141 }
@@ -143,11 +174,15 @@ test('radial gradients have default shapes, sizes, and positions', () => {
143174 } ,
144175 } ,
145176 variants : {
177+ backgroundImage : [ ] ,
146178 linearGradients : [ ] ,
147179 radialGradients : [ ] ,
148180 } ,
149181 } ) . then ( css => {
150182 expect ( css ) . toMatchCss ( `
183+ .bg-none {
184+ background-image: none;
185+ }
151186 .bg-radial-red {
152187 background-image: radial-gradient(closest-side, #f00, rgba(255, 0, 0, 0));
153188 }
@@ -202,11 +237,15 @@ test('directions and positions can be customized', () => {
202237 } ,
203238 } ,
204239 variants : {
240+ backgroundImage : [ ] ,
205241 linearGradients : [ ] ,
206242 radialGradients : [ ] ,
207243 } ,
208244 } ) . then ( css => {
209245 expect ( css ) . toMatchCss ( `
246+ .bg-none {
247+ background-image: none;
248+ }
210249 .bg-gradient-to-top-red {
211250 background-image: linear-gradient(to top, rgba(255, 0, 0, 0), #f00);
212251 }
@@ -246,11 +285,15 @@ test('gradients can have multiple colors', () => {
246285 } ,
247286 } ,
248287 variants : {
288+ backgroundImage : [ ] ,
249289 linearGradients : [ ] ,
250290 radialGradients : [ ] ,
251291 } ,
252292 } ) . then ( css => {
253293 expect ( css ) . toMatchCss ( `
294+ .bg-none {
295+ background-image: none;
296+ }
254297 .bg-gradient-to-bottom-red-green {
255298 background-image: linear-gradient(#f00, #0f0);
256299 }
@@ -292,11 +335,15 @@ test('multiple directions/positions and multiple colors can be used together', (
292335 } ,
293336 } ,
294337 variants : {
338+ backgroundImage : [ ] ,
295339 linearGradients : [ ] ,
296340 radialGradients : [ ] ,
297341 } ,
298342 } ) . then ( css => {
299343 expect ( css ) . toMatchCss ( `
344+ .bg-none {
345+ background-image: none;
346+ }
300347 .bg-gradient-to-top-red {
301348 background-image: linear-gradient(to top, rgba(255, 0, 0, 0), #f00);
302349 }
@@ -340,11 +387,15 @@ test('colors can be referenced from the theme with a closure', () => {
340387 } ) ,
341388 } ,
342389 variants : {
390+ backgroundImage : [ ] ,
343391 linearGradients : [ ] ,
344392 radialGradients : [ ] ,
345393 } ,
346394 } ) . then ( css => {
347395 expect ( css ) . toMatchCss ( `
396+ .bg-none {
397+ background-image: none;
398+ }
348399 .bg-gradient-b-red {
349400 background-image: linear-gradient(rgba(255, 0, 0, 0), #f00);
350401 }
@@ -378,11 +429,15 @@ test('color keywords are accepted', () => {
378429 } ) ,
379430 } ,
380431 variants : {
432+ backgroundImage : [ ] ,
381433 linearGradients : [ ] ,
382434 radialGradients : [ ] ,
383435 } ,
384436 } ) . then ( css => {
385437 expect ( css ) . toMatchCss ( `
438+ .bg-none {
439+ background-image: none;
440+ }
386441 .bg-gradient-t-white {
387442 background-image: linear-gradient(to top, rgba(255, 255, 255, 0), white);
388443 }
@@ -435,11 +490,15 @@ test('some keywords such as inherit are skipped', () => {
435490 } ) ,
436491 } ,
437492 variants : {
493+ backgroundImage : [ ] ,
438494 linearGradients : [ ] ,
439495 radialGradients : [ ] ,
440496 } ,
441497 } ) . then ( css => {
442498 expect ( css ) . toMatchCss ( `
499+ .bg-none {
500+ background-image: none;
501+ }
443502 .bg-gradient-t-red {
444503 background-image: linear-gradient(to top, rgba(255, 0, 0, 0), #f00);
445504 }
@@ -474,10 +533,14 @@ test('radial gradient shapes and sizes can be customized', () => {
474533 } ) ,
475534 } ,
476535 variants : {
536+ backgroundImage : [ ] ,
477537 radialGradients : [ ] ,
478538 } ,
479539 } ) . then ( css => {
480540 expect ( css ) . toMatchCss ( `
541+ .bg-none {
542+ background-image: none;
543+ }
481544 .bg-radial-red {
482545 background-image: radial-gradient(circle closest-side, #f00, rgba(255, 0, 0, 0));
483546 }
@@ -548,11 +611,16 @@ test('there is no output for repeating gradients without lengths', () => {
548611 } ) ,
549612 } ,
550613 variants : {
614+ backgroundImage : [ ] ,
551615 repeatingLinearGradients : [ ] ,
552616 repeatingRadialGradients : [ ] ,
553617 } ,
554618 } ) . then ( css => {
555- expect ( css ) . toMatchCss ( `` ) ;
619+ expect ( css ) . toMatchCss ( `
620+ .bg-none {
621+ background-image: none;
622+ }
623+ ` ) ;
556624 } ) ;
557625} ) ;
558626
@@ -587,11 +655,15 @@ test('lengths can be customized', () => {
587655 } ) ,
588656 } ,
589657 variants : {
658+ backgroundImage : [ ] ,
590659 repeatingLinearGradients : [ ] ,
591660 repeatingRadialGradients : [ ] ,
592661 } ,
593662 } ) . then ( css => {
594663 expect ( css ) . toMatchCss ( `
664+ .bg-none {
665+ background-image: none;
666+ }
595667 .bg-gradient-t-red-sm {
596668 background-image: repeating-linear-gradient(to top, rgba(255, 0, 0, 0), #f00 25px);
597669 }
@@ -671,13 +743,17 @@ test('color stops can be customized', () => {
671743 } ) ,
672744 } ,
673745 variants : {
746+ backgroundImage : [ ] ,
674747 linearGradients : [ ] ,
675748 radialGradients : [ ] ,
676749 repeatingLinearGradients : [ ] ,
677750 repeatingRadialGradients : [ ] ,
678751 } ,
679752 } ) . then ( css => {
680753 expect ( css ) . toMatchCss ( `
754+ .bg-none {
755+ background-image: none;
756+ }
681757 .bg-gradient-r-custom {
682758 background-image: linear-gradient(to right, #000, #000 45%, #fff 55%, #fff);
683759 }
@@ -730,6 +806,9 @@ test('responsive variants are generated by default', () => {
730806 } ,
731807 } ) . then ( css => {
732808 expect ( css ) . toMatchCss ( `
809+ .bg-none {
810+ background-image: none;
811+ }
733812 .bg-gradient-t-red {
734813 background-image: linear-gradient(to top, rgba(255, 0, 0, 0), #f00);
735814 }
@@ -743,6 +822,9 @@ test('responsive variants are generated by default', () => {
743822 background-image: repeating-radial-gradient(#f00, rgba(255, 0, 0, 0) 10px);
744823 }
745824 @media (min-width: 640px) {
825+ .sm\\:bg-none {
826+ background-image: none;
827+ }
746828 .sm\\:bg-gradient-t-red {
747829 background-image: linear-gradient(to top, rgba(255, 0, 0, 0), #f00);
748830 }
@@ -795,13 +877,20 @@ test('variants can be customized', () => {
795877 } ) ,
796878 } ,
797879 variants : {
880+ backgroundImage : [ 'focus' ] ,
798881 linearGradients : [ 'hover' , 'active' ] ,
799882 radialGradients : [ 'group-hover' ] ,
800883 repeatingLinearGradients : [ 'active' ] ,
801884 repeatingRadialGradients : [ 'hover' ] ,
802885 } ,
803886 } ) . then ( css => {
804887 expect ( css ) . toMatchCss ( `
888+ .bg-none {
889+ background-image: none;
890+ }
891+ .focus\\:bg-none:focus {
892+ background-image: none;
893+ }
805894 .bg-gradient-t-red {
806895 background-image: linear-gradient(to top, rgba(255, 0, 0, 0), #f00);
807896 }
0 commit comments