Skip to content

Commit a7408fb

Browse files
committed
Add tests for important in style properties
1 parent 15b1fa5 commit a7408fb

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/specs/style_manager/model/Models.js

+12
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,18 @@ module.exports = {
159159
expect(obj.parseValue('fn(testValue)')).toEqual(result);
160160
expect(obj.parseValue('fn(testValue')).toEqual(result);
161161
});
162+
163+
test('Parse correctly a value with !important', () => {
164+
const result = { value: 'red', important: 1 };
165+
expect(obj.parseValue('red !important ')).toEqual(result);
166+
});
167+
168+
test('getFullValue', () => {
169+
obj = new Property({ functionName: 'fn', value: 'red' });
170+
expect(obj.getFullValue()).toEqual('fn(red)');
171+
obj = new Property({ functionName: 'fn', value: '#123', important: 1 });
172+
expect(obj.getFullValue()).toEqual('fn(#123) !important');
173+
});
162174
});
163175

164176
describe('PropertyInteger', () => {

0 commit comments

Comments
 (0)