-
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.
test: Migrate places-carousel.spec.js
- add map-pin and mockPlaces fixture - tile requests done by the component are intercepted and a static image returned - places passed to the component are stripped down to only contain relevant keys - remove old spec file
- Loading branch information
1 parent
d21d1f2
commit c305cee
Showing
4 changed files
with
78 additions
and
30 deletions.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,54 @@ | ||
[ | ||
{ | ||
"type": "Feature", | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [8.769869, 49.37625] | ||
}, | ||
"properties": { | ||
"layer": "locality", | ||
"name": "Heidelberg", | ||
"distance": 0.867, | ||
"country_a": "DEU", | ||
"locality": "Heidelberg", | ||
"label": "Heidelberg, BW, Germany" | ||
}, | ||
"bbox": [8.57312513958, 49.3521596612, 8.79412886129, 49.4595876777], | ||
"distance": 0.8655641929890087 | ||
}, | ||
{ | ||
"type": "Feature", | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [8.793137, 49.39434] | ||
}, | ||
"properties": { | ||
"layer": "venue", | ||
"source": "openstreetmap", | ||
"name": "Sparkasse Heidelberg", | ||
"distance": 2.585, | ||
"country_a": "DEU", | ||
"locality": "Neckargemünd", | ||
"label": "Sparkasse Heidelberg, Neckargemünd, BW, Germany" | ||
}, | ||
"bbox": [8.7928299, 49.3941569, 8.7933164, 49.3943459], | ||
"distance": 2.58199841383592 | ||
}, | ||
{ | ||
"type": "Feature", | ||
"geometry": { | ||
"type": "Point", | ||
"coordinates": [8.692416, 49.401247] | ||
}, | ||
"properties": { | ||
"layer": "county", | ||
"name": "Heidelberg", | ||
"distance": 5.497, | ||
"country_a": "DEU", | ||
"county": "Heidelberg", | ||
"label": "Heidelberg, BW, Germany" | ||
}, | ||
"bbox": [8.573125, 49.35216, 8.794129, 49.459588], | ||
"distance": 5.490898644881834 | ||
} | ||
] |
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,24 @@ | ||
import PlacesCarousel from './PlacesCarousel.vue' | ||
import mockPlaces from 'fixtures/mockPlaces.json' | ||
import store from '@/store/store' | ||
import I18nBuilder from '@/i18n/i18n-builder' | ||
import constants from '@/resources/constants' | ||
import MapViewData from '@/models/map-view-data' | ||
|
||
const i18n = I18nBuilder.build() | ||
|
||
|
||
describe('<PlacesCarousel />', () => { | ||
it('renders', () => { | ||
cy.viewport(700, 300) | ||
cy.intercept('GET', `${constants.worldImageryTileProviderBaseUrl}/*/*/*`, {fixture: 'map-pin.jpg'}) | ||
cy.mount(PlacesCarousel, { | ||
propsData: { | ||
mapViewData: new MapViewData({places: mockPlaces}), activeIndex: 0 | ||
}, i18n: i18n, store: store | ||
}) | ||
cy.get('.carousel .vue-horizontal-list') | ||
cy.get('.vhl-list .vhl-item').should('have.length', 3) | ||
cy.get('.item.active') | ||
}) | ||
}) |
This file was deleted.
Oops, something went wrong.