-
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
48a6207
commit 57f947f
Showing
4 changed files
with
70 additions
and
12 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import AppLoader from '@/app-loader' | ||
import AppRootComponent from '@/App' | ||
import store from '@/store/store' | ||
|
||
describe('App embed rendering', () => { | ||
it('should render app initial page in embed mode', (done) => { | ||
let appLoader = new AppLoader() | ||
appLoader.loadApp(AppRootComponent, '#app', '<App/>').then(vueInstance => { | ||
vueInstance.appHooks.loadRegisteredHooks() | ||
vueInstance.appHooks.run('appLoaded', vueInstance) | ||
|
||
vueInstance.$nextTick(() => { | ||
let appContent = vueInstance.$el.querySelector('.app-content') | ||
expect(appContent).toBeDefined() | ||
expect(appContent).not.toBeNull() | ||
|
||
let mapView = vueInstance.$el.querySelector('#map-view') | ||
expect(mapView).toBeDefined() | ||
expect(mapView).not.toBeNull() | ||
|
||
store.commit('embed', true) | ||
|
||
appContent.__vue__.$nextTick(() => { | ||
setTimeout(() => { | ||
let simplePlaceSearch = appContent.querySelector('.simple-place-search') | ||
expect(simplePlaceSearch).toBeNull() // in embed mode, simple place search must not be visible | ||
|
||
// in embed mode, view on ors button must be visible | ||
let viewOnOrs = appContent.querySelector('.view-on-ors') | ||
expect(viewOnOrs).toBeDefined() | ||
expect(viewOnOrs).not.toBeNull() | ||
done() | ||
}, 200) | ||
}) | ||
}) | ||
}).catch ( err => { | ||
done.fail(err) | ||
}) | ||
}) | ||
}) |
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,17 +1,33 @@ | ||
import AppLoader from '@/app-loader' | ||
import AppRootComponent from '@/App' | ||
|
||
describe('App render', () => { | ||
describe('App rendering', () => { | ||
it('should render app initial page', (done) => { | ||
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() | ||
|
||
vueInstance.$nextTick(() => { | ||
let appContent = vueInstance.$el.querySelector('.app-content') | ||
expect(appContent).toBeDefined() | ||
expect(appContent).not.toBeNull() | ||
|
||
let mapView = vueInstance.$el.querySelector('#map-view') | ||
expect(mapView).toBeDefined() | ||
expect(mapView).not.toBeNull() | ||
|
||
appContent.__vue__.$nextTick(() => { | ||
setTimeout(() => { | ||
let simplePlaceSearch = appContent.querySelector('.simple-place-search') | ||
expect(simplePlaceSearch).toBeDefined() | ||
expect(simplePlaceSearch).not.toBeNull() | ||
done() | ||
}, 200) | ||
}) | ||
}) | ||
}).catch ( err => { | ||
done.fail(err) | ||
}) | ||
}) | ||
}) |
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