@@ -52,17 +52,16 @@ describe("qa-bus state", () => {
5252
5353 const snapshot = state . getSnapshot ( ) ;
5454 expect ( snapshot . threads ) . toHaveLength ( 1 ) ;
55- expect ( snapshot . threads [ 0 ] ) . toMatchObject ( {
56- id : thread . id ,
57- conversationId : "qa-room" ,
58- title : "QA thread" ,
59- } ) ;
60- expect ( snapshot . messages [ 0 ] ) . toMatchObject ( {
61- id : message . id ,
62- text : "inside thread (edited)" ,
63- deleted : true ,
64- reactions : [ { emoji : "eyes" , senderId : "alice" } ] ,
65- } ) ;
55+ expect ( snapshot . threads [ 0 ] ?. id ) . toBe ( thread . id ) ;
56+ expect ( snapshot . threads [ 0 ] ?. conversationId ) . toBe ( "qa-room" ) ;
57+ expect ( snapshot . threads [ 0 ] ?. title ) . toBe ( "QA thread" ) ;
58+ expect ( snapshot . messages [ 0 ] ?. id ) . toBe ( message . id ) ;
59+ expect ( snapshot . messages [ 0 ] ?. text ) . toBe ( "inside thread (edited)" ) ;
60+ expect ( snapshot . messages [ 0 ] ?. deleted ) . toBe ( true ) ;
61+ expect ( snapshot . messages [ 0 ] ?. reactions ) . toHaveLength ( 1 ) ;
62+ expect ( snapshot . messages [ 0 ] ?. reactions [ 0 ] ?. emoji ) . toBe ( "eyes" ) ;
63+ expect ( snapshot . messages [ 0 ] ?. reactions [ 0 ] ?. senderId ) . toBe ( "alice" ) ;
64+ expect ( snapshot . messages [ 0 ] ?. reactions [ 0 ] ?. timestamp ) . toEqual ( expect . any ( Number ) ) ;
6665 } ) ;
6766
6867 it ( "waits for a text match and rejects on timeout" , async ( ) => {
@@ -156,11 +155,10 @@ describe("qa-bus state", () => {
156155
157156 const readback = state . readMessage ( { messageId : outbound . id } ) ;
158157 expect ( readback . attachments ) . toHaveLength ( 1 ) ;
159- expect ( readback . attachments ?. [ 0 ] ) . toMatchObject ( {
160- kind : "image" ,
161- fileName : "qa-screenshot.png" ,
162- altText : "QA dashboard screenshot" ,
163- } ) ;
158+ const attachment = readback . attachments ?. [ 0 ] ;
159+ expect ( attachment ?. kind ) . toBe ( "image" ) ;
160+ expect ( attachment ?. fileName ) . toBe ( "qa-screenshot.png" ) ;
161+ expect ( attachment ?. altText ) . toBe ( "QA dashboard screenshot" ) ;
164162
165163 const byFilename = state . searchMessages ( {
166164 query : "screenshot" ,
0 commit comments