From a7408fb14c192d0d4db7ebbe61d48d11ceafa3f8 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 7 Jun 2018 19:37:23 +0200 Subject: [PATCH] Add tests for important in style properties --- test/specs/style_manager/model/Models.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/specs/style_manager/model/Models.js b/test/specs/style_manager/model/Models.js index 7acb2b1a33..a5579a9fea 100644 --- a/test/specs/style_manager/model/Models.js +++ b/test/specs/style_manager/model/Models.js @@ -159,6 +159,18 @@ module.exports = { expect(obj.parseValue('fn(testValue)')).toEqual(result); expect(obj.parseValue('fn(testValue')).toEqual(result); }); + + test('Parse correctly a value with !important', () => { + const result = { value: 'red', important: 1 }; + expect(obj.parseValue('red !important ')).toEqual(result); + }); + + test('getFullValue', () => { + obj = new Property({ functionName: 'fn', value: 'red' }); + expect(obj.getFullValue()).toEqual('fn(red)'); + obj = new Property({ functionName: 'fn', value: '#123', important: 1 }); + expect(obj.getFullValue()).toEqual('fn(#123) !important'); + }); }); describe('PropertyInteger', () => {