Skip to content

Commit ffb16f8

Browse files
Update Spec tests (#3364)
1 parent 008ba49 commit ffb16f8

File tree

6 files changed

+36940
-293
lines changed

6 files changed

+36940
-293
lines changed

Firestore/Example/Tests/SpecTests/json/limbo_spec_test.json

Lines changed: 366 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3431,5 +3431,371 @@
34313431
"clientIndex": 0
34323432
}
34333433
]
3434+
},
3435+
"Limbo documents stay consistent between views": {
3436+
"describeName": "Limbo Documents:",
3437+
"itName": "Limbo documents stay consistent between views",
3438+
"tags": [],
3439+
"config": {
3440+
"useGarbageCollection": false,
3441+
"numClients": 1
3442+
},
3443+
"steps": [
3444+
{
3445+
"userSet": [
3446+
"collection/a",
3447+
{
3448+
"matches": true
3449+
}
3450+
]
3451+
},
3452+
{
3453+
"userSet": [
3454+
"collection/b",
3455+
{
3456+
"matches": true
3457+
}
3458+
]
3459+
},
3460+
{
3461+
"writeAck": {
3462+
"version": 1000
3463+
},
3464+
"stateExpect": {
3465+
"userCallbacks": {
3466+
"acknowledgedDocs": [
3467+
"collection/a"
3468+
],
3469+
"rejectedDocs": []
3470+
}
3471+
}
3472+
},
3473+
{
3474+
"writeAck": {
3475+
"version": 1001
3476+
},
3477+
"stateExpect": {
3478+
"userCallbacks": {
3479+
"acknowledgedDocs": [
3480+
"collection/b"
3481+
],
3482+
"rejectedDocs": []
3483+
}
3484+
}
3485+
},
3486+
{
3487+
"userListen": [
3488+
2,
3489+
{
3490+
"path": "collection",
3491+
"filters": [],
3492+
"orderBys": []
3493+
}
3494+
],
3495+
"stateExpect": {
3496+
"activeTargets": {
3497+
"2": {
3498+
"query": {
3499+
"path": "collection",
3500+
"filters": [],
3501+
"orderBys": []
3502+
},
3503+
"resumeToken": ""
3504+
}
3505+
}
3506+
},
3507+
"expect": [
3508+
{
3509+
"query": {
3510+
"path": "collection",
3511+
"filters": [],
3512+
"orderBys": []
3513+
},
3514+
"added": [
3515+
{
3516+
"key": "collection/a",
3517+
"version": 1000,
3518+
"value": {
3519+
"matches": true
3520+
},
3521+
"options": {
3522+
"hasLocalMutations": false,
3523+
"hasCommittedMutations": true
3524+
}
3525+
},
3526+
{
3527+
"key": "collection/b",
3528+
"version": 1001,
3529+
"value": {
3530+
"matches": true
3531+
},
3532+
"options": {
3533+
"hasLocalMutations": false,
3534+
"hasCommittedMutations": true
3535+
}
3536+
}
3537+
],
3538+
"errorCode": 0,
3539+
"fromCache": true,
3540+
"hasPendingWrites": false
3541+
}
3542+
]
3543+
},
3544+
{
3545+
"watchAck": [
3546+
2
3547+
]
3548+
},
3549+
{
3550+
"watchEntity": {
3551+
"docs": [
3552+
{
3553+
"key": "collection/a",
3554+
"version": 1000,
3555+
"value": {
3556+
"matches": true
3557+
},
3558+
"options": {
3559+
"hasLocalMutations": false,
3560+
"hasCommittedMutations": false
3561+
}
3562+
}
3563+
],
3564+
"targets": [
3565+
2
3566+
]
3567+
}
3568+
},
3569+
{
3570+
"watchCurrent": [
3571+
[
3572+
2
3573+
],
3574+
"resume-token-2000"
3575+
]
3576+
},
3577+
{
3578+
"watchSnapshot": {
3579+
"version": 2000,
3580+
"targetIds": []
3581+
},
3582+
"stateExpect": {
3583+
"limboDocs": [
3584+
"collection/b"
3585+
],
3586+
"activeTargets": {
3587+
"1": {
3588+
"query": {
3589+
"path": "collection/b",
3590+
"filters": [],
3591+
"orderBys": []
3592+
},
3593+
"resumeToken": ""
3594+
},
3595+
"2": {
3596+
"query": {
3597+
"path": "collection",
3598+
"filters": [],
3599+
"orderBys": []
3600+
},
3601+
"resumeToken": ""
3602+
}
3603+
}
3604+
}
3605+
},
3606+
{
3607+
"userListen": [
3608+
4,
3609+
{
3610+
"path": "collection",
3611+
"filters": [
3612+
[
3613+
"matches",
3614+
"==",
3615+
true
3616+
]
3617+
],
3618+
"orderBys": []
3619+
}
3620+
],
3621+
"stateExpect": {
3622+
"activeTargets": {
3623+
"1": {
3624+
"query": {
3625+
"path": "collection/b",
3626+
"filters": [],
3627+
"orderBys": []
3628+
},
3629+
"resumeToken": ""
3630+
},
3631+
"2": {
3632+
"query": {
3633+
"path": "collection",
3634+
"filters": [],
3635+
"orderBys": []
3636+
},
3637+
"resumeToken": ""
3638+
},
3639+
"4": {
3640+
"query": {
3641+
"path": "collection",
3642+
"filters": [
3643+
[
3644+
"matches",
3645+
"==",
3646+
true
3647+
]
3648+
],
3649+
"orderBys": []
3650+
},
3651+
"resumeToken": ""
3652+
}
3653+
}
3654+
},
3655+
"expect": [
3656+
{
3657+
"query": {
3658+
"path": "collection",
3659+
"filters": [
3660+
[
3661+
"matches",
3662+
"==",
3663+
true
3664+
]
3665+
],
3666+
"orderBys": []
3667+
},
3668+
"added": [
3669+
{
3670+
"key": "collection/a",
3671+
"version": 1000,
3672+
"value": {
3673+
"matches": true
3674+
},
3675+
"options": {
3676+
"hasLocalMutations": false,
3677+
"hasCommittedMutations": false
3678+
}
3679+
},
3680+
{
3681+
"key": "collection/b",
3682+
"version": 1001,
3683+
"value": {
3684+
"matches": true
3685+
},
3686+
"options": {
3687+
"hasLocalMutations": false,
3688+
"hasCommittedMutations": true
3689+
}
3690+
}
3691+
],
3692+
"errorCode": 0,
3693+
"fromCache": true,
3694+
"hasPendingWrites": false
3695+
}
3696+
]
3697+
},
3698+
{
3699+
"userUnlisten": [
3700+
2,
3701+
{
3702+
"path": "collection",
3703+
"filters": [],
3704+
"orderBys": []
3705+
}
3706+
],
3707+
"stateExpect": {
3708+
"activeTargets": {
3709+
"4": {
3710+
"query": {
3711+
"path": "collection",
3712+
"filters": [
3713+
[
3714+
"matches",
3715+
"==",
3716+
true
3717+
]
3718+
],
3719+
"orderBys": []
3720+
},
3721+
"resumeToken": ""
3722+
}
3723+
},
3724+
"limboDocs": []
3725+
}
3726+
},
3727+
{
3728+
"userListen": [
3729+
2,
3730+
{
3731+
"path": "collection",
3732+
"filters": [],
3733+
"orderBys": []
3734+
}
3735+
],
3736+
"stateExpect": {
3737+
"activeTargets": {
3738+
"2": {
3739+
"query": {
3740+
"path": "collection",
3741+
"filters": [],
3742+
"orderBys": []
3743+
},
3744+
"resumeToken": "resume-token-2000"
3745+
},
3746+
"4": {
3747+
"query": {
3748+
"path": "collection",
3749+
"filters": [
3750+
[
3751+
"matches",
3752+
"==",
3753+
true
3754+
]
3755+
],
3756+
"orderBys": []
3757+
},
3758+
"resumeToken": ""
3759+
}
3760+
}
3761+
},
3762+
"expect": [
3763+
{
3764+
"query": {
3765+
"path": "collection",
3766+
"filters": [],
3767+
"orderBys": []
3768+
},
3769+
"added": [
3770+
{
3771+
"key": "collection/a",
3772+
"version": 1000,
3773+
"value": {
3774+
"matches": true
3775+
},
3776+
"options": {
3777+
"hasLocalMutations": false,
3778+
"hasCommittedMutations": false
3779+
}
3780+
},
3781+
{
3782+
"key": "collection/b",
3783+
"version": 1001,
3784+
"value": {
3785+
"matches": true
3786+
},
3787+
"options": {
3788+
"hasLocalMutations": false,
3789+
"hasCommittedMutations": true
3790+
}
3791+
}
3792+
],
3793+
"errorCode": 0,
3794+
"fromCache": true,
3795+
"hasPendingWrites": false
3796+
}
3797+
]
3798+
}
3799+
]
34343800
}
34353801
}

0 commit comments

Comments
 (0)