@@ -20,7 +20,7 @@ import { act } from 'react-dom/test-utils';
20
20
21
21
import { OptimizelyProvider } from './Provider' ;
22
22
import { OnReadyResult , ReactSDKClient , VariableValuesObject } from './client' ;
23
- import { useExperiment , useFeature , useDecide } from './hooks' ;
23
+ import { useExperiment , useFeature , useDecision } from './hooks' ;
24
24
import { OptimizelyDecision } from './utils' ;
25
25
26
26
Enzyme . configure ( { adapter : new Adapter ( ) } ) ;
@@ -46,7 +46,7 @@ const MyExperimentComponent = ({ options = {}, overrides = {} }: any) => {
46
46
} ;
47
47
48
48
const MyDecideComponent = ( { options = { } , overrides = { } } : any ) => {
49
- const [ decision , clientReady , didTimeout ] = useDecide ( 'feature1' , { ...options } , { ...overrides } ) ;
49
+ const [ decision , clientReady , didTimeout ] = useDecision ( 'feature1' , { ...options } , { ...overrides } ) ;
50
50
return < > { `${ ( decision . enabled ) ? 'true' : 'false' } |${ JSON . stringify ( decision . variables ) } |${ clientReady } |${ didTimeout } ` } </ > ;
51
51
} ;
52
52
@@ -66,7 +66,7 @@ describe('hooks', () => {
66
66
let userUpdateCallbacks : Array < ( ) => void > ;
67
67
let UseExperimentLoggingComponent : React . FunctionComponent < any > ;
68
68
let UseFeatureLoggingComponent : React . FunctionComponent < any > ;
69
- let UseDecideLoggingComponent : React . FunctionComponent < any > ;
69
+ let UseDecisionLoggingComponent : React . FunctionComponent < any > ;
70
70
let mockLog : jest . Mock ;
71
71
let forcedVariationUpdateCallbacks : Array < ( ) => void > ;
72
72
let decideMock : jest . Mock < OptimizelyDecision > ;
@@ -139,8 +139,8 @@ describe('hooks', () => {
139
139
return < div > { isEnabled } </ div > ;
140
140
} ;
141
141
142
- UseDecideLoggingComponent = ( { options = { } , overrides = { } } : any ) => {
143
- const [ decision ] = useDecide ( 'feature1' , { ...options } , { ...overrides } ) ;
142
+ UseDecisionLoggingComponent = ( { options = { } , overrides = { } } : any ) => {
143
+ const [ decision ] = useDecision ( 'feature1' , { ...options } , { ...overrides } ) ;
144
144
mockLog ( decision . enabled ) ;
145
145
return < div > { decision . enabled } </ div > ;
146
146
} ;
@@ -668,7 +668,7 @@ describe('hooks', () => {
668
668
} ) ;
669
669
} ) ;
670
670
671
- describe ( 'useDecide ' , ( ) => {
671
+ describe ( 'useDecision ' , ( ) => {
672
672
it ( 'should render true when the flag is enabled' , async ( ) => {
673
673
decideMock . mockReturnValue ( {
674
674
... defaultDecision ,
@@ -813,7 +813,7 @@ describe('hooks', () => {
813
813
decideMock . mockReturnValue ( { ...defaultDecision } ) ;
814
814
const component = Enzyme . mount (
815
815
< OptimizelyProvider optimizely = { optimizelyMock } >
816
- < UseDecideLoggingComponent />
816
+ < UseDecisionLoggingComponent />
817
817
</ OptimizelyProvider >
818
818
) ;
819
819
component . update ( ) ;
@@ -835,7 +835,7 @@ describe('hooks', () => {
835
835
836
836
const component = Enzyme . mount (
837
837
< OptimizelyProvider optimizely = { optimizelyMock } >
838
- < UseDecideLoggingComponent />
838
+ < UseDecisionLoggingComponent />
839
839
</ OptimizelyProvider >
840
840
) ;
841
841
component . update ( ) ;
@@ -914,7 +914,7 @@ describe('hooks', () => {
914
914
decideMock . mockReturnValue ( { ...defaultDecision } ) ;
915
915
const component = Enzyme . mount (
916
916
< OptimizelyProvider optimizely = { optimizelyMock } >
917
- < UseDecideLoggingComponent
917
+ < UseDecisionLoggingComponent
918
918
options = { { autoUpdate : true } }
919
919
overrides = { { overrideAttributes : { other_attr : 'y' } } }
920
920
/>
@@ -924,7 +924,7 @@ describe('hooks', () => {
924
924
decideMock . mockReset ( ) ;
925
925
component . setProps ( {
926
926
children : (
927
- < UseDecideLoggingComponent
927
+ < UseDecisionLoggingComponent
928
928
options = { { autoUpdate : true } }
929
929
overrides = { { overrideAttributes : { other_attr : 'y' } } }
930
930
/>
0 commit comments