Skip to content

Commit 8a5b4f4

Browse files
committed
chore(aci): add data source mock
1 parent 0420a82 commit 8a5b4f4

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

tests/js/fixtures/detectors.ts

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {DataConditionGroupFixture} from 'sentry-fixture/dataConditions';
22
import {UserFixture} from 'sentry-fixture/user';
33

4+
import type {DataSource} from 'sentry/types/workflowEngine/dataConditions';
45
import type {Detector} from 'sentry/types/workflowEngine/detectors';
56

67
export function DetectorFixture(params: Partial<Detector>): Detector {
@@ -17,19 +18,22 @@ export function DetectorFixture(params: Partial<Detector>): Detector {
1718
type: 'metric',
1819
dataCondition: DataConditionGroupFixture({}),
1920
disabled: false,
20-
dataSource: {
21-
id: '1',
22-
status: 1,
23-
snubaQuery: {
24-
aggregate: '',
25-
dataset: '',
26-
id: '',
27-
query: '',
28-
timeWindow: 60,
29-
...params.dataSource?.snubaQuery,
30-
},
31-
...params.dataSource,
32-
},
21+
dataSource: params.dataSource ?? DetectorDataSource({}),
3322
...params,
3423
};
3524
}
25+
26+
export function DetectorDataSource(params: Partial<DataSource>): DataSource {
27+
return {
28+
id: '1',
29+
status: 1,
30+
snubaQuery: {
31+
aggregate: '',
32+
dataset: '',
33+
id: '',
34+
query: '',
35+
timeWindow: 60,
36+
...params,
37+
},
38+
};
39+
}

0 commit comments

Comments
 (0)