Skip to content

Commit 37606e4

Browse files
authored
feat: Add segment metadata test (#24)
1 parent 5750d53 commit 37606e4

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
// Given: A segment with metadata
3+
// When: An evaluation context matching the segment rules
4+
// Then: The result should include the segment metadata
5+
"$schema": "https://raw.githubusercontent.com/Flagsmith/engine-test-data/refs/tags/v2.0.0/schema.json",
6+
"context": {
7+
"environment": {
8+
"key": "key",
9+
"name": "Environment"
10+
},
11+
"identity": {
12+
"identifier": "metadata_user",
13+
"key": "key_metadata_user",
14+
},
15+
"segments": {
16+
"422": {
17+
"key": "422",
18+
"name": "segment_with_metadata",
19+
"metadata": {
20+
"source": "imported"
21+
},
22+
"rules": [
23+
{
24+
"type": "ALL",
25+
"conditions": [
26+
{
27+
"operator": "EQUAL",
28+
"property": "$.identity.identifier",
29+
"value": "metadata_user"
30+
}
31+
]
32+
}
33+
]
34+
}
35+
}
36+
},
37+
"result": {
38+
"flags": {},
39+
"segments": [
40+
{
41+
"key": "422",
42+
"name": "segment_with_metadata",
43+
"metadata": {
44+
"source": "imported"
45+
}
46+
}
47+
]
48+
}
49+
}

0 commit comments

Comments
 (0)