File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,21 @@ describe('OptimizelyProvider', () => {
107
107
} ) ;
108
108
} ) ;
109
109
110
+ it ( 'should succeed with the initial user available in client' , ( ) => {
111
+ render ( < OptimizelyProvider optimizely = { mockReactClient } /> ) ;
112
+
113
+ expect ( mockReactClient . setUser ) . toHaveBeenCalledWith ( user1 ) ;
114
+ } ) ;
115
+
116
+ it ( 'should succeed with the initial user id and newly passed attributes' , ( ) => {
117
+ render ( < OptimizelyProvider optimizely = { mockReactClient } userAttributes = { { attr1 : 'value2' } } /> ) ;
118
+
119
+ expect ( mockReactClient . setUser ) . toHaveBeenCalledWith ( {
120
+ id : user1 . id ,
121
+ attributes : { attr1 : 'value2' } ,
122
+ } ) ;
123
+ } ) ;
124
+
110
125
it ( 'should not update when isServerSide is true' , ( ) => {
111
126
// Initial render
112
127
const { rerender } = render ( < OptimizelyProvider optimizely = { mockReactClient } isServerSide = { true } user = { user1 } /> ) ;
You can’t perform that action at this time.
0 commit comments