diff --git a/test_cases/test_multivariate__option_a_stronger_priority__expected_flags.jsonc b/test_cases/test_multivariate__option_a_stronger_priority__expected_flags.jsonc new file mode 100644 index 0000000..f08e3dd --- /dev/null +++ b/test_cases/test_multivariate__option_a_stronger_priority__expected_flags.jsonc @@ -0,0 +1,51 @@ +{ + // Given: A multivariate feature with two variants of equal weight, where option_b has a stronger priority (lower priority number) + // and an identity resulting in 49.27% percentage allocation + // When: Evaluating the feature for the given identity + // Then: The variant with stronger priority (option_a) should be selected as the feature value + "$schema": "https://raw.githubusercontent.com/Flagsmith/engine-test-data/refs/tags/v2.0.0/schema.json", + "context": { + "environment": { + "key": "test_env", + "name": "Test Environment" + }, + "identity": { + "identifier": "0cfd0d72-4de4-4ed7-9cfb-d80dc3dacead", + "key": "32103813" + }, + "features": { + "multivariate_feature": { + "enabled": true, + "feature_key": "15062", + "key": "78986", + "name": "multivariate_feature", + "value": "foo", + "variants": [ + { + "value": "option_a", + "weight": 50, + "priority": 10 + }, + { + "value": "option_b", + "weight": 50, + "priority": 20 + } + ] + } + }, + "segments": {} + }, + "result": { + "flags": { + "multivariate_feature": { + "enabled": true, + "feature_key": "15062", + "name": "multivariate_feature", + "reason": "SPLIT; weight=50", + "value": "option_a" + } + }, + "segments": [] + } +} \ No newline at end of file diff --git a/test_cases/test_multivariate__option_b_stronger_priority__expected_flags.jsonc b/test_cases/test_multivariate__option_b_stronger_priority__expected_flags.jsonc new file mode 100644 index 0000000..a2878e8 --- /dev/null +++ b/test_cases/test_multivariate__option_b_stronger_priority__expected_flags.jsonc @@ -0,0 +1,51 @@ +{ + // Given: A multivariate feature with two variants of equal weight, where option_b has a stronger priority (lower priority number) + // and an identity resulting in 49.27% percentage allocation + // When: Evaluating the feature for the given identity + // Then: The variant with stronger priority (option_b) should be selected as the feature value + "$schema": "https://raw.githubusercontent.com/Flagsmith/engine-test-data/refs/tags/v2.0.0/schema.json", + "context": { + "environment": { + "key": "test_env", + "name": "Test Environment" + }, + "identity": { + "identifier": "0cfd0d72-4de4-4ed7-9cfb-d80dc3dacead", + "key": "32103813" + }, + "features": { + "multivariate_feature": { + "enabled": true, + "feature_key": "15062", + "key": "78986", + "name": "multivariate_feature", + "value": "foo", + "variants": [ + { + "value": "option_a", + "weight": 50, + "priority": 20 + }, + { + "value": "option_b", + "weight": 50, + "priority": 10 + } + ] + } + }, + "segments": {} + }, + "result": { + "flags": { + "multivariate_feature": { + "enabled": true, + "feature_key": "15062", + "name": "multivariate_feature", + "reason": "SPLIT; weight=50", + "value": "option_b" + } + }, + "segments": [] + } +} \ No newline at end of file