Skip to content

Commit

Permalink
Fix tests due to upgrades in wegue-oss#335
Browse files Browse the repository at this point in the history
This fixes the test suite due to the library / dependency updates in PR wegue-oss#335.
  • Loading branch information
chrismayer committed Jul 18, 2023
1 parent b1d9735 commit dca3551
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 21 deletions.
10 changes: 5 additions & 5 deletions src/components/attributeTable/AttributeTableWin.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<wgu-module-card v-bind="$attrs"
:moduleName="moduleName"
class="wgu-attributetable-win"
:icon="icon"
class="wgu-attributetable-win"
:icon="icon"
>

<template v-slot:wgu-win-toolbar>
Expand All @@ -15,7 +15,7 @@
outlined
class="wgu-vector-layer-select wgu-solo-field"
:items="displayedLayers"
:item-text="item => item.get('name')"
:item-text="item => item.get('name')"
:menu-props="{
bottom: true,
'offset-y': true,
Expand All @@ -26,7 +26,7 @@
:label="$t('wgu-attributetable.selectorLabel')"
></v-select>
</template>

<wgu-attributetable
v-if="selLayer"
:layerId="selLayer.get('lid')"
Expand Down Expand Up @@ -91,7 +91,7 @@ export default {

<style scoped>
/* TODO
/* TODO
Generalize the positioning concept for windows,
this interferes with positioning and draggable settings in the app.conf */
Expand Down
7 changes: 5 additions & 2 deletions tests/unit/specs/components/AppSidebar.spec.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import AppSidebar from 'APP/components/AppSidebar';
import { WguEventBus } from '@/WguEventBus';
import { shallowMount } from '@vue/test-utils';
import Vuetify from 'vuetify';

const vuetify = new Vuetify();

describe('AppSidebar.vue', () => {
describe('data', () => {
let comp;
let vm;
beforeEach(() => {
comp = shallowMount(AppSidebar);
comp = shallowMount(AppSidebar, { vuetify });
vm = comp.vm;
});

Expand All @@ -20,7 +23,7 @@ describe('AppSidebar.vue', () => {
let comp;
let vm;
beforeEach(() => {
comp = shallowMount(AppSidebar);
comp = shallowMount(AppSidebar, { vuetify });
vm = comp.vm;
});

Expand Down
15 changes: 11 additions & 4 deletions tests/unit/specs/components/bglayerswitcher/BgLayerList.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import BgLayerList from '@/components/bglayerswitcher/BgLayerList';
import OlMap from 'ol/Map';
import VectorLayer from 'ol/layer/Vector';
import VectorSource from 'ol/source/Vector';
import Vuetify from 'vuetify';

const vuetify = new Vuetify();

const moduleProps = {
imageWidth: 152,
Expand All @@ -24,7 +27,8 @@ describe('bglayerswitcher/BgLayerList.vue', () => {
let vm;
beforeEach(() => {
comp = shallowMount(BgLayerList, {
propsData: moduleProps
propsData: moduleProps,
vuetify
});
vm = comp.vm;
});
Expand All @@ -45,7 +49,8 @@ describe('bglayerswitcher/BgLayerList.vue', () => {
let vm;
beforeEach(() => {
comp = shallowMount(BgLayerList, {
propsData: moduleProps
propsData: moduleProps,
vuetify
});
vm = comp.vm;
});
Expand All @@ -66,7 +71,8 @@ describe('bglayerswitcher/BgLayerList.vue', () => {
let vm;
beforeEach(() => {
comp = shallowMount(BgLayerList, {
propsData: moduleProps
propsData: moduleProps,
vuetify
});
vm = comp.vm;
});
Expand Down Expand Up @@ -129,7 +135,8 @@ describe('bglayerswitcher/BgLayerList.vue', () => {
let vm;
beforeEach(() => {
comp = shallowMount(BgLayerList, {
propsData: moduleProps
propsData: moduleProps,
vuetify
});
vm = comp.vm;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import LayerPreviewImage from '@/components/bglayerswitcher/LayerPreviewImage';
import TileLayer from 'ol/layer/Tile';
import OSM from 'ol/source/OSM';
import View from 'ol/View';
import Vuetify from 'vuetify';

const vuetify = new Vuetify();

const osmLayer = new TileLayer({
source: new OSM()
Expand Down Expand Up @@ -32,7 +35,8 @@ describe('bglayerswitcher/LayerPreviewImage.vue', () => {
let vm;
beforeEach(() => {
comp = shallowMount(LayerPreviewImage, {
propsData: moduleProps
propsData: moduleProps,
vuetify
});
vm = comp.vm;
});
Expand All @@ -55,7 +59,8 @@ describe('bglayerswitcher/LayerPreviewImage.vue', () => {
let vm;
beforeEach(() => {
comp = shallowMount(LayerPreviewImage, {
propsData: moduleProps
propsData: moduleProps,
vuetify
});
vm = comp.vm;
});
Expand All @@ -74,13 +79,14 @@ describe('bglayerswitcher/LayerPreviewImage.vue', () => {
let vm;
beforeEach(() => {
comp = shallowMount(LayerPreviewImage, {
propsData: moduleProps
propsData: moduleProps,
vuetify
});
vm = comp.vm;
});

it('has correct previewURL for OSM', () => {
expect(vm.previewURL).to.equal('https://b.tile.openstreetmap.org/2/2/2.png');
expect(vm.previewURL).to.equal('https://tile.openstreetmap.org/2/2/2.png');
});

it('has correct previewURL for static layer image', async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/specs/components/infoclick/CoordsTable.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('infoclick/CoordsTable.vue', () => {
const expextedCoordRows = {
'MAP PROJ': '1.00 1.00',
'WGS 84': '1.0000000° 1.0000000°',
'HDMS': '1° 00′ 00″ N 1° 00′ 00″ E'
'HDMS': '1° N 1° E'
};
/* eslint-enable quote-props */
comp.vm.$nextTick(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import Vue from 'vue'
import { mount, shallowMount } from '@vue/test-utils';
import LocaleSwitcher from '@/components/localeswitcher/LocaleSwitcher';
import Vuetify from 'vuetify';

const vuetify = new Vuetify();

const appConfig = {
lang: {
Expand All @@ -21,7 +24,7 @@ describe('localeswitcher/LocaleSwitcher.vue', () => {
let comp;
let vm;
beforeEach(() => {
comp = shallowMount(LocaleSwitcher);
comp = shallowMount(LocaleSwitcher, { vuetify });
vm = comp.vm;
});

Expand All @@ -39,7 +42,7 @@ describe('localeswitcher/LocaleSwitcher.vue', () => {
let vm;
beforeEach(() => {
Vue.prototype.$appConfig = appConfig;
comp = shallowMount(LocaleSwitcher);
comp = shallowMount(LocaleSwitcher, { vuetify });
vm = comp.vm;
});

Expand All @@ -62,9 +65,7 @@ describe('localeswitcher/LocaleSwitcher.vue', () => {
beforeEach(() => {
Vue.prototype.$appConfig = appConfig;
comp = mount(LocaleSwitcher, {
created () {
this.$vuetify.lang = { current: 'en' };
}
vuetify
});
vm = comp.vm;
});
Expand Down

0 comments on commit dca3551

Please sign in to comment.