Skip to content

Commit

Permalink
Fix gfi tests by adding missing mocked getter
Browse files Browse the repository at this point in the history
  • Loading branch information
dopenguin committed Nov 7, 2024
1 parent a30b6c8 commit f6ef6ab
Showing 1 changed file with 27 additions and 22 deletions.
49 changes: 27 additions & 22 deletions packages/plugins/Gfi/tests/actions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ describe('GFI Actions', () => {
layerKeys: ['layer1'],
geometryLayerKeys: [],
afterLoadFunction: null,
gfiConfiguration: configuration.gfi,
}

const context = {
Expand All @@ -64,6 +65,17 @@ describe('GFI Actions', () => {
})
it('should fetch and process features', async () => {
const commit = jest.fn()
const configuration = {
gfi: {
layers: {
layer1: {
maxFeatures: 10,
},
},
mode: 'bboxDot',
maxFeatures: 10,
},
}
const rootGetters = {
map: {
getLayers: () => ({
Expand All @@ -75,22 +87,13 @@ describe('GFI Actions', () => {
}),
}),
},
configuration: {
gfi: {
layers: {
layer1: {
maxFeatures: 10,
},
},
mode: 'bboxDot',
maxFeatures: 10,
},
},
configuration,
}
const getters = {
layerKeys: ['layer1'],
geometryLayerKeys: ['layer1'],
afterLoadFunction: null,
gfiConfiguration: configuration.gfi,
}

const context = {
Expand Down Expand Up @@ -127,6 +130,17 @@ describe('GFI Actions', () => {
})
it('should handle failed feature request', async () => {
const commit = jest.fn()
const configuration = {
gfi: {
layers: {
layer1: {
maxFeatures: 10,
},
},
mode: 'bboxDot',
maxFeatures: 10,
},
}
const rootGetters = {
map: {
getLayers: () => ({
Expand All @@ -138,22 +152,13 @@ describe('GFI Actions', () => {
}),
}),
},
configuration: {
gfi: {
layers: {
layer1: {
maxFeatures: 10,
},
},
mode: 'bboxDot',
maxFeatures: 10,
},
},
configuration,
}
const getters = {
layerKeys: ['layer1'],
geometryLayerKeys: ['layer1'],
afterLoadFunction: null,
gfiConfiguration: configuration.gfi,
}

const context = {
Expand Down

0 comments on commit f6ef6ab

Please sign in to comment.