mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-23 15:36:33 +00:00
test(tours): follow the ski tour changes in the tests
The collection tour fixture no longer writes the dropped winter_activity column, the drafts are saved as version 11, and a hike no longer offers the pistes layer, which belongs to a ski track only.
This commit is contained in:
@@ -116,7 +116,7 @@ describe('useTourPlanner, bike tours (BIK-01)', () => {
|
||||
await settle();
|
||||
act(() => result.current.setBikeProfile('road'));
|
||||
expect(JSON.parse(localStorage.getItem('tour-draft-52') || 'null')).toMatchObject({
|
||||
version: 10,
|
||||
version: 11,
|
||||
tourType: 'bike',
|
||||
bikeProfile: 'road',
|
||||
});
|
||||
|
||||
@@ -1618,7 +1618,7 @@ describe('useTourPlanner', () => {
|
||||
|
||||
expect(result.current.mode).toEqual({ type: 'new-draft' })
|
||||
expect(JSON.parse(localStorage.getItem('tour-draft-23') || 'null')).toMatchObject({
|
||||
version: 10,
|
||||
version: 11,
|
||||
tourType: 'hike',
|
||||
name: '',
|
||||
waypoints: [],
|
||||
|
||||
@@ -5,7 +5,7 @@ describe('tourMapLayersFor (MAP-01)', () => {
|
||||
it('offers OpenHikingMap to a hike only while the admin allows it', () => {
|
||||
expect(tourMapLayersFor('hike').bases).not.toContain('hiking');
|
||||
expect(tourMapLayersFor('hike', { hikingMap: true }).bases).toEqual(['default', 'topo', 'hiking', 'satellite']);
|
||||
expect(tourMapLayersFor('hike', { hikingMap: true }).overlays).toEqual(['ferratas', 'pistes']);
|
||||
expect(tourMapLayersFor('hike', { hikingMap: true }).overlays).toEqual(['ferratas']);
|
||||
expect(tourMapLayersFor('kayak', { hikingMap: true }).bases).not.toContain('hiking');
|
||||
expect(tourMapLayersFor(null, { hikingMap: true }).bases).not.toContain('hiking');
|
||||
});
|
||||
@@ -24,10 +24,9 @@ describe('tourMapLayersFor (MAP-01)', () => {
|
||||
expect(baseLayerFor(tourMapLayersFor('ski'), 'hiking')).toBe('default');
|
||||
});
|
||||
|
||||
it('SKI-01: the pistes are offered to a hike and a ski track, never to a bike tour, a run, a paddle tour or another type', () => {
|
||||
expect(tourMapLayersFor('hike').overlays).toContain('pistes');
|
||||
it('SKI-02: the pistes are offered to a ski track only, never to a hike, a bike tour, a run, a paddle tour or another type', () => {
|
||||
expect(tourMapLayersFor('ski').overlays).toContain('pistes');
|
||||
for (const type of ['bike', 'run', 'kayak', 'walk', null] as const)
|
||||
for (const type of ['hike', 'bike', 'run', 'kayak', 'walk', null] as const)
|
||||
expect(tourMapLayersFor(type).overlays).not.toContain('pistes');
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user