-
Notifications
You must be signed in to change notification settings - Fork 11
/
02-user-with-id-strategy.json
102 lines (101 loc) · 2.15 KB
/
02-user-with-id-strategy.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
{
"name": "02-user-with-id-strategy",
"state": {
"version": 1,
"features": [
{
"name": "Feature.A2",
"description": "Enabled toggle",
"enabled": true,
"strategies": [
{
"name": "userWithId",
"parameters": {
"userIds": "123"
}
}
]
},
{
"name": "Feature.B2",
"description": "Disabled toggle",
"enabled": true,
"strategies": [
{
"name": "userWithId",
"parameters": {
"userIds": "123"
}
}
]
},
{
"name": "Feature.C2",
"enabled": true,
"strategies": [
{
"name": "userWithId",
"parameters": {
"userIds": "123"
}
},
{
"name": "default"
}
]
},
{
"name": "Feature.D2",
"enabled": true,
"strategies": [
{
"name": "userWithId",
"parameters": {
"userIds": "123, 222, 88"
}
}
]
}
]
},
"tests": [
{
"description": "Feature.A2 Should be enabled for user on context",
"context": {
"userId": "123"
},
"toggleName": "Feature.A2",
"expectedResult": true
},
{
"description": "Feature.A2 Should not be enabled for user not in context",
"context": {
"userId": "22"
},
"toggleName": "Feature.A2",
"expectedResult": false
},
{
"description": "Feature.C2 Should not be enabled for for everyone",
"context": {
"userId": "22"
},
"toggleName": "Feature.C2",
"expectedResult": true
},
{
"description": "Feature.D2 Should not be enabled for user in list",
"context": {
"userId": "222"
},
"toggleName": "Feature.D2",
"expectedResult": true
},
{
"description": "Feature.A2 Should be disabled when no userId on context",
"context": {},
"toggleName": "Feature.A2",
"expectedResult": false
}
]
}