@@ -46,7 +46,7 @@ describe("SlidingSyncManager", () => {
46
46
mocked ( slidingSync . getRoomSubscriptions ) . mockReturnValue ( subs ) ;
47
47
mocked ( slidingSync . modifyRoomSubscriptions ) . mockResolvedValue ( "yep" ) ;
48
48
await manager . setRoomVisible ( roomId , true ) ;
49
- expect ( slidingSync . modifyRoomSubscriptions ) . toBeCalledWith ( new Set < string > ( [ roomId ] ) ) ;
49
+ expect ( slidingSync . modifyRoomSubscriptions ) . toHaveBeenCalledWith ( new Set < string > ( [ roomId ] ) ) ;
50
50
} ) ;
51
51
it ( "adds a custom subscription for a lazy-loadable room" , async ( ) => {
52
52
const roomId = "!lazy:id" ;
@@ -72,9 +72,9 @@ describe("SlidingSyncManager", () => {
72
72
mocked ( slidingSync . getRoomSubscriptions ) . mockReturnValue ( subs ) ;
73
73
mocked ( slidingSync . modifyRoomSubscriptions ) . mockResolvedValue ( "yep" ) ;
74
74
await manager . setRoomVisible ( roomId , true ) ;
75
- expect ( slidingSync . modifyRoomSubscriptions ) . toBeCalledWith ( new Set < string > ( [ roomId ] ) ) ;
75
+ expect ( slidingSync . modifyRoomSubscriptions ) . toHaveBeenCalledWith ( new Set < string > ( [ roomId ] ) ) ;
76
76
// we aren't prescriptive about what the sub name is.
77
- expect ( slidingSync . useCustomSubscription ) . toBeCalledWith ( roomId , expect . anything ( ) ) ;
77
+ expect ( slidingSync . useCustomSubscription ) . toHaveBeenCalledWith ( roomId , expect . anything ( ) ) ;
78
78
} ) ;
79
79
} ) ;
80
80
@@ -86,7 +86,7 @@ describe("SlidingSyncManager", () => {
86
86
await manager . ensureListRegistered ( listKey , {
87
87
sort : [ "by_recency" ] ,
88
88
} ) ;
89
- expect ( slidingSync . setList ) . toBeCalledWith (
89
+ expect ( slidingSync . setList ) . toHaveBeenCalledWith (
90
90
listKey ,
91
91
expect . objectContaining ( {
92
92
sort : [ "by_recency" ] ,
@@ -103,7 +103,7 @@ describe("SlidingSyncManager", () => {
103
103
await manager . ensureListRegistered ( listKey , {
104
104
sort : [ "by_recency" ] ,
105
105
} ) ;
106
- expect ( slidingSync . setList ) . toBeCalledWith (
106
+ expect ( slidingSync . setList ) . toHaveBeenCalledWith (
107
107
listKey ,
108
108
expect . objectContaining ( {
109
109
sort : [ "by_recency" ] ,
@@ -121,8 +121,8 @@ describe("SlidingSyncManager", () => {
121
121
await manager . ensureListRegistered ( listKey , {
122
122
ranges : [ [ 0 , 52 ] ] ,
123
123
} ) ;
124
- expect ( slidingSync . setList ) . not . toBeCalled ( ) ;
125
- expect ( slidingSync . setListRanges ) . toBeCalledWith ( listKey , [ [ 0 , 52 ] ] ) ;
124
+ expect ( slidingSync . setList ) . not . toHaveBeenCalled ( ) ;
125
+ expect ( slidingSync . setListRanges ) . toHaveBeenCalledWith ( listKey , [ [ 0 , 52 ] ] ) ;
126
126
} ) ;
127
127
128
128
it ( "no-ops for idential changes" , async ( ) => {
@@ -136,8 +136,8 @@ describe("SlidingSyncManager", () => {
136
136
ranges : [ [ 0 , 42 ] ] ,
137
137
sort : [ "by_recency" ] ,
138
138
} ) ;
139
- expect ( slidingSync . setList ) . not . toBeCalled ( ) ;
140
- expect ( slidingSync . setListRanges ) . not . toBeCalled ( ) ;
139
+ expect ( slidingSync . setList ) . not . toHaveBeenCalled ( ) ;
140
+ expect ( slidingSync . setListRanges ) . not . toHaveBeenCalled ( ) ;
141
141
} ) ;
142
142
} ) ;
143
143
@@ -163,20 +163,20 @@ describe("SlidingSyncManager", () => {
163
163
[ 50 , 59 ] ,
164
164
[ 60 , 69 ] ,
165
165
] ;
166
- expect ( slidingSync . getListData ) . toBeCalledTimes ( wantWindows . length ) ;
167
- expect ( slidingSync . setList ) . toBeCalledTimes ( 1 ) ;
168
- expect ( slidingSync . setListRanges ) . toBeCalledTimes ( wantWindows . length - 1 ) ;
166
+ expect ( slidingSync . getListData ) . toHaveBeenCalledTimes ( wantWindows . length ) ;
167
+ expect ( slidingSync . setList ) . toHaveBeenCalledTimes ( 1 ) ;
168
+ expect ( slidingSync . setListRanges ) . toHaveBeenCalledTimes ( wantWindows . length - 1 ) ;
169
169
wantWindows . forEach ( ( range , i ) => {
170
170
if ( i === 0 ) {
171
- expect ( slidingSync . setList ) . toBeCalledWith (
171
+ expect ( slidingSync . setList ) . toHaveBeenCalledWith (
172
172
SlidingSyncManager . ListSearch ,
173
173
expect . objectContaining ( {
174
174
ranges : [ [ 0 , batchSize - 1 ] , range ] ,
175
175
} ) ,
176
176
) ;
177
177
return ;
178
178
}
179
- expect ( slidingSync . setListRanges ) . toBeCalledWith ( SlidingSyncManager . ListSearch , [
179
+ expect ( slidingSync . setListRanges ) . toHaveBeenCalledWith ( SlidingSyncManager . ListSearch , [
180
180
[ 0 , batchSize - 1 ] ,
181
181
range ,
182
182
] ) ;
@@ -193,9 +193,9 @@ describe("SlidingSyncManager", () => {
193
193
} ;
194
194
} ) ;
195
195
await manager . startSpidering ( batchSize , gapMs ) ;
196
- expect ( slidingSync . getListData ) . toBeCalledTimes ( 1 ) ;
197
- expect ( slidingSync . setList ) . toBeCalledTimes ( 1 ) ;
198
- expect ( slidingSync . setList ) . toBeCalledWith (
196
+ expect ( slidingSync . getListData ) . toHaveBeenCalledTimes ( 1 ) ;
197
+ expect ( slidingSync . setList ) . toHaveBeenCalledTimes ( 1 ) ;
198
+ expect ( slidingSync . setList ) . toHaveBeenCalledWith (
199
199
SlidingSyncManager . ListSearch ,
200
200
expect . objectContaining ( {
201
201
ranges : [
@@ -216,9 +216,9 @@ describe("SlidingSyncManager", () => {
216
216
} ;
217
217
} ) ;
218
218
await manager . startSpidering ( batchSize , gapMs ) ;
219
- expect ( slidingSync . getListData ) . toBeCalledTimes ( 1 ) ;
220
- expect ( slidingSync . setList ) . toBeCalledTimes ( 1 ) ;
221
- expect ( slidingSync . setList ) . toBeCalledWith (
219
+ expect ( slidingSync . getListData ) . toHaveBeenCalledTimes ( 1 ) ;
220
+ expect ( slidingSync . setList ) . toHaveBeenCalledTimes ( 1 ) ;
221
+ expect ( slidingSync . setList ) . toHaveBeenCalledWith (
222
222
SlidingSyncManager . ListSearch ,
223
223
expect . objectContaining ( {
224
224
ranges : [
0 commit comments