From 0672dfdc85df55907837834f33da0a6d84d6efdc Mon Sep 17 00:00:00 2001 From: Arash Koushkebaghi Date: Wed, 11 Sep 2019 16:11:39 -0700 Subject: [PATCH] fix(UnitTest): copy an object immutably --- src/components/WebexActivity/WebexActivity.test.js | 2 +- src/components/WebexActivityStream/WebexActivityStream.test.js | 2 +- src/components/WebexAvatar/WebexAvatar.test.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/WebexActivity/WebexActivity.test.js b/src/components/WebexActivity/WebexActivity.test.js index b3888d125..e1bbe6e67 100644 --- a/src/components/WebexActivity/WebexActivity.test.js +++ b/src/components/WebexActivity/WebexActivity.test.js @@ -12,7 +12,7 @@ describe('Webex Activity component', () => { let activityID, personID, adapters, newActivities; beforeEach(() => { - newActivities = {}; + newActivities = {...activities}; // Reset newActivities [activityID] = Object.keys(activities); [personID] = Object.keys(people); adapters = { diff --git a/src/components/WebexActivityStream/WebexActivityStream.test.js b/src/components/WebexActivityStream/WebexActivityStream.test.js index 13073e0f5..586731892 100644 --- a/src/components/WebexActivityStream/WebexActivityStream.test.js +++ b/src/components/WebexActivityStream/WebexActivityStream.test.js @@ -13,8 +13,8 @@ describe('Webex Activity Stream component', () => { let roomID, newRooms, roomsAdapter; beforeEach(() => { + newRooms = {...rooms}; // Reset newRooms [roomID] = Object.keys(rooms); - newRooms = rooms; roomsAdapter = new RoomsJSONAdapter(rooms); }); diff --git a/src/components/WebexAvatar/WebexAvatar.test.js b/src/components/WebexAvatar/WebexAvatar.test.js index f100ba62a..bc877d843 100644 --- a/src/components/WebexAvatar/WebexAvatar.test.js +++ b/src/components/WebexAvatar/WebexAvatar.test.js @@ -12,8 +12,8 @@ describe('Webex Avatar component', () => { let personID, newPeople, peopleAdapter; beforeEach(() => { + newPeople = {...people}; // Reset newPeople [personID] = Object.keys(people); - newPeople = people; peopleAdapter = new PeopleJSONAdapter(people); });