Update config dialog tests
This commit is contained in:
parent
58aac88f7e
commit
2a247d0234
@ -52,7 +52,7 @@ describe('ConfigDialogModel tests', () => {
|
|||||||
const testElements = [
|
const testElements = [
|
||||||
'interval', 'units', 'lang', 'mapApi', 'googleKey', 'layerName', 'layerId', 'layerUrl', 'initLatitude', 'initLongitude',
|
'interval', 'units', 'lang', 'mapApi', 'googleKey', 'layerName', 'layerId', 'layerUrl', 'initLatitude', 'initLongitude',
|
||||||
'requireAuth', 'publicTracks', 'passStrength', 'passLenMin', 'strokeWeight', 'strokeColor', 'strokeOpacity',
|
'requireAuth', 'publicTracks', 'passStrength', 'passLenMin', 'strokeWeight', 'strokeColor', 'strokeOpacity',
|
||||||
'colorNormal', 'colorStart', 'colorStop', 'colorExtra', 'colorHilite', 'uploadMaxSize'
|
'colorNormal', 'colorStart', 'colorStop', 'colorExtra', 'colorHilite', 'uploadMaxSizeMB'
|
||||||
];
|
];
|
||||||
testElements.forEach((name) => {
|
testElements.forEach((name) => {
|
||||||
it(`should trigger model property change for ${name}`, (done) => {
|
it(`should trigger model property change for ${name}`, (done) => {
|
||||||
@ -87,6 +87,21 @@ describe('ConfigDialogModel tests', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should update uploadMaxSize when uploadMaxSizeMB is changed', (done) => {
|
||||||
|
// given
|
||||||
|
cm.init();
|
||||||
|
const element = cm.dialog.element.querySelector('[data-bind=uploadMaxSizeMB]');
|
||||||
|
const valueMB = 2;
|
||||||
|
// when
|
||||||
|
element.value = valueMB;
|
||||||
|
element.dispatchEvent(new Event('change'));
|
||||||
|
// then
|
||||||
|
setTimeout(() => {
|
||||||
|
expect(cm.model.uploadMaxSize).toBe(valueMB * 1024 * 1024);
|
||||||
|
done();
|
||||||
|
}, 100);
|
||||||
|
});
|
||||||
|
|
||||||
it('should show layer edit on add button click', (done) => {
|
it('should show layer edit on add button click', (done) => {
|
||||||
// given
|
// given
|
||||||
cm.init();
|
cm.init();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user