-
Notifications
You must be signed in to change notification settings - Fork 83
[FSSDK-11497] fire config update events synchronously #1043
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Unchanged files with check annotations Beta
isQualifiedFor: segment => segments ? segments.indexOf(segment) > -1 : false, | ||
qualifiedSegments: segments || [], | ||
getUserId: () => 'mockUserId', | ||
setAttribute: (key: string, value: any) => {}, | ||
Check warning on line 33 in lib/core/audience_evaluator/index.spec.ts
|
||
decide: (key: string, options?: OptimizelyDecideOption[]): OptimizelyDecision => ({ | ||
Check warning on line 35 in lib/core/audience_evaluator/index.spec.ts
|
||
variationKey: 'mockVariationKey', | ||
enabled: true, | ||
variables: { mockVariable: 'mockValue' }, | ||
}); | ||
it('calls customAttributeConditionEvaluator.evaluate in the leaf evaluator for audience conditions', () => { | ||
vi.spyOn(conditionTreeEvaluator, 'evaluate').mockImplementation((conditions: any, leafEvaluator) => { | ||
Check warning on line 253 in lib/core/audience_evaluator/index.spec.ts
|
||
return leafEvaluator(conditions[1]); | ||
}); | ||
}); | ||
it('logs correctly when conditionTreeEvaluator.evaluate returns null', () => { | ||
vi.spyOn(conditionTreeEvaluator, 'evaluate').mockImplementationOnce((conditions: any, leafEvaluator) => { | ||
Check warning on line 295 in lib/core/audience_evaluator/index.spec.ts
|
||
return leafEvaluator(conditions[1]); | ||
}); | ||
}); | ||
it('logs correctly when conditionTreeEvaluator.evaluate returns true', () => { | ||
vi.spyOn(conditionTreeEvaluator, 'evaluate').mockImplementationOnce((conditions: any, leafEvaluator) => { | ||
Check warning on line 322 in lib/core/audience_evaluator/index.spec.ts
|
||
return leafEvaluator(conditions[1]); | ||
}); | ||
}); | ||
it('logs correctly when conditionTreeEvaluator.evaluate returns false', () => { | ||
vi.spyOn(conditionTreeEvaluator, 'evaluate').mockImplementationOnce((conditions: any, leafEvaluator) => { | ||
Check warning on line 348 in lib/core/audience_evaluator/index.spec.ts
|
||
return leafEvaluator(conditions[1]); | ||
}); | ||
}; | ||
audienceEvaluator = createAudienceEvaluator({ | ||
special_condition_type: { | ||
evaluate: (condition: any, user: any) => { | ||
Check warning on line 384 in lib/core/audience_evaluator/index.spec.ts
|
||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
const result = mockEnvironment[condition.value] && user.getAttributes()[condition.match] > 0; |
Uh oh!
There was an error while loading. Please reload this page.