@@ -20,6 +20,11 @@ import OperatorMode from '@cardstack/host/components/operator-mode/container';
20
20
21
21
import OperatorModeStateService from ' @cardstack/host/services/operator-mode-state-service' ;
22
22
23
+ import {
24
+ IncrementalIndexEventContent ,
25
+ IndexRealmEventContent ,
26
+ } from ' https://cardstack.com/base/matrix-event' ;
27
+
23
28
import {
24
29
percySnapshot ,
25
30
testRealmURL ,
@@ -771,7 +776,7 @@ module('Integration | card-copy', function (hooks) {
771
776
expectedNumberOfEvents: 4 ,
772
777
onEvents : (events ) => {
773
778
assert .deepEqual (
774
- events .map ((e ) => e .data . type ),
779
+ events .map ((e : IndexRealmEventContent ) => e .indexType ),
775
780
[
776
781
' incremental-index-initiation' ,
777
782
' incremental' ,
@@ -782,8 +787,10 @@ module('Integration | card-copy', function (hooks) {
782
787
);
783
788
assert .deepEqual (
784
789
flatMap (
785
- events .filter ((e ) => e .data .type === ' incremental' ),
786
- (e ) => e .data .invalidations ,
790
+ events .filter (
791
+ (e : IndexRealmEventContent ) => e .indexType === ' incremental' ,
792
+ ),
793
+ (e : IncrementalIndexEventContent ) => e .invalidations ,
787
794
),
788
795
[savedCards [0 ].data .id , savedCards [1 ].data .id ],
789
796
' event invalidations are correct' ,
@@ -919,10 +926,11 @@ module('Integration | card-copy', function (hooks) {
919
926
realm: realm2 ,
920
927
expectedNumberOfEvents: 2 ,
921
928
onEvents : ([_ , event ]) => {
922
- if (event .data .type === ' incremental' ) {
923
- assert .deepEqual (event .data .invalidations , [
924
- ` ${testRealm2URL }Person/${id } ` ,
925
- ]);
929
+ if (event .eventName === ' index' && event .indexType === ' incremental' ) {
930
+ assert .deepEqual (
931
+ (event as IncrementalIndexEventContent ).invalidations ,
932
+ [` ${testRealm2URL }Person/${id } ` ],
933
+ );
926
934
} else {
927
935
assert .ok (
928
936
false ,
0 commit comments