@@ -27,7 +27,7 @@ const cfg = {
27
27
28
28
let dict : StyleDictionary | undefined ;
29
29
30
- describe ( 'typography references' , ( ) => {
30
+ describe ( 'color modifier references' , ( ) => {
31
31
beforeEach ( async ( ) => {
32
32
if ( dict ) {
33
33
cleanup ( dict ) ;
@@ -50,8 +50,46 @@ describe('typography references', () => {
50
50
51
51
it ( 'supports color modifier that is a reference itself, containing another reference' , async ( ) => {
52
52
const file = await promises . readFile ( outputFilePath , 'utf-8' ) ;
53
- const content = excerpt ( file , { start : '--sdModifier: [object Object];' , end : '}' } ) ;
53
+ const content = excerpt ( file , {
54
+ start : '--sdModifier: [object Object];' ,
55
+ end : '--sdTreshhold' ,
56
+ } ) ;
54
57
const expectedOutput = `--sdColor2: #0000004d;` ;
55
58
expect ( content ) . toBe ( expectedOutput ) ;
56
59
} ) ;
60
+
61
+ it ( 'supports color with hardcoded mix value and hardcoded mix color' , async ( ) => {
62
+ const file = await promises . readFile ( outputFilePath , 'utf-8' ) ;
63
+ const content = excerpt ( file , { start : new RegExp ( '--sdMixColor: .*;' ) , end : '--sdColor4' } ) ;
64
+ const expectedOutput = `--sdColor3: #a1bbee;` ;
65
+ expect ( content ) . toBe ( expectedOutput ) ;
66
+ } ) ;
67
+
68
+ it ( 'supports color with hardcoded mix value and hardcoded mix color using an expression' , async ( ) => {
69
+ const file = await promises . readFile ( outputFilePath , 'utf-8' ) ;
70
+ const content = excerpt ( file , { start : new RegExp ( '--sdColor3: .*;' ) , end : '--sdColor5' } ) ;
71
+ const expectedOutput = `--sdColor4: #759ae6;` ;
72
+ expect ( content ) . toBe ( expectedOutput ) ;
73
+ } ) ;
74
+
75
+ it ( 'supports color with hardcoded mix value and referenced mix color' , async ( ) => {
76
+ const file = await promises . readFile ( outputFilePath , 'utf-8' ) ;
77
+ const content = excerpt ( file , { start : new RegExp ( '--sdColor4: .*;' ) , end : '--sdColor6' } ) ;
78
+ const expectedOutput = `--sdColor5: #759ae6;` ;
79
+ expect ( content ) . toBe ( expectedOutput ) ;
80
+ } ) ;
81
+
82
+ it ( 'supports color with referenced base color and referenced mix color' , async ( ) => {
83
+ const file = await promises . readFile ( outputFilePath , 'utf-8' ) ;
84
+ const content = excerpt ( file , { start : new RegExp ( '--sdColor5: .*;' ) , end : '--sdColor7' } ) ;
85
+ const expectedOutput = `--sdColor6: #3b64b3;` ;
86
+ expect ( content ) . toBe ( expectedOutput ) ;
87
+ } ) ;
88
+
89
+ it ( 'supports color with referenced base color, referenced mix color, and expression-based mix value' , async ( ) => {
90
+ const file = await promises . readFile ( outputFilePath , 'utf-8' ) ;
91
+ const content = excerpt ( file , { start : new RegExp ( '--sdColor6: .*;' ) , end : '}' } ) ;
92
+ const expectedOutput = `--sdColor7: #3b64b3;` ;
93
+ expect ( content ) . toBe ( expectedOutput ) ;
94
+ } ) ;
57
95
} ) ;
0 commit comments