File tree Expand file tree Collapse file tree 3 files changed +5
-8
lines changed Expand file tree Collapse file tree 3 files changed +5
-8
lines changed Original file line number Diff line number Diff line change 11export enum TARGETING_REASONS {
22 DEFAULT = 'DEFAULT' ,
3- IDENTITY_OVERRIDE = 'IDENTITY_OVERRIDE' ,
43 TARGETING_MATCH = 'TARGETING_MATCH'
54}
Original file line number Diff line number Diff line change @@ -143,10 +143,7 @@ export function isHigherPriority(
143143}
144144
145145const getTargetingMatchReason = ( segmentOverride : SegmentOverride ) => {
146- if ( segmentOverride ) {
147- return segmentOverride . segmentName === IDENTITY_OVERRIDE_SEGMENT_NAME
148- ? TARGETING_REASONS . IDENTITY_OVERRIDE
149- : `${ TARGETING_REASONS . TARGETING_MATCH } ; segment=${ segmentOverride . segmentName } ` ;
150- }
151- return TARGETING_REASONS . DEFAULT ;
146+ return segmentOverride
147+ ? `${ TARGETING_REASONS . TARGETING_MATCH } ; segment=${ segmentOverride . segmentName } `
148+ : TARGETING_REASONS . DEFAULT ;
152149} ;
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import {
2121import { getEvaluationContext } from '../../../flagsmith-engine/evaluationContext/mappers.js' ;
2222import { TARGETING_REASONS } from '../../../flagsmith-engine/features/types.js' ;
2323import { EvaluationContext } from '../../../flagsmith-engine/evaluationContext/evaluationContext.types.js' ;
24+ import { IDENTITY_OVERRIDE_SEGMENT_NAME } from '../../../flagsmith-engine/segments/constants.js' ;
2425
2526test ( 'test_get_evaluation_result_without_any_override' , ( ) => {
2627 const context = getEvaluationContext ( environment ( ) , identity ( ) ) ;
@@ -57,7 +58,7 @@ test('test_get_evaluation_result_with_identity_override_and_no_segment_override'
5758 expect ( flag . enabled ) . toBe ( expected ) ;
5859 expect ( flag . reason ) . toBe (
5960 flag . name === 'overridden_feature'
60- ? TARGETING_REASONS . IDENTITY_OVERRIDE
61+ ? ` ${ TARGETING_REASONS . TARGETING_MATCH } ; segment= ${ IDENTITY_OVERRIDE_SEGMENT_NAME } `
6162 : TARGETING_REASONS . DEFAULT
6263 ) ;
6364 }
You can’t perform that action at this time.
0 commit comments