From b3f187635b3456f68edc9828d7eb9fdc54ba1da5 Mon Sep 17 00:00:00 2001 From: Mateusz Samsel Date: Thu, 8 Aug 2019 13:28:15 +0200 Subject: [PATCH] Add unit test. --- tests/colorgrid/colorgridview.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/colorgrid/colorgridview.js b/tests/colorgrid/colorgridview.js index 803c60d0..28105cf4 100644 --- a/tests/colorgrid/colorgridview.js +++ b/tests/colorgrid/colorgridview.js @@ -106,6 +106,23 @@ describe( 'ColorGridView', () => { expect( view.items.get( 2 ).isOn ).to.be.false; } ); + it( 'should determins isOn value when colorTile is added', () => { + view.selectedColor = 'gold'; + + const tile = new ColorTileView(); + tile.set( { + color: 'gold', + label: 'Gold', + options: { + hasBorder: false + } + } ); + + view.items.add( tile ); + + expect( view.items.get( 3 ).isOn ).to.be.true; + } ); + describe( 'add colors from definition as child items', () => { it( 'has proper number of elements', () => { expect( view.items.length ).to.equal( 3 );