@@ -53,6 +53,12 @@ describe("find options > order", () => {
53
53
text : "About post #3" ,
54
54
counters : { likes : 1 } ,
55
55
} ,
56
+ {
57
+ id : 4 ,
58
+ title : "Post #4" ,
59
+ text : "About post #4" ,
60
+ counters : { likes : 1 } ,
61
+ } ,
56
62
] )
57
63
58
64
const posts2 = await connection
@@ -82,6 +88,12 @@ describe("find options > order", () => {
82
88
text : "About post #3" ,
83
89
counters : { likes : 1 } ,
84
90
} ,
91
+ {
92
+ id : 4 ,
93
+ title : "Post #4" ,
94
+ text : "About post #4" ,
95
+ counters : { likes : 1 } ,
96
+ } ,
85
97
] )
86
98
87
99
const posts3 = await connection
@@ -111,6 +123,12 @@ describe("find options > order", () => {
111
123
text : "About post #3" ,
112
124
counters : { likes : 1 } ,
113
125
} ,
126
+ {
127
+ id : 4 ,
128
+ title : "Post #4" ,
129
+ text : "About post #4" ,
130
+ counters : { likes : 1 } ,
131
+ } ,
114
132
] )
115
133
116
134
const posts4 = await connection
@@ -142,6 +160,12 @@ describe("find options > order", () => {
142
160
text : "About post #3" ,
143
161
counters : { likes : 1 } ,
144
162
} ,
163
+ {
164
+ id : 4 ,
165
+ title : "Post #4" ,
166
+ text : "About post #4" ,
167
+ counters : { likes : 1 } ,
168
+ } ,
145
169
] )
146
170
147
171
const posts5 = await connection
@@ -153,6 +177,12 @@ describe("find options > order", () => {
153
177
} )
154
178
. getMany ( )
155
179
posts5 . should . be . eql ( [
180
+ {
181
+ id : 4 ,
182
+ title : "Post #4" ,
183
+ text : "About post #4" ,
184
+ counters : { likes : 1 } ,
185
+ } ,
156
186
{
157
187
id : 3 ,
158
188
title : "Post #3" ,
@@ -182,6 +212,12 @@ describe("find options > order", () => {
182
212
} )
183
213
. getMany ( )
184
214
posts6 . should . be . eql ( [
215
+ {
216
+ id : 4 ,
217
+ title : "Post #4" ,
218
+ text : "About post #4" ,
219
+ counters : { likes : 1 } ,
220
+ } ,
185
221
{
186
222
id : 3 ,
187
223
title : "Post #3" ,
@@ -211,6 +247,12 @@ describe("find options > order", () => {
211
247
} )
212
248
. getMany ( )
213
249
posts7 . should . be . eql ( [
250
+ {
251
+ id : 4 ,
252
+ title : "Post #4" ,
253
+ text : "About post #4" ,
254
+ counters : { likes : 1 } ,
255
+ } ,
214
256
{
215
257
id : 3 ,
216
258
title : "Post #3" ,
@@ -242,6 +284,12 @@ describe("find options > order", () => {
242
284
} )
243
285
. getMany ( )
244
286
posts8 . should . be . eql ( [
287
+ {
288
+ id : 4 ,
289
+ title : "Post #4" ,
290
+ text : "About post #4" ,
291
+ counters : { likes : 1 } ,
292
+ } ,
245
293
{
246
294
id : 3 ,
247
295
title : "Post #3" ,
@@ -278,6 +326,12 @@ describe("find options > order", () => {
278
326
} )
279
327
. getMany ( )
280
328
posts . should . be . eql ( [
329
+ {
330
+ id : 4 ,
331
+ title : "Post #4" ,
332
+ text : "About post #4" ,
333
+ counters : { likes : 1 } ,
334
+ } ,
281
335
{
282
336
id : 3 ,
283
337
title : "Post #3" ,
@@ -315,6 +369,12 @@ describe("find options > order", () => {
315
369
} )
316
370
. getMany ( )
317
371
posts . should . be . eql ( [
372
+ {
373
+ id : 4 ,
374
+ title : "Post #4" ,
375
+ text : "About post #4" ,
376
+ counters : { likes : 1 } ,
377
+ } ,
318
378
{
319
379
id : 3 ,
320
380
title : "Post #3" ,
@@ -359,6 +419,12 @@ describe("find options > order", () => {
359
419
text : "About post #3" ,
360
420
counters : { likes : 1 } ,
361
421
} ,
422
+ {
423
+ id : 4 ,
424
+ title : "Post #4" ,
425
+ text : "About post #4" ,
426
+ counters : { likes : 1 } ,
427
+ } ,
362
428
{
363
429
id : 1 ,
364
430
title : "Post #1" ,
@@ -373,8 +439,8 @@ describe("find options > order", () => {
373
439
} ,
374
440
] )
375
441
expect ( posts [ 0 ] . id ) . to . be . eql ( 3 )
376
- expect ( posts [ 1 ] . id ) . to . be . oneOf ( [ 1 , 2 ] )
377
- expect ( posts [ 2 ] . id ) . to . be . oneOf ( [ 1 , 2 ] )
442
+ expect ( posts [ 1 ] . id ) . to . be . oneOf ( [ 1 , 2 , 4 ] )
443
+ expect ( posts [ 2 ] . id ) . to . be . oneOf ( [ 1 , 2 , 4 ] )
378
444
expect ( posts [ 1 ] . id ) . to . not . be . eql ( posts [ 2 ] . id )
379
445
} ) ,
380
446
) )
@@ -413,6 +479,12 @@ describe("find options > order", () => {
413
479
text : "About post #2" ,
414
480
counters : { likes : 2 } ,
415
481
} ,
482
+ {
483
+ id : 4 ,
484
+ title : "Post #4" ,
485
+ text : "About post #4" ,
486
+ counters : { likes : 1 } ,
487
+ } ,
416
488
] )
417
489
} ) ,
418
490
) )
@@ -451,6 +523,12 @@ describe("find options > order", () => {
451
523
text : "About post #2" ,
452
524
counters : { likes : 2 } ,
453
525
} ,
526
+ {
527
+ id : 4 ,
528
+ title : "Post #4" ,
529
+ text : "About post #4" ,
530
+ counters : { likes : 1 } ,
531
+ } ,
454
532
] )
455
533
} ) ,
456
534
) )
@@ -477,6 +555,12 @@ describe("find options > order", () => {
477
555
. getMany ( )
478
556
// exact row order depends of settings like NULLS FIRST and NULLS LAST
479
557
posts . should . have . deep . members ( [
558
+ {
559
+ id : 4 ,
560
+ title : "Post #4" ,
561
+ text : "About post #4" ,
562
+ counters : { likes : 1 } ,
563
+ } ,
480
564
{
481
565
id : 1 ,
482
566
title : "Post #1" ,
@@ -496,9 +580,10 @@ describe("find options > order", () => {
496
580
counters : { likes : 1 } ,
497
581
} ,
498
582
] )
499
- expect ( posts [ 0 ] . id ) . to . be . oneOf ( [ 1 , 3 ] )
583
+ expect ( posts [ 0 ] . id ) . to . be . oneOf ( [ 4 , 3 ] )
500
584
expect ( posts [ 1 ] . id ) . to . be . oneOf ( [ 2 , 1 ] )
501
- expect ( posts [ 2 ] . id ) . to . be . oneOf ( [ 3 , 2 ] )
585
+ expect ( posts [ 2 ] . id ) . to . be . oneOf ( [ 2 , 1 ] )
586
+ expect ( posts [ 3 ] . id ) . to . be . oneOf ( [ 3 , 4 ] )
502
587
} ) ,
503
588
) )
504
589
@@ -537,6 +622,12 @@ describe("find options > order", () => {
537
622
text : "About post #3" ,
538
623
counters : { likes : 1 } ,
539
624
} ,
625
+ {
626
+ id : 4 ,
627
+ title : "Post #4" ,
628
+ text : "About post #4" ,
629
+ counters : { likes : 1 } ,
630
+ } ,
540
631
] )
541
632
} ) ,
542
633
) )
@@ -561,7 +652,7 @@ describe("find options > order", () => {
561
652
} ,
562
653
} )
563
654
. getMany ( )
564
- posts . should . be . eql ( [
655
+ posts . should . have . deep . members ( [
565
656
{
566
657
id : 3 ,
567
658
title : "Post #3" ,
@@ -574,7 +665,17 @@ describe("find options > order", () => {
574
665
text : "About post #1" ,
575
666
counters : { likes : 1 } ,
576
667
} ,
668
+ {
669
+ id : 4 ,
670
+ title : "Post #4" ,
671
+ text : "About post #4" ,
672
+ counters : { likes : 1 } ,
673
+ } ,
577
674
] )
675
+ expect ( posts [ 0 ] . id ) . to . be . eql ( 3 )
676
+ expect ( posts [ 1 ] . id ) . to . be . oneOf ( [ 1 , 4 ] )
677
+ expect ( posts [ 2 ] . id ) . to . be . oneOf ( [ 1 , 4 ] )
678
+ expect ( posts [ 1 ] . id ) . to . not . be . eql ( posts [ 2 ] . id )
578
679
} ) ,
579
680
) )
580
681
} )
0 commit comments