-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
310a0c7
commit 64a0ad2
Showing
5 changed files
with
54 additions
and
57 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,17 @@ | ||
import MainApp from '@/main' | ||
import AppLoader from '@/app-loader' | ||
import AppRootComponent from '@/App' | ||
|
||
describe('App render', () => { | ||
it('should render correct contents', (done) => { | ||
// eslint-disable-next-line no-undef | ||
|
||
// const Constructor = Vue.extend(App) | ||
// const vm = new Constructor().$mount() | ||
|
||
setTimeout(() => { | ||
let vm = MainApp.getInstance() | ||
expect(vm.$el.querySelector('#app')).toBeDefined() | ||
expect(vm.$el.querySelector('.simple-place-search')).toBeDefined() | ||
expect(vm.$el.querySelector('.app-content')).toBeDefined() | ||
expect(vm.$el.querySelector('#map-view')).toBeDefined() | ||
done() | ||
}, 2000) | ||
|
||
let appLoader = new AppLoader() | ||
appLoader.loadApp(AppRootComponent, '#app', '<App/>').then(vueInstance => { | ||
vueInstance.appHooks.loadRegisteredHooks() | ||
vueInstance.appHooks.run('appLoaded', vueInstance) | ||
expect(vueInstance.$el.querySelector('#app')).toBeDefined() | ||
expect(vueInstance.$el.querySelector('.simple-place-search')).toBeDefined() | ||
expect(vueInstance.$el.querySelector('.app-content')).toBeDefined() | ||
expect(vueInstance.$el.querySelector('#map-view')).toBeDefined() | ||
done() | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,37 @@ | ||
import MainApp from '@/main' | ||
import Vue from '@/common/vue-with-vuetify.js' | ||
import defaultMapSettings from '@/config/default-map-settings' | ||
import MapView from '@/fragments/map-view/MapView.vue' | ||
import PreparedVue from '@/common/prepared-vue.js' | ||
import constants from '@/resources/constants' | ||
import I18nBuilder from '@/i18n/i18n-builder' | ||
import appConfig from '@/config/app-config' | ||
import AppLoader from '@/app-loader' | ||
import store from '@/store/store' | ||
|
||
describe('App render', () => { | ||
describe('Map render', () => { | ||
it('should render correct contents', (done) => { | ||
// eslint-disable-next-line no-undef | ||
|
||
const Constructor = Vue.extend(MapView) | ||
const vm = new Constructor().$mount() | ||
|
||
setTimeout(() => { | ||
let vm = MainApp.getInstance() | ||
expect(vm.$el.querySelector('#app')).toBeDefined() | ||
expect(vm.$el.querySelector('.simple-place-search')).toBeDefined() | ||
expect(vm.$el.querySelector('.app-content')).toBeDefined() | ||
new AppLoader().loadAppData(() => { | ||
const MapConstructor = PreparedVue.extend(MapView) | ||
let props = { | ||
initialZoom: appConfig.initialZoomLevel, | ||
avoidPolygons: [], | ||
mapViewData: {}, | ||
center: defaultMapSettings.mapCenter, | ||
showPopups: false, | ||
height: 900, | ||
fitBounds: true, | ||
showControls: true, | ||
shrunk: false, | ||
mode: constants.modes.place, | ||
supportsDrawingTool: true, | ||
routingProfileIcon: null | ||
} | ||
|
||
let i18n = I18nBuilder.build() | ||
var mapInstance = new MapConstructor({ propsData: props, i18n: i18n, store: store}) | ||
const vm = mapInstance.$mount() | ||
expect(vm.$el.querySelector('#map-view')).toBeDefined() | ||
done() | ||
}, 2000) | ||
done() | ||
}) | ||
|
||
}) | ||
}) |