|
| 1 | +import { basic } from './recipes.css'; |
| 2 | + |
| 3 | +describe('recipes', () => { |
| 4 | + it('should return default variants for no options', () => { |
| 5 | + expect(basic()).toMatchInlineSnapshot( |
| 6 | + `"recipes_basic__niwegb0 recipes_basic_spaceWithDefault_small__niwegb1"`, |
| 7 | + ); |
| 8 | + }); |
| 9 | + |
| 10 | + it('should return default variants for empty options', () => { |
| 11 | + expect(basic({})).toMatchInlineSnapshot( |
| 12 | + `"recipes_basic__niwegb0 recipes_basic_spaceWithDefault_small__niwegb1"`, |
| 13 | + ); |
| 14 | + }); |
| 15 | + |
| 16 | + it('should return default variants for undefined options', () => { |
| 17 | + expect(basic({ spaceWithDefault: undefined })).toMatchInlineSnapshot( |
| 18 | + `"recipes_basic__niwegb0 recipes_basic_spaceWithDefault_small__niwegb1"`, |
| 19 | + ); |
| 20 | + }); |
| 21 | + |
| 22 | + it('should return requested variants', () => { |
| 23 | + expect( |
| 24 | + basic({ |
| 25 | + spaceWithDefault: 'large', |
| 26 | + spaceWithoutDefault: 'small', |
| 27 | + color: 'blue', |
| 28 | + }), |
| 29 | + ).toMatchInlineSnapshot( |
| 30 | + `"recipes_basic__niwegb0 recipes_basic_spaceWithDefault_large__niwegb2 recipes_basic_spaceWithoutDefault_small__niwegb3 recipes_basic_color_blue__niwegb6"`, |
| 31 | + ); |
| 32 | + }); |
| 33 | + |
| 34 | + it('should return requested compound variants', () => { |
| 35 | + expect( |
| 36 | + basic({ spaceWithDefault: 'small', color: 'red' }), |
| 37 | + ).toMatchInlineSnapshot( |
| 38 | + `"recipes_basic__niwegb0 recipes_basic_spaceWithDefault_small__niwegb1 recipes_basic_color_red__niwegb5 recipes_basic_compound_0__niwegb7"`, |
| 39 | + ); |
| 40 | + }); |
| 41 | + |
| 42 | + it('should return compound variants via defaultVariants', () => { |
| 43 | + expect(basic({ color: 'red' })).toMatchInlineSnapshot( |
| 44 | + `"recipes_basic__niwegb0 recipes_basic_spaceWithDefault_small__niwegb1 recipes_basic_color_red__niwegb5 recipes_basic_compound_0__niwegb7"`, |
| 45 | + ); |
| 46 | + }); |
| 47 | +}); |
0 commit comments