File tree 1 file changed +17
-13
lines changed
1 file changed +17
-13
lines changed Original file line number Diff line number Diff line change 1
1
import { DataConditionGroupFixture } from 'sentry-fixture/dataConditions' ;
2
2
import { UserFixture } from 'sentry-fixture/user' ;
3
3
4
+ import type { DataSource } from 'sentry/types/workflowEngine/dataConditions' ;
4
5
import type { Detector } from 'sentry/types/workflowEngine/detectors' ;
5
6
6
7
export function DetectorFixture ( params : Partial < Detector > ) : Detector {
@@ -17,19 +18,22 @@ export function DetectorFixture(params: Partial<Detector>): Detector {
17
18
type : 'metric' ,
18
19
dataCondition : DataConditionGroupFixture ( { } ) ,
19
20
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 ( { } ) ,
33
22
...params ,
34
23
} ;
35
24
}
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
+ }
You can’t perform that action at this time.
0 commit comments