Skip to content

Commit

Permalink
chore: update /initialize and /dcs test data (#347)
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-statsig authored Oct 22, 2024
1 parent 555faf9 commit af9725f
Show file tree
Hide file tree
Showing 4 changed files with 1,085 additions and 236 deletions.
7 changes: 4 additions & 3 deletions packages/combo/src/__tests__/EvaluationCallbacks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe('Client Evaluations Callback', () => {
name: 'gate_evaluation',
gate: {
name: 'a_gate',
ruleID: '2QWhVkWdUEXR6Q3KYgV73O',
ruleID: '2QWhVkWdUEXR6Q3KYgV73O:100.00:4',
details: expectedDetails,
value: true,
__evaluation: anyObject(),
Expand Down Expand Up @@ -136,11 +136,12 @@ describe('Client Evaluations Callback', () => {
name: 'experiment_evaluation',
experiment: {
name: 'an_experiment',
ruleID: '49CGlTB7z97PEdqJapQplA',
ruleID: '49CGlTB7z97PEdqJapQplA:override',
groupName: 'Test',
details: expectedDetails,
value: {
a_string: 'Experiment Test Value',
my_obj: {},
},
get: anyFunction(),
__evaluation: anyObject(),
Expand All @@ -165,7 +166,7 @@ describe('Client Evaluations Callback', () => {
name: 'layer_evaluation',
layer: {
name: 'a_layer',
ruleID: '49CGlTB7z97PEdqJapQplA',
ruleID: '49CGlTB7z97PEdqJapQplA:override',
groupName: 'Test',
details: expectedDetails,
get: anyFunction(),
Expand Down
23 changes: 21 additions & 2 deletions packages/combo/src/__tests__/UserPersistedStorage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const DCS_RESPONSE_INACTIVE_EXP = (() => {

return JSON.stringify(dcsClone);
})();

const STORAGE_VALUES_TEST_GROUP_USER = JSON.stringify({
'test-group-user-11:userID': {
an_experiment: {
Expand All @@ -40,6 +41,24 @@ const STORAGE_VALUES_TEST_GROUP_USER = JSON.stringify({
},
});

const SECONDARY_EXPOSURES = [
{
gate: 'partial_gate',
gateValue: 'false',
ruleID: '59nkHdlmIytrqNG9iT7gkd:50.00:4',
},
{
gate: 'a_holdout',
gateValue: 'false',
ruleID: '7MfLa1sxHKhPjAKKIYIZ3D',
},
{
gate: 'a_holdout',
gateValue: 'false',
ruleID: '7MfLa1sxHKhPjAKKIYIZ3D',
},
];

describe('User Persisted Storage', () => {
const useInControlGroup = { userID: 'control-group-user-3' };
const userInTestGroup = { userID: 'test-group-user-11' };
Expand Down Expand Up @@ -87,7 +106,7 @@ describe('User Persisted Storage', () => {
group_name: 'Control',
json_value: { a_string: 'Experiment Control Value' },
rule_id: '49CGlRW56QYlkNSNzhUM2y',
secondary_exposures: [],
secondary_exposures: SECONDARY_EXPOSURES,
time: anyNumber(),
value: true,
},
Expand All @@ -104,7 +123,7 @@ describe('User Persisted Storage', () => {
group_name: 'Test',
json_value: { a_string: 'Experiment Test Value' },
rule_id: '49CGlTB7z97PEdqJapQplA',
secondary_exposures: [],
secondary_exposures: SECONDARY_EXPOSURES,
time: anyNumber(),
value: true,
},
Expand Down
Loading

0 comments on commit af9725f

Please sign in to comment.