@@ -20,7 +20,7 @@ import { act } from 'react-dom/test-utils';
2020
2121import { OptimizelyProvider } from './Provider' ;
2222import { OnReadyResult , ReactSDKClient , VariableValuesObject } from './client' ;
23- import { useExperiment , useFeature , useDecide } from './hooks' ;
23+ import { useExperiment , useFeature , useDecision } from './hooks' ;
2424import { OptimizelyDecision } from './utils' ;
2525
2626Enzyme . configure ( { adapter : new Adapter ( ) } ) ;
@@ -46,7 +46,7 @@ const MyExperimentComponent = ({ options = {}, overrides = {} }: any) => {
4646} ;
4747
4848const MyDecideComponent = ( { options = { } , overrides = { } } : any ) => {
49- const [ decision , clientReady , didTimeout ] = useDecide ( 'feature1' , { ...options } , { ...overrides } ) ;
49+ const [ decision , clientReady , didTimeout ] = useDecision ( 'feature1' , { ...options } , { ...overrides } ) ;
5050 return < > { `${ ( decision . enabled ) ? 'true' : 'false' } |${ JSON . stringify ( decision . variables ) } |${ clientReady } |${ didTimeout } ` } </ > ;
5151} ;
5252
@@ -66,7 +66,7 @@ describe('hooks', () => {
6666 let userUpdateCallbacks : Array < ( ) => void > ;
6767 let UseExperimentLoggingComponent : React . FunctionComponent < any > ;
6868 let UseFeatureLoggingComponent : React . FunctionComponent < any > ;
69- let UseDecideLoggingComponent : React . FunctionComponent < any > ;
69+ let UseDecisionLoggingComponent : React . FunctionComponent < any > ;
7070 let mockLog : jest . Mock ;
7171 let forcedVariationUpdateCallbacks : Array < ( ) => void > ;
7272 let decideMock : jest . Mock < OptimizelyDecision > ;
@@ -139,8 +139,8 @@ describe('hooks', () => {
139139 return < div > { isEnabled } </ div > ;
140140 } ;
141141
142- UseDecideLoggingComponent = ( { options = { } , overrides = { } } : any ) => {
143- const [ decision ] = useDecide ( 'feature1' , { ...options } , { ...overrides } ) ;
142+ UseDecisionLoggingComponent = ( { options = { } , overrides = { } } : any ) => {
143+ const [ decision ] = useDecision ( 'feature1' , { ...options } , { ...overrides } ) ;
144144 mockLog ( decision . enabled ) ;
145145 return < div > { decision . enabled } </ div > ;
146146 } ;
@@ -668,7 +668,7 @@ describe('hooks', () => {
668668 } ) ;
669669 } ) ;
670670
671- describe ( 'useDecide ' , ( ) => {
671+ describe ( 'useDecision ' , ( ) => {
672672 it ( 'should render true when the flag is enabled' , async ( ) => {
673673 decideMock . mockReturnValue ( {
674674 ... defaultDecision ,
@@ -813,7 +813,7 @@ describe('hooks', () => {
813813 decideMock . mockReturnValue ( { ...defaultDecision } ) ;
814814 const component = Enzyme . mount (
815815 < OptimizelyProvider optimizely = { optimizelyMock } >
816- < UseDecideLoggingComponent />
816+ < UseDecisionLoggingComponent />
817817 </ OptimizelyProvider >
818818 ) ;
819819 component . update ( ) ;
@@ -835,7 +835,7 @@ describe('hooks', () => {
835835
836836 const component = Enzyme . mount (
837837 < OptimizelyProvider optimizely = { optimizelyMock } >
838- < UseDecideLoggingComponent />
838+ < UseDecisionLoggingComponent />
839839 </ OptimizelyProvider >
840840 ) ;
841841 component . update ( ) ;
@@ -914,7 +914,7 @@ describe('hooks', () => {
914914 decideMock . mockReturnValue ( { ...defaultDecision } ) ;
915915 const component = Enzyme . mount (
916916 < OptimizelyProvider optimizely = { optimizelyMock } >
917- < UseDecideLoggingComponent
917+ < UseDecisionLoggingComponent
918918 options = { { autoUpdate : true } }
919919 overrides = { { overrideAttributes : { other_attr : 'y' } } }
920920 />
@@ -924,7 +924,7 @@ describe('hooks', () => {
924924 decideMock . mockReset ( ) ;
925925 component . setProps ( {
926926 children : (
927- < UseDecideLoggingComponent
927+ < UseDecisionLoggingComponent
928928 options = { { autoUpdate : true } }
929929 overrides = { { overrideAttributes : { other_attr : 'y' } } }
930930 />
0 commit comments