From 0a49cb2d1dc03c8b8c277ee812cab9972172653c Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 27 Jun 2017 22:33:58 +0200 Subject: [PATCH] Update color property view tests --- test/specs/style_manager/index.js | 2 +- .../style_manager/view/PropertyColorView.js | 40 +++++++++---------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/test/specs/style_manager/index.js b/test/specs/style_manager/index.js index fcd55eb40..6cc458a59 100644 --- a/test/specs/style_manager/index.js +++ b/test/specs/style_manager/index.js @@ -185,8 +185,8 @@ describe.only('StyleManager', function() { PropertySelectView.run(); PropertyRadioView.run(); PropertyIntegerView.run(); - /* PropertyColorView.run(); + /* PropertyCompositeView.run(); PropertyStackView.run(); LayerView.run(); diff --git a/test/specs/style_manager/view/PropertyColorView.js b/test/specs/style_manager/view/PropertyColorView.js index 5dd52d4c8..6896f3dd7 100644 --- a/test/specs/style_manager/view/PropertyColorView.js +++ b/test/specs/style_manager/view/PropertyColorView.js @@ -50,41 +50,41 @@ module.exports = { it('Rendered correctly', function() { var prop = view.el; - $fixture.get(0).querySelector('.property').should.be.ok; - prop.querySelector('.label').should.be.ok; - prop.querySelector('.field').should.be.ok; + expect($fixture.get(0).querySelector('.property')).toExist(); + expect(prop.querySelector('.label')).toExist(); + expect(prop.querySelector('.field')).toExist(); }); it('Inputs rendered', function() { var prop = view.el; - prop.querySelector('input[type=text]').should.be.ok; - prop.querySelector('.field-color-picker').should.be.ok; + expect(prop.querySelector('input[type=text]')).toExist(); + expect(prop.querySelector('.field-color-picker')).toExist(); }); it('Inputs should exist', function() { - view.$input.should.be.ok; - view.$color.should.be.ok; + expect(view.$input).toExist(); + expect(view.$color).toExist(); }); it('Input value is empty', function() { - view.model.get('value').should.be.empty; - view.$input.val().should.be.empty; + expect(view.model.get('value')).toNotExist(); + expect(view.$input.val()).toNotExist(); }); it('Update model on setValue', function() { view.setValue(propValue); - view.model.get('value').should.equal(propValue); - view.$input.val().should.equal(propValue); + expect(view.model.get('value')).toEqual(propValue); + expect(view.$input.val()).toEqual(propValue); }); it('Update model on input change', function() { view.$input.val(propValue).trigger('change'); - view.model.get('value').should.equal(propValue); + expect(view.model.get('value')).toEqual(propValue); }); it('Update input on value change', function() { view.model.set('value', propValue); - view.getInputValue().should.equal(propValue); + expect(view.getInputValue()).toEqual(propValue); }); it('Update target on value change', function() { @@ -93,7 +93,7 @@ module.exports = { var compStyle = view.selectedComponent.get('style'); var assertStyle = {}; assertStyle[propName] = propValue; - compStyle.should.deep.equal(assertStyle); + expect(compStyle).toEqual(assertStyle); }); describe('With target setted', function() { @@ -113,8 +113,8 @@ module.exports = { style[propName] = propValue; component.set('style', style); view.propTarget.trigger('update'); - view.model.get('value').should.equal(propValue); - view.getInputValue().should.equal(propValue); + expect(view.model.get('value')).toEqual(propValue); + expect(view.getInputValue()).toEqual(propValue); }); it('Update value after multiple swaps', function() { @@ -125,8 +125,8 @@ module.exports = { style[propName] = '#123123'; component.set('style', style); view.propTarget.trigger('update'); - view.model.get('value').should.equal('#123123'); - view.$input.val().should.equal('#123123'); + expect(view.model.get('value')).toEqual('#123123'); + expect(view.getInputValue()).toEqual('#123123'); }); }) @@ -148,11 +148,11 @@ module.exports = { }); it('Value as default', function() { - view.model.get('value').should.equal(propValue); + expect(view.model.get('value')).toEqual(propValue); }); it('Input value is as default', function() { - view.$input.val().should.equal(propValue); + expect(view.$input.val()).toEqual(propValue); }); });