['property-value', '0'],
['property-value', '0']
]
- ]);
+ ], true);
},
'has one wrap': function (wrapped) {
assert.lengthOf(wrapped, 1);
['property-name', 'color'],
['property-value', 'red']
]
- ]);
+ ], true);
},
'has two wraps': function (wrapped) {
assert.lengthOf(wrapped, 2);
['property-name', 'color'],
['property-value', 'red']
]
- ]);
+ ], true);
},
'has one wrap': function (wrapped) {
assert.lengthOf(wrapped, 1);
['property-value', '/'],
['property-value', '2px']
]
- ]);
+ ], true);
},
'has one wrap': function (wrapped) {
assert.lengthOf(wrapped, 1);
['property-name', '--color'],
['property-value', 'red']
]
- ]);
+ ], true);
},
'has one wrap': function (wrapped) {
assert.lengthOf(wrapped, 1);
assert.isFalse(wrapped[0].block);
}
},
+ 'variable reference': {
+ 'topic': function () {
+ return wrapForOptimizing([
+ [
+ 'property',
+ ['property-name', 'color'],
+ ['property-value', 'var(--red)']
+ ]
+ ], true);
+ },
+ 'has one wrap': function (wrapped) {
+ assert.lengthOf(wrapped, 1);
+ },
+ 'has name': function (wrapped) {
+ assert.deepEqual(wrapped[0].name, 'color');
+ },
+ 'has value': function (wrapped) {
+ assert.deepEqual(wrapped[0].value, [['property-value', 'var(--red)']]);
+ }
+ },
+ 'variable reference when variables are ignored': {
+ 'topic': function () {
+ return wrapForOptimizing([
+ [
+ 'property',
+ ['property-name', 'color'],
+ ['property-value', 'var(--red)']
+ ]
+ ], false);
+ },
+ 'has one wrap': function (wrapped) {
+ assert.lengthOf(wrapped, 0);
+ }
+ },
'variable block': {
'topic': function () {
return wrapForOptimizing([
]
]
]
- ]);
+ ], true);
},
'has one wrap': function (wrapped) {
assert.lengthOf(wrapped, 1);
]
]
]
- ]);
+ ], true);
},
'is a block': function (wrapped) {
assert.isTrue(wrapped[0].block);
'property',
['property-name', 'margin']
]
- ]);
+ ], true);
},
'has one wrap': function (wrapped) {
assert.lengthOf(wrapped, 1);
['property-name', 'margin'],
['property-value', '0!important']
]
- ]);
+ ], true);
},
'has one wrap': function (wrapped) {
assert.lengthOf(wrapped, 1);
['property-value', '0'],
['property-value', '!important']
]
- ]);
+ ], true);
},
'has one wrap': function (wrapped) {
assert.lengthOf(wrapped, 1);
['property-value', '0!'],
['property-value', 'important']
]
- ]);
+ ], true);
},
'has one wrap': function (wrapped) {
assert.lengthOf(wrapped, 1);
['property-value', '!'],
['property-value', 'important']
]
- ]);
+ ], true);
},
'has one wrap': function (wrapped) {
assert.lengthOf(wrapped, 1);
['property-name', '_color'],
['property-value', 'red']
]
- ]);
+ ], true);
},
'has one wrap': function (wrapped) {
assert.lengthOf(wrapped, 1);
['property-name', '*color'],
['property-value', 'red']
]
- ]);
+ ], true);
},
'has one wrap': function (wrapped) {
assert.lengthOf(wrapped, 1);
['property-name', 'margin'],
['property-value', '0\\9']
]
- ]);
+ ], true);
},
'has one wrap': function (wrapped) {
assert.lengthOf(wrapped, 1);
['property-name', 'margin'],
['property-value', '0']
]
- ]);
+ ], true);
},
'has one wrap': function (wrapped) {
assert.lengthOf(wrapped, 1);
['property-value', '0'],
['property-value', '\\9']
]
- ]);
+ ], true);
},
'has one wrap': function (wrapped) {
assert.lengthOf(wrapped, 1);
['property-name', 'margin'],
['property-value', '0!ie']
]
- ]);
+ ], true);
},
'has one wrap': function (wrapped) {
assert.lengthOf(wrapped, 1);
['property-name', 'margin'],
['property-value', '0 !ie']
]
- ]);
+ ], true);
},
'has one wrap': function (wrapped) {
assert.lengthOf(wrapped, 1);
['property-value', '0'],
['property-value', '!ie']
]
- ]);
+ ], true);
},
'has one wrap': function (wrapped) {
assert.lengthOf(wrapped, 1);
['property-name', 'color'],
['property-value', 'red\\9!important']
]
- ]);
+ ], true);
},
'has one wrap': function (wrapped) {
assert.lengthOf(wrapped, 1);
['property-name', 'color', [[1, 2, undefined]]],
['property-value', 'red', [[1, 2, undefined]]]
]
- ]);
+ ], true);
},
'has one wrap': function (wrapped) {
assert.lengthOf(wrapped, 1);