Skip to content

Commit e5fced8

Browse files
chore(test): add test for group in measures
1 parent 8943469 commit e5fced8

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

tests/scenario/migrated/measure-ingestion-pipeline.test.ts

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,7 @@ describe('features/Measure/IngestionPipeline', () => {
126126
});
127127

128128
it('Should enrich measure with the origin device metadata', async () => {
129-
const metadata = {
130-
color: 'blue',
131-
};
129+
const metadata = { color: 'blue' };
132130

133131
await sdk.query({
134132
controller: 'device-manager/devices',
@@ -186,4 +184,24 @@ describe('features/Measure/IngestionPipeline', () => {
186184
],
187185
});
188186
});
187+
188+
it('Should enrich measure with the origin device groups', async () => {
189+
await sendPayloads(sdk, 'dummy-temp-position', [
190+
{ deviceEUI: 'linked2', temperature: 35, location: { lon: 12, lat: 12 } },
191+
]);
192+
193+
await sdk.collection.refresh('engine-ayse', 'measures');
194+
195+
const response = await sdk.query({
196+
controller: 'document',
197+
action: 'search',
198+
index: 'engine-ayse',
199+
collection: 'measures',
200+
body: { query: { term: { 'origin.reference': 'linked2' } } },
201+
});
202+
203+
expect(response.result.hits[0]._source.origin.groups[0]).toMatchObject({
204+
path: 'test-parent-asset',
205+
});
206+
});
189207
});

0 commit comments

Comments
 (0)