From c92c65a89b1006a95002585033ddd5b94b35c6d0 Mon Sep 17 00:00:00 2001 From: Just van den Broecke Date: Fri, 26 Feb 2021 02:34:33 +0100 Subject: [PATCH 1/3] #180 fixed Unit Tests except MeasureWin.spec.js - lifecycle issues --- src/components/helpwin/HelpWin.vue | 11 ++-- src/components/helpwin/ToggleButton.vue | 12 ++--- src/components/measuretool/MeasureWin.vue | 47 ++++++++++++---- .../measuretool/OlMeasureController.js | 20 ++++++- src/components/ol/Map.vue | 8 +++ src/components/ol/PermalinkController.js | 16 +++++- src/mixins/Mapable.js | 9 ++++ src/util/Layer.js | 2 - test/unit/index.js | 3 +- .../specs/components/helpwin/HelpWin.spec.js | 40 ++++++++++++-- .../components/helpwin/ToggleButton.spec.js | 14 +++-- .../components/measuretool/MeasureWin.spec.js | 34 +++++++++--- test/unit/specs/components/ol/Map.spec.js | 40 +++++++++++--- .../components/ol/PermalinkController.spec.js | 54 ++++++++++++++----- 14 files changed, 246 insertions(+), 64 deletions(-) diff --git a/src/components/helpwin/HelpWin.vue b/src/components/helpwin/HelpWin.vue index 3c2ae703..68bdadfe 100644 --- a/src/components/helpwin/HelpWin.vue +++ b/src/components/helpwin/HelpWin.vue @@ -35,13 +35,14 @@ icon: {type: String, required: false, default: 'help'} }, data () { + let config = this.$appConfig.modules['wgu-helpwin'] || {}; return { show: false, - windowTitle: this.$appConfig.modules['wgu-helpwin'].windowTitle, - textTitle: this.$appConfig.modules['wgu-helpwin'].textTitle, - htmlContent: this.$appConfig.modules['wgu-helpwin'].htmlContent, - infoLinkUrl: this.$appConfig.modules['wgu-helpwin'].infoLinkUrl, - infoLinkText: this.$appConfig.modules['wgu-helpwin'].infoLinkText + windowTitle: config.windowTitle || 'About', + textTitle: config.textTitle || 'About Wegue', + htmlContent: config.htmlContent || '

WebGIS with OpenLayers and Vue.js

', + infoLinkUrl: config.infoLinkUrl || 'https://github.com/meggsimum/wegue', + infoLinkText: config.infoLinkText || 'More info' } }, methods: { diff --git a/src/components/helpwin/ToggleButton.vue b/src/components/helpwin/ToggleButton.vue index 0b704b4b..96f07095 100644 --- a/src/components/helpwin/ToggleButton.vue +++ b/src/components/helpwin/ToggleButton.vue @@ -1,11 +1,11 @@ -