From 2a247d023490232ccc436d8beac86174c17e5175 Mon Sep 17 00:00:00 2001 From: Bartek Fabiszewski Date: Fri, 5 Jun 2020 12:00:54 +0200 Subject: [PATCH] Update config dialog tests --- js/test/configdialogmodel.test.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/js/test/configdialogmodel.test.js b/js/test/configdialogmodel.test.js index db32a32..01d959e 100644 --- a/js/test/configdialogmodel.test.js +++ b/js/test/configdialogmodel.test.js @@ -52,7 +52,7 @@ describe('ConfigDialogModel tests', () => { const testElements = [ 'interval', 'units', 'lang', 'mapApi', 'googleKey', 'layerName', 'layerId', 'layerUrl', 'initLatitude', 'initLongitude', 'requireAuth', 'publicTracks', 'passStrength', 'passLenMin', 'strokeWeight', 'strokeColor', 'strokeOpacity', - 'colorNormal', 'colorStart', 'colorStop', 'colorExtra', 'colorHilite', 'uploadMaxSize' + 'colorNormal', 'colorStart', 'colorStop', 'colorExtra', 'colorHilite', 'uploadMaxSizeMB' ]; testElements.forEach((name) => { 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) => { // given cm.init();