@@ -86,6 +86,22 @@ describe('ProjectSeer', () => {
8686 external_id : '101' ,
8787 } ,
8888 ] ,
89+ preference : {
90+ repositories : [
91+ {
92+ organization_id : 3 ,
93+ external_id : '101' ,
94+ name : 'sentry' ,
95+ owner : 'getsentry' ,
96+ provider : 'github' ,
97+ integration_id : '201' ,
98+ branch_name : '' ,
99+ instructions : '' ,
100+ branch_overrides : [ ] ,
101+ } ,
102+ ] ,
103+ automated_run_stopping_point : 'root_cause' ,
104+ } ,
89105 } ;
90106
91107 MockApiClient . addMockResponse ( {
@@ -124,7 +140,9 @@ describe('ProjectSeer', () => {
124140 expect ( screen . queryByText ( 'getsentry/seer' ) ) . not . toBeInTheDocument ( ) ;
125141
126142 // Open the add repo modal
127- await userEvent . click ( screen . getByRole ( 'button' , { name : 'Add Repos' } ) ) ;
143+ await userEvent . click (
144+ screen . getByRole ( 'button' , { name : 'Add Repositories to Project' } )
145+ ) ;
128146
129147 // Find and select the unselected repo in the modal
130148 const modal = await screen . findByRole ( 'dialog' ) ;
@@ -151,6 +169,33 @@ describe('ProjectSeer', () => {
151169 external_id : '102' ,
152170 } ,
153171 ] ,
172+ preference : {
173+ repositories : [
174+ {
175+ organization_id : 3 ,
176+ external_id : '101' ,
177+ name : 'sentry' ,
178+ owner : 'getsentry' ,
179+ provider : 'github' ,
180+ integration_id : '201' ,
181+ branch_name : '' ,
182+ instructions : '' ,
183+ branch_overrides : [ ] ,
184+ } ,
185+ {
186+ organization_id : 3 ,
187+ external_id : '102' ,
188+ name : 'seer' ,
189+ owner : 'getsentry' ,
190+ provider : 'github' ,
191+ integration_id : '202' ,
192+ branch_name : '' ,
193+ instructions : '' ,
194+ branch_overrides : [ ] ,
195+ } ,
196+ ] ,
197+ automated_run_stopping_point : 'root_cause' ,
198+ } ,
154199 } ,
155200 } ) ;
156201
@@ -170,28 +215,18 @@ describe('ProjectSeer', () => {
170215 data : expect . objectContaining ( {
171216 automated_run_stopping_point : 'root_cause' ,
172217 repositories : [
173- {
174- organization_id : 3 ,
175- branch_name : '' ,
218+ expect . objectContaining ( {
176219 external_id : '101' ,
177- instructions : '' ,
178220 name : 'sentry' ,
179221 owner : 'getsentry' ,
180222 provider : 'github' ,
181- integration_id : '201' ,
182- branch_overrides : [ ] ,
183- } ,
184- {
185- organization_id : 3 ,
186- branch_name : '' ,
223+ } ) ,
224+ expect . objectContaining ( {
187225 external_id : '102' ,
188- instructions : '' ,
189226 name : 'seer' ,
190227 owner : 'getsentry' ,
191228 provider : 'github' ,
192- integration_id : '202' ,
193- branch_overrides : [ ] ,
194- } ,
229+ } ) ,
195230 ] ,
196231 } ) ,
197232 } )
@@ -217,16 +252,9 @@ describe('ProjectSeer', () => {
217252 // Expand the repo item
218253 await userEvent . click ( repoItem ) ;
219254
220- // Find input fields
255+ // Find input field and type a branch name (auto-saves via debounce)
221256 const branchInput = screen . getByPlaceholderText ( 'Default branch' ) ;
222- const instructionsInput = screen . getByPlaceholderText (
223- 'Add any general context or instructions to help Seer understand this repository...'
224- ) ;
225-
226257 await userEvent . type ( branchInput , 'develop' ) ;
227- await userEvent . type ( instructionsInput , 'Use Conventional Commits' ) ;
228-
229- await userEvent . click ( screen . getByRole ( 'button' , { name : 'Save' } ) ) ;
230258
231259 await waitFor ( ( ) => {
232260 expect ( seerPreferencesPostRequest ) . toHaveBeenCalledWith (
@@ -235,23 +263,15 @@ describe('ProjectSeer', () => {
235263 data : expect . objectContaining ( {
236264 automated_run_stopping_point : 'root_cause' ,
237265 repositories : [
238- {
239- organization_id : 3 ,
266+ expect . objectContaining ( {
240267 external_id : '101' ,
241- name : 'sentry' ,
242- owner : 'getsentry' ,
243- provider : 'github' ,
244268 branch_name : 'develop' ,
245- instructions : 'Use Conventional Commits' ,
246- integration_id : '201' ,
247- branch_overrides : [ ] ,
248- } ,
269+ } ) ,
249270 ] ,
250271 } ) ,
251272 } )
252273 ) ;
253274 } ) ;
254- expect ( seerPreferencesPostRequest ) . toHaveBeenCalledTimes ( 1 ) ;
255275 } ) ;
256276
257277 it ( 'can remove a repository' , async ( ) => {
@@ -277,10 +297,14 @@ describe('ProjectSeer', () => {
277297 method : 'GET' ,
278298 body : {
279299 code_mapping_repos : [ ] ,
300+ preference : {
301+ repositories : [ ] ,
302+ automated_run_stopping_point : 'root_cause' ,
303+ } ,
280304 } ,
281305 } ) ;
282306
283- await userEvent . click ( screen . getByRole ( 'button' , { name : 'Remove Repository' } ) ) ;
307+ await userEvent . click ( screen . getByRole ( 'button' , { name : 'Disconnect Repository' } ) ) ;
284308
285309 await userEvent . click ( await screen . findByRole ( 'button' , { name : 'Confirm' } ) ) ;
286310
@@ -1320,11 +1344,13 @@ describe('ProjectSeer', () => {
13201344 } ) ;
13211345 renderGlobalModal ( { organization : orgWithGitlabSupport } ) ;
13221346
1323- // Wait for repos to load (sentry is pre-selected via code_mapping_repos in beforeEach)
1347+ // Wait for repos to load (sentry is pre-selected via preference.repositories in beforeEach)
13241348 expect ( await screen . findByText ( 'getsentry/sentry' ) ) . toBeInTheDocument ( ) ;
13251349
13261350 // Open the add repo modal — it shows only unselected repos
1327- await userEvent . click ( screen . getByRole ( 'button' , { name : 'Add Repos' } ) ) ;
1351+ await userEvent . click (
1352+ screen . getByRole ( 'button' , { name : 'Add Repositories to Project' } )
1353+ ) ;
13281354
13291355 const modal = await screen . findByRole ( 'dialog' ) ;
13301356
@@ -1354,11 +1380,13 @@ describe('ProjectSeer', () => {
13541380 } ) ;
13551381 renderGlobalModal ( ) ;
13561382
1357- // Wait for repos to load (sentry is pre-selected via code_mapping_repos in beforeEach)
1383+ // Wait for repos to load (sentry is pre-selected via preference.repositories in beforeEach)
13581384 expect ( await screen . findByText ( 'getsentry/sentry' ) ) . toBeInTheDocument ( ) ;
13591385
13601386 // Open the add repo modal — it shows only unselected repos
1361- await userEvent . click ( screen . getByRole ( 'button' , { name : 'Add Repos' } ) ) ;
1387+ await userEvent . click (
1388+ screen . getByRole ( 'button' , { name : 'Add Repositories to Project' } )
1389+ ) ;
13621390
13631391 const modal = await screen . findByRole ( 'dialog' ) ;
13641392
0 commit comments