@@ -13,7 +13,6 @@ import type {CodingAgentIntegration} from 'sentry/components/events/autofix/useA
1313import { ProjectsStore } from 'sentry/stores/projectsStore' ;
1414import { useQueryClient } from 'sentry/utils/queryClient' ;
1515import {
16- useAgentOptions ,
1716 useBulkMutateCreatePr ,
1817 useMutateCreatePr ,
1918 useMutateSelectedAgent ,
@@ -35,65 +34,31 @@ describe('seerAgentHooks', () => {
3534 ProjectsStore . reset ( ) ;
3635 } ) ;
3736
38- describe ( 'useAgentOptions' , ( ) => {
39- it ( 'returns Seer, integration options' , ( ) => {
40- const integrations : CodingAgentIntegration [ ] = [
41- { id : '42' , name : 'Cursor' , provider : 'cursor' } ,
42- ] ;
43-
44- const { result} = renderHookWithProviders ( useAgentOptions , {
45- initialProps : { integrations} ,
46- organization,
47- } ) ;
48-
49- const options = result . current ;
50- expect ( options ) . toHaveLength ( 3 ) ;
51- expect ( options [ 0 ] ) . toEqual ( { value : 'seer' , label : expect . any ( String ) } ) ;
52- expect ( options [ 1 ] ) . toMatchObject ( {
53- value : { id : '42' , name : 'Cursor' , provider : 'cursor' } ,
54- label : 'Cursor' ,
55- } ) ;
56- expect ( options [ 2 ] ) . toEqual ( { value : 'none' , label : 'No Handoff' } ) ;
57- } ) ;
58-
59- it ( 'filters out integrations without id' , ( ) => {
60- const integrations : CodingAgentIntegration [ ] = [
61- { id : null , name : 'No Id' , provider : 'other' } ,
62- { id : '1' , name : 'With Id' , provider : 'cursor' } ,
63- ] ;
64-
65- const { result} = renderHookWithProviders ( useAgentOptions , {
66- initialProps : { integrations} ,
67- organization,
68- } ) ;
69-
70- const options = result . current ;
71- expect ( options ) . toHaveLength ( 3 ) ;
72- expect ( options [ 1 ] ! . value ) . toMatchObject ( { id : '1' , name : 'With Id' } ) ;
73- } ) ;
74- } ) ;
75-
7637 describe ( 'useSelectedAgentFromProjectSettings' , ( ) => {
77- it ( 'returns "none" when project autofixAutomationTuning is off' , ( ) => {
78- const p = ProjectFixture ( { ...project , autofixAutomationTuning : 'off' } ) ;
79-
38+ it ( 'returns "seer" when no automation_handoff integration_id' , ( ) => {
8039 const { result} = renderHookWithProviders ( useSelectedAgentFromProjectSettings , {
8140 initialProps : {
82- preference : { repositories : [ ] } ,
83- project : p ,
41+ preference : {
42+ repositories : [ ] ,
43+ } ,
8444 integrations : [ ] ,
8545 } ,
8646 organization,
8747 } ) ;
8848
89- expect ( result . current ) . toBe ( 'none ' ) ;
49+ expect ( result . current ) . toBe ( 'seer ' ) ;
9050 } ) ;
9151
92- it ( 'returns "seer" when no automation_handoff integration_id' , ( ) => {
52+ it ( 'returns "seer" when no automation_handoff integration_id, ignoring autofixAutomationTuning ' , ( ) => {
9353 const { result} = renderHookWithProviders ( useSelectedAgentFromProjectSettings , {
9454 initialProps : {
95- preference : { repositories : [ ] } ,
96- project,
55+ preference : {
56+ projectId : '1' ,
57+ autofixAutomationTuning : 'off' ,
58+ automatedRunStoppingPoint : 'code_changes' ,
59+ automation_handoff : undefined ,
60+ repositories : [ ] ,
61+ } ,
9762 integrations : [ ] ,
9863 } ,
9964 organization,
@@ -117,7 +82,6 @@ describe('seerAgentHooks', () => {
11782 integration_id : 99 ,
11883 } ,
11984 } ,
120- project,
12185 integrations,
12286 } ,
12387 organization,
@@ -128,7 +92,7 @@ describe('seerAgentHooks', () => {
12892 } ) ;
12993
13094 describe ( 'useSelectedAgentFromBulkSettings' , ( ) => {
131- it ( 'returns "none " when autofixAutomationTuning is off ' , ( ) => {
95+ it ( 'returns "seer " when automationHandoff undefined, doesnt look at autofixAutomationTuning ' , ( ) => {
13296 const { result} = renderHookWithProviders ( useSelectedAgentFromBulkSettings , {
13397 initialProps : {
13498 autofixSettings : {
@@ -143,7 +107,7 @@ describe('seerAgentHooks', () => {
143107 organization,
144108 } ) ;
145109
146- expect ( result . current ) . toBe ( 'none ' ) ;
110+ expect ( result . current ) . toBe ( 'seer ' ) ;
147111 } ) ;
148112
149113 it ( 'returns "seer" when no automationHandoff integration_id' , ( ) => {
0 commit comments