mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-06-02 17:35:08 +00:00
[AAE-12065] improve tests
This commit is contained in:
parent
94dae984a7
commit
d861d17de3
@ -786,23 +786,29 @@ describe('DropdownCloudWidgetComponent', () => {
|
|||||||
expect(call).toEqual(undefined);
|
expect(call).toEqual(undefined);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should get default option from list of options which have any id matching the DEFAULT_OPTION id, while not having an isDefault flag set to true', () => {
|
it('should get default option from list of options which has an id matching the DEFAULT_OPTION id, while not having an isDefault flag on that option', () => {
|
||||||
const call = widget.getDefaultOption(fakeFormOptionEntries[1]);
|
const call = widget.getDefaultOption(fakeFormOptionEntries[1]);
|
||||||
|
|
||||||
expect(call).toEqual(fakeFormOptionEntries[1][0]);
|
expect(call).toEqual(fakeFormOptionEntries[1][0]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should get default option from list of options which have any id matching the DEFAULT_OPTION id while also having an isDefault flag set to true', () => {
|
it('should get default option from list of options which has an id matching the DEFAULT_OPTION id while also having an isDefault flag set to true on that option', () => {
|
||||||
const call = widget.getDefaultOption(fakeFormOptionEntries[2]);
|
const call = widget.getDefaultOption(fakeFormOptionEntries[2]);
|
||||||
|
|
||||||
expect(call).toEqual(fakeFormOptionEntries[2][0]);
|
expect(call).toEqual(fakeFormOptionEntries[2][0]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should get default option from list of options which has an isDefault flag set to true, despite the option id', () => {
|
it('should get default option from list of options which has an isDefault flag set to true, despite the option id not matching the DEFAULT_OPTION id', () => {
|
||||||
const call = widget.getDefaultOption(fakeFormOptionEntries[3]);
|
const call = widget.getDefaultOption(fakeFormOptionEntries[3]);
|
||||||
|
|
||||||
expect(call).toEqual(fakeFormOptionEntries[3][0]);
|
expect(call).toEqual(fakeFormOptionEntries[3][0]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should not get default option from list of options which has an id matching the DEFAULT_OPTION id, while having an isDefault flag set to false on that option', () => {
|
||||||
|
const call = widget.getDefaultOption(fakeFormOptionEntries[4]);
|
||||||
|
|
||||||
|
expect(call).toEqual(undefined);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Load selection for linked dropdown (i.e. saved, completed forms)', () => {
|
describe('Load selection for linked dropdown (i.e. saved, completed forms)', () => {
|
||||||
|
@ -230,6 +230,23 @@ export const fakeFormOptionEntries = [
|
|||||||
name: 'name_3',
|
name: 'name_3',
|
||||||
isDefault: false
|
isDefault: false
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
id: 'empty',
|
||||||
|
name: 'name_1',
|
||||||
|
isDefault: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'id_1',
|
||||||
|
name: 'name_2',
|
||||||
|
isDefault: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'id_3',
|
||||||
|
name: 'name_3',
|
||||||
|
isDefault: false
|
||||||
|
}
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user