diff --git a/front/core/components/check/check.html b/front/core/components/check/check.html index 0df887f9b5..67545b67c6 100644 --- a/front/core/components/check/check.html +++ b/front/core/components/check/check.html @@ -1,5 +1,5 @@ { + let controller; + let $element; + + beforeEach(ngModule('vnCore')); + + beforeEach(inject(($compile, $rootScope) => { + $element = $compile(` { + $element.remove(); + }); + + describe('model() setter', () => { + it(`should set model value`, () => { + controller.model = true; + + expect(controller.model).toEqual(true); + }); + + it(`should set model value to null if current model value is false and is a triple-state checkbox`, () => { + controller._model = false; + controller.tripleState = true; + controller.model = true; + + expect(controller.model).toEqual(null); + }); + }); + + describe('field() setter', () => { + it(`should set model value`, () => { + controller.field = true; + + expect(controller.field).toEqual(true); + }); + + it(`should set model value and convert numerical values to boolean values`, () => { + controller.field = 1; + + expect(controller.field).toEqual(true); + }); + }); + + describe('isIntermediate() getter', () => { + it(`should return true if intermediate property is truthy`, () => { + controller.intermediate = true; + + let result = controller.isIntermediate; + + expect(result).toEqual(true); + }); + + it(`should return true if is a triple-state checkbox and has null or undefined value`, () => { + controller.tripleState = true; + controller.model = null; + + let result = controller.isIntermediate; + + expect(result).toEqual(true); + }); + }); +}); diff --git a/front/core/components/treeview/style.scss b/front/core/components/treeview/style.scss index 40f35a1e23..317d854531 100644 --- a/front/core/components/treeview/style.scss +++ b/front/core/components/treeview/style.scss @@ -32,12 +32,12 @@ vn-treeview { background-color: $color-hover-cd } - li.expanded .actions > vn-icon[icon="keyboard_arrow_down"] { + li.expanded > vn-horizontal > .actions > vn-icon[icon="keyboard_arrow_down"] { transition: all 0.2s; transform: rotate(180deg); } - li.collapsed .actions > vn-icon[icon="keyboard_arrow_down"] { + li.collapsed > vn-horizontal > .actions > vn-icon[icon="keyboard_arrow_down"] { transition: all 0.2s; transform: rotate(0deg); }