From b8d9765a83ddccedfa0c0998b16dbd2a8078db86 Mon Sep 17 00:00:00 2001
From: Md Junaed Hossain <169046794+junaed-optimizely@users.noreply.github.com>
Date: Thu, 7 Nov 2024 19:50:14 +0600
Subject: [PATCH] [FSSDK-10880] override initial user bug adjustment
---
src/Provider.spec.tsx | 4 ++++
src/Provider.tsx | 5 +++++
2 files changed, 9 insertions(+)
diff --git a/src/Provider.spec.tsx b/src/Provider.spec.tsx
index 84cda0a..f2891a6 100644
--- a/src/Provider.spec.tsx
+++ b/src/Provider.spec.tsx
@@ -83,6 +83,8 @@ describe('OptimizelyProvider', () => {
});
it('should render successfully without user or userId provided', () => {
+ // @ts-ignore
+ mockReactClient.user = undefined;
render();
expect(mockReactClient.setUser).toHaveBeenCalledWith(DefaultUser);
@@ -95,6 +97,8 @@ describe('OptimizelyProvider', () => {
});
it('should succeed just userAttributes provided', () => {
+ // @ts-ignore
+ mockReactClient.user = undefined;
render();
expect(mockReactClient.setUser).toHaveBeenCalledWith({
diff --git a/src/Provider.tsx b/src/Provider.tsx
index b0da5ca..5a126b5 100644
--- a/src/Provider.tsx
+++ b/src/Provider.tsx
@@ -73,6 +73,11 @@ export class OptimizelyProvider extends React.Component