Skip to content

Commit

Permalink
test: Migrate map-render.spec.js
Browse files Browse the repository at this point in the history
- add as MapView component test
- doesn't really do much and should be extended
- remove old spec
  • Loading branch information
TheGreatRefrigerator committed Jan 26, 2023
1 parent b4767b9 commit ee4e60a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 36 deletions.
25 changes: 25 additions & 0 deletions src/fragments/map-view/MapView.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import mapViewDataTemplates from 'fixtures/map-view-data.js'
import MapView from './MapView.vue'
import MapViewProps from 'fixtures/map-view-props.js'
import I18nBuilder from '@/i18n/i18n-builder'
import AppLoader from '@/app-loader'
import store from '@/store/store'

describe('Map rendering', () => {
beforeEach(() => {
cy.intercept('GET', 'https://*.tile.openstreetmap.org/*/*/*.png', {fixture: 'map-pin.jpg'})
})
it('should render map-view with single place', () => {
new AppLoader().fetchApiInitialData()
let props = {... MapViewProps, ... {mapViewData: mapViewDataTemplates.singlePlace}}
cy.mount(MapView, {propsData: props, i18n: I18nBuilder.build(), store: store})

cy.get('#map-view')
})
it('should render map-view with place search results', () => {
new AppLoader().fetchApiInitialData()
let props = {... MapViewProps, ... {mapViewData: mapViewDataTemplates.placeSearchResults}}
cy.mount(MapView, {propsData: props, i18n: I18nBuilder.build(), store: store})
cy.get('#map-view')
})
})
36 changes: 0 additions & 36 deletions tests/integration/specs/map-render.spec.js

This file was deleted.

0 comments on commit ee4e60a

Please sign in to comment.