Skip to content

Commit f6ef6ab

Browse files
committed
Fix gfi tests by adding missing mocked getter
1 parent a30b6c8 commit f6ef6ab

File tree

1 file changed

+27
-22
lines changed

1 file changed

+27
-22
lines changed

packages/plugins/Gfi/tests/actions.spec.ts

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ describe('GFI Actions', () => {
4545
layerKeys: ['layer1'],
4646
geometryLayerKeys: [],
4747
afterLoadFunction: null,
48+
gfiConfiguration: configuration.gfi,
4849
}
4950

5051
const context = {
@@ -64,6 +65,17 @@ describe('GFI Actions', () => {
6465
})
6566
it('should fetch and process features', async () => {
6667
const commit = jest.fn()
68+
const configuration = {
69+
gfi: {
70+
layers: {
71+
layer1: {
72+
maxFeatures: 10,
73+
},
74+
},
75+
mode: 'bboxDot',
76+
maxFeatures: 10,
77+
},
78+
}
6779
const rootGetters = {
6880
map: {
6981
getLayers: () => ({
@@ -75,22 +87,13 @@ describe('GFI Actions', () => {
7587
}),
7688
}),
7789
},
78-
configuration: {
79-
gfi: {
80-
layers: {
81-
layer1: {
82-
maxFeatures: 10,
83-
},
84-
},
85-
mode: 'bboxDot',
86-
maxFeatures: 10,
87-
},
88-
},
90+
configuration,
8991
}
9092
const getters = {
9193
layerKeys: ['layer1'],
9294
geometryLayerKeys: ['layer1'],
9395
afterLoadFunction: null,
96+
gfiConfiguration: configuration.gfi,
9497
}
9598

9699
const context = {
@@ -127,6 +130,17 @@ describe('GFI Actions', () => {
127130
})
128131
it('should handle failed feature request', async () => {
129132
const commit = jest.fn()
133+
const configuration = {
134+
gfi: {
135+
layers: {
136+
layer1: {
137+
maxFeatures: 10,
138+
},
139+
},
140+
mode: 'bboxDot',
141+
maxFeatures: 10,
142+
},
143+
}
130144
const rootGetters = {
131145
map: {
132146
getLayers: () => ({
@@ -138,22 +152,13 @@ describe('GFI Actions', () => {
138152
}),
139153
}),
140154
},
141-
configuration: {
142-
gfi: {
143-
layers: {
144-
layer1: {
145-
maxFeatures: 10,
146-
},
147-
},
148-
mode: 'bboxDot',
149-
maxFeatures: 10,
150-
},
151-
},
155+
configuration,
152156
}
153157
const getters = {
154158
layerKeys: ['layer1'],
155159
geometryLayerKeys: ['layer1'],
156160
afterLoadFunction: null,
161+
gfiConfiguration: configuration.gfi,
157162
}
158163

159164
const context = {

0 commit comments

Comments
 (0)