Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct assertions for shorthand targeting #135

Merged
merged 1 commit into from
Jul 4, 2024

Conversation

toddbaert
Copy link
Member

@toddbaert toddbaert commented Jul 4, 2024

When I first wrote these assertions, I had incorrectly setup the cuke bindings in the JS repo where I tested it; I was setting the targeting key to "[email protected]" (including the quotes!!!) which obviously resulted in a different assignment. Then when I started implementing these tests in other repos, nothing worked 😅

These are the actual correct responses, which you can test in flagd:

curl -X POST "http://localhost:8013/flagd.evaluation.v1.Service/ResolveString"       -d '{"flagKey":"fractional-flag-shorthand","context":{"targetingKey":"[email protected]"}}' -H "Content-Type: application/json"

// {"value":"tails","reason":"TARGETING_MATCH","variant":"tails","metadata":{}}
curl -X POST "http://localhost:8013/flagd.evaluation.v1.Service/ResolveString"       -d '{"flagKey":"fractional-flag-shorthand","context":{"targetingKey":"[email protected]"}}' -H "Content-Type: application/json"

// {"value":"heads","reason":"TARGETING_MATCH","variant":"heads","metadata":{}}

@toddbaert toddbaert merged commit 5b685c2 into main Jul 4, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant