From 4a9f6667ff26bf1ea7905d92a392aba66be7beb8 Mon Sep 17 00:00:00 2001 From: Dennis Kigen Date: Wed, 10 Jan 2024 23:22:09 +0300 Subject: [PATCH] (test) Add unit tests for NumberInputComponent (#117) --- .prettierignore | 2 +- .../ngx-remote-select.component.ts | 4 +- .../remote-select.component.html | 41 +++--- .../number-input/number-input.component.html | 19 ++- .../number-input.component.spec.ts | 105 +++++++------- .../number-input/number-input.component.ts | 10 +- .../form-renderer.component.html | 53 ++++--- .../form-renderer.component.scss | 20 ++- .../src/form-entry/utils/messages.ts | 26 ++-- .../ngx-formentry/styles/ngx-formentry.css | 18 ++- src/app/adult-1.6.json | 33 +---- src/assets/carbon.select.theme.css | 12 +- src/translations/en.json | 88 ++++++------ src/translations/fr.json | 84 +++++------ src/translations/km.json | 131 +++++++++--------- 15 files changed, 346 insertions(+), 300 deletions(-) diff --git a/.prettierignore b/.prettierignore index f26a922d..d002cbaf 100644 --- a/.prettierignore +++ b/.prettierignore @@ -37,4 +37,4 @@ testem.log # System Files .DS_Store Thumbs.db -./package-lock.json \ No newline at end of file +./package-lock.json diff --git a/projects/ngx-formentry/src/components/ngx-remote-select/ngx-remote-select.component.ts b/projects/ngx-formentry/src/components/ngx-remote-select/ngx-remote-select.component.ts index a7d25829..dd1a3de9 100644 --- a/projects/ngx-formentry/src/components/ngx-remote-select/ngx-remote-select.component.ts +++ b/projects/ngx-formentry/src/components/ngx-remote-select/ngx-remote-select.component.ts @@ -19,6 +19,7 @@ import { SelectOption } from '../../form-entry/question-models/interfaces/select import { DataSource } from '../../form-entry/question-models/interfaces/data-source'; import * as _ from 'lodash'; + @Component({ selector: 'ofe-remote-select', templateUrl: 'remote-select.component.html', @@ -40,11 +41,12 @@ export class RemoteSelectComponent implements OnInit, ControlValueAccessor { value = []; loading = false; searchText = ''; - notFoundMsg = 'match no found'; + notFoundMsg = 'Match not found'; @Input() placeholder = 'Search...'; @Input() componentID: string; @Input() disabled = false; @Input() theme = 'dark'; + @Input() invalid = 'false'; @Output() done: EventEmitter = new EventEmitter(); private _dataSource: DataSource; diff --git a/projects/ngx-formentry/src/components/ngx-remote-select/remote-select.component.html b/projects/ngx-formentry/src/components/ngx-remote-select/remote-select.component.html index 51b1d2ce..5a981497 100644 --- a/projects/ngx-formentry/src/components/ngx-remote-select/remote-select.component.html +++ b/projects/ngx-formentry/src/components/ngx-remote-select/remote-select.component.html @@ -1,20 +1,21 @@ -
- - -
+ + diff --git a/projects/ngx-formentry/src/components/number-input/number-input.component.html b/projects/ngx-formentry/src/components/number-input/number-input.component.html index 3aa7545e..a538561b 100644 --- a/projects/ngx-formentry/src/components/number-input/number-input.component.html +++ b/projects/ngx-formentry/src/components/number-input/number-input.component.html @@ -8,7 +8,8 @@ 'cds--number--helpertext': helperText, 'cds--skeleton': skeleton, 'cds--number--sm': size === 'sm', - 'cds--number--xl': size === 'xl' + 'cds--number--md': size === 'md', + 'cds--number--lg': size === 'lg' }" >
+ +