Skip to content

Commit 4d50a3a

Browse files
committed
fix react hook tests
1 parent d8da3dd commit 4d50a3a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/react-optimistic/tests/useLiveQuery.test.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,14 @@ describe(`Query Collections`, () => {
121121

122122
expect(result.current.state.size).toBe(1)
123123
expect(result.current.state.get(`3`)).toEqual({
124+
_orderByIndex: 0,
124125
id: `3`,
125126
name: `John Smith`,
126127
})
127128

128129
expect(result.current.data.length).toBe(1)
129130
expect(result.current.data[0]).toEqual({
131+
_orderByIndex: 0,
130132
id: `3`,
131133
name: `John Smith`,
132134
})
@@ -152,20 +154,24 @@ describe(`Query Collections`, () => {
152154

153155
expect(result.current.state.size).toBe(2)
154156
expect(result.current.state.get(`3`)).toEqual({
157+
_orderByIndex: 0,
155158
id: `3`,
156159
name: `John Smith`,
157160
})
158161
expect(result.current.state.get(`4`)).toEqual({
162+
_orderByIndex: 1,
159163
id: `4`,
160164
name: `Kyle Doe`,
161165
})
162166

163167
expect(result.current.data.length).toBe(2)
164168
expect(result.current.data).toContainEqual({
169+
_orderByIndex: 0,
165170
id: `3`,
166171
name: `John Smith`,
167172
})
168173
expect(result.current.data).toContainEqual({
174+
_orderByIndex: 1,
169175
id: `4`,
170176
name: `Kyle Doe`,
171177
})
@@ -187,12 +193,14 @@ describe(`Query Collections`, () => {
187193

188194
expect(result.current.state.size).toBe(2)
189195
expect(result.current.state.get(`4`)).toEqual({
196+
_orderByIndex: 1,
190197
id: `4`,
191198
name: `Kyle Doe 2`,
192199
})
193200

194201
expect(result.current.data.length).toBe(2)
195202
expect(result.current.data).toContainEqual({
203+
_orderByIndex: 1,
196204
id: `4`,
197205
name: `Kyle Doe 2`,
198206
})
@@ -214,6 +222,7 @@ describe(`Query Collections`, () => {
214222

215223
expect(result.current.data.length).toBe(1)
216224
expect(result.current.data).toContainEqual({
225+
_orderByIndex: 0,
217226
id: `3`,
218227
name: `John Smith`,
219228
})

0 commit comments

Comments
 (0)