Added more tests

This commit is contained in:
Giuseppe Digilio
2018-06-19 15:10:56 +02:00
parent 4a2e2b754b
commit 3fdb074d05
7 changed files with 801 additions and 36 deletions

View File

@@ -37,7 +37,7 @@ import { DynamicLookupModel } from './models/lookup/dynamic-lookup.model';
import { DynamicScrollableDropdownModel } from './models/scrollable-dropdown/dynamic-scrollable-dropdown.model';
import { DynamicTagModel } from './models/tag/dynamic-tag.model';
import { DynamicTypeaheadModel } from './models/typeahead/dynamic-typeahead.model';
import { DynamicComboboxModel } from './models/ds-dynamic-combobox.model';
import { DynamicQualdropModel } from './models/ds-dynamic-qualdrop.model';
describe('DsDynamicFormControlComponent test suite', () => {
@@ -80,7 +80,7 @@ describe('DsDynamicFormControlComponent test suite', () => {
}),
new DynamicDsDatePickerModel({id: 'datepicker'}),
new DynamicLookupModel({id: 'lookup', separator: ','}),
new DynamicComboboxModel({id: 'combobox', readOnly: false})
new DynamicQualdropModel({id: 'combobox', readOnly: false})
];
const testModel = formModel[8];
let formGroup: FormGroup;

View File

@@ -4,24 +4,24 @@ import { Subject } from 'rxjs/Subject';
import { DynamicFormGroupModelConfig } from '@ng-dynamic-forms/core/src/model/form-group/dynamic-form-group.model';
import { LanguageCode } from '../../models/form-field-language-value.model';
export const COMBOBOX_GROUP_SUFFIX = '_COMBO_GROUP';
export const COMBOBOX_METADATA_SUFFIX = '_COMBO_METADATA';
export const COMBOBOX_VALUE_SUFFIX = '_COMBO_VALUE';
export const QUALDROP_GROUP_SUFFIX = '_QUALDROP_GROUP';
export const QUALDROP_METADATA_SUFFIX = '_QUALDROP_METADATA';
export const QUALDROP_VALUE_SUFFIX = '_QUALDROP_VALUE';
export interface DsDynamicComboboxModelConfig extends DynamicFormGroupModelConfig {
export interface DsDynamicQualdropModelConfig extends DynamicFormGroupModelConfig {
languageCodes?: LanguageCode[];
language?: string;
readOnly: boolean;
}
export class DynamicComboboxModel extends DynamicFormGroupModel {
export class DynamicQualdropModel extends DynamicFormGroupModel {
@serializable() private _language: string;
@serializable() private _languageCodes: LanguageCode[];
@serializable() languageUpdates: Subject<string>;
@serializable() hasLanguages = false;
@serializable() readOnly: boolean;
constructor(config: DsDynamicComboboxModelConfig, layout?: DynamicFormControlLayout) {
constructor(config: DsDynamicQualdropModelConfig, layout?: DynamicFormControlLayout) {
super(config, layout);
this.readOnly = config.readOnly;

View File

@@ -1,6 +1,5 @@
import { AUTOCOMPLETE_OFF, DynamicFormControlLayout, serializable } from '@ng-dynamic-forms/core';
import { DsDynamicInputModel, DsDynamicInputModelConfig } from '../ds-dynamic-input.model';
import { AuthorityOptions } from '../../../../../../core/integration/models/authority-options.model';
export const DYNAMIC_FORM_CONTROL_TYPE_TYPEAHEAD = 'TYPEAHEAD';