@@ -62,13 +62,13 @@ describe('Edge Cases & Error Paths', () => {
6262 ) . rejects . toThrow ( 'not found' ) ;
6363 } ) ;
6464
65- it ( 'claim rejects already-claimed intent' , async ( ) => {
65+ it ( 'claim rejects already-claimed intent with claimer info ' , async ( ) => {
6666 const intent = await seedOpenIntent ( ) ;
6767 await db . claimWork ( { intent_id : intent . id as string , claimed_by : 'pawel' } ) ;
6868
6969 await expect (
7070 db . claimWork ( { intent_id : intent . id as string , claimed_by : 'alice' } )
71- ) . rejects . toThrow ( 'not open ' ) ;
71+ ) . rejects . toThrow ( 'claimed by pawel ' ) ;
7272 } ) ;
7373
7474 it ( 'claim rejects done intent' , async ( ) => {
@@ -90,15 +90,15 @@ describe('Edge Cases & Error Paths', () => {
9090 const { claim } = await db . claimWork ( { intent_id : intent . id as string , claimed_by : 'pawel' } ) ;
9191 await db . completeClaim ( claim . id ) ;
9292
93- await expect ( db . completeClaim ( claim . id ) ) . rejects . toThrow ( 'not active ' ) ;
93+ await expect ( db . completeClaim ( claim . id ) ) . rejects . toThrow ( 'completed ' ) ;
9494 } ) ;
9595
9696 it ( 'complete rejects abandoned claim' , async ( ) => {
9797 const intent = await seedOpenIntent ( ) ;
9898 const { claim } = await db . claimWork ( { intent_id : intent . id as string , claimed_by : 'pawel' } ) ;
9999 await db . releaseClaim ( claim . id ) ;
100100
101- await expect ( db . completeClaim ( claim . id ) ) . rejects . toThrow ( 'not active ' ) ;
101+ await expect ( db . completeClaim ( claim . id ) ) . rejects . toThrow ( 'abandoned ' ) ;
102102 } ) ;
103103
104104 it ( 'release rejects non-existent claim' , async ( ) => {
@@ -109,12 +109,12 @@ describe('Edge Cases & Error Paths', () => {
109109 await expect ( db . heartbeat ( 'claim_nonexistent' ) ) . rejects . toThrow ( 'not found' ) ;
110110 } ) ;
111111
112- it ( 'heartbeat rejects completed claim' , async ( ) => {
112+ it ( 'heartbeat rejects completed claim with status ' , async ( ) => {
113113 const intent = await seedOpenIntent ( ) ;
114114 const { claim } = await db . claimWork ( { intent_id : intent . id as string , claimed_by : 'pawel' } ) ;
115115 await db . completeClaim ( claim . id ) ;
116116
117- await expect ( db . heartbeat ( claim . id ) ) . rejects . toThrow ( 'not found ' ) ;
117+ await expect ( db . heartbeat ( claim . id ) ) . rejects . toThrow ( 'completed ' ) ;
118118 } ) ;
119119
120120 // ─── Conflict Edge Cases ────────────────────────
0 commit comments