From 35209d77ccaeb24b382d6933f5c1b0c954496ebe Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 13 May 2022 12:14:37 +0200 Subject: [PATCH] fix(multi-check) --- .../components/multi-check/multi-check.html | 6 ++-- .../components/multi-check/multi-check.js | 4 +++ .../multi-check/multi-check.spec.js | 34 +++++++++++++++++++ front/core/components/multi-check/style.scss | 9 +---- 4 files changed, 43 insertions(+), 10 deletions(-) diff --git a/front/core/components/multi-check/multi-check.html b/front/core/components/multi-check/multi-check.html index eaa4577f0..fe485e19b 100644 --- a/front/core/components/multi-check/multi-check.html +++ b/front/core/components/multi-check/multi-check.html @@ -5,12 +5,14 @@ - + All diff --git a/front/core/components/multi-check/multi-check.js b/front/core/components/multi-check/multi-check.js index e60d16519..077c93360 100644 --- a/front/core/components/multi-check/multi-check.js +++ b/front/core/components/multi-check/multi-check.js @@ -172,6 +172,10 @@ export default class MultiCheck extends FormInput { this.checkedDummyCount = this.allRowsCount; } + isCheckedDummy() { + return this.checked && this.checkDummyEnabled; + } + /** * Toggles checked property on * all instances diff --git a/front/core/components/multi-check/multi-check.spec.js b/front/core/components/multi-check/multi-check.spec.js index 1c0adb9d8..bda022d6b 100644 --- a/front/core/components/multi-check/multi-check.spec.js +++ b/front/core/components/multi-check/multi-check.spec.js @@ -190,4 +190,38 @@ describe('Component vnMultiCheck', () => { expect(controller.checkedDummyCount).toBeNull(); }); }); + + describe('isCheckedDummy()', () => { + it(`should return true only if is checked and checked dummy is enabled`, () => { + controller.checked = true; + controller.checkDummyEnabled = true; + const isCheckedDummy = controller.isCheckedDummy(); + + expect(isCheckedDummy).toEqual(true); + }); + + it(`should return true only if is checked and checked dummy is enabled`, () => { + controller.checked = true; + controller.checkDummyEnabled = true; + const isCheckedDummy = controller.isCheckedDummy(); + + expect(isCheckedDummy).toEqual(true); + }); + + it(`should return false if not checked`, () => { + controller.checked = false; + controller.checkDummyEnabled = true; + const isCheckedDummy = controller.isCheckedDummy(); + + expect(isCheckedDummy).toEqual(false); + }); + + it(`should return false if checked dummy is disabled`, () => { + controller.checked = true; + controller.checkDummyEnabled = false; + const isCheckedDummy = controller.isCheckedDummy(); + + expect(isCheckedDummy).toEqual(false); + }); + }); }); diff --git a/front/core/components/multi-check/style.scss b/front/core/components/multi-check/style.scss index 7a4d10675..15f462e8f 100644 --- a/front/core/components/multi-check/style.scss +++ b/front/core/components/multi-check/style.scss @@ -3,15 +3,8 @@ vn-multi-check { .vn-check { margin-bottom: 12px } - - vn-list{ - padding: 50px; - } - vn-menu{ - padding: 50px; - } - } + .bold{ font-weight: bold; } \ No newline at end of file