From ffb6881a777e3c243e7b8464913112e522855047 Mon Sep 17 00:00:00 2001 From: alexneyman Date: Wed, 14 Aug 2024 13:12:31 -0400 Subject: [PATCH 1/2] init --- .../src/components/WebStorageAPIs.tsx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/apps/teams-test-app/src/components/WebStorageAPIs.tsx b/apps/teams-test-app/src/components/WebStorageAPIs.tsx index 67c691a8ef..8e2f393a50 100644 --- a/apps/teams-test-app/src/components/WebStorageAPIs.tsx +++ b/apps/teams-test-app/src/components/WebStorageAPIs.tsx @@ -15,8 +15,20 @@ const IsWebStorageClearedOnLogOut = (): React.ReactElement => ApiWithoutInput({ name: 'isWebStorageClearedOnUserLogOut', title: 'Is Web Storage Cleared on Log Out', - onClick: async () => - `webStorage ${(await webStorage.isWebStorageClearedOnUserLogOut()) ? 'is' : 'is not'} cleared on user log out`, + onClick: async () => { + const result = await webStorage.isWebStorageClearedOnUserLogOut(); + try { + if (result === true) { + return `webStorage is cleared on user log out. Result from sdk: ${result}`; + } else if (result === false) { + return `webStorage is not cleared on user log out. Result from sdk: ${result}`; + } else { + throw new Error('Invalid result: must be true or false'); + } + } catch (error) { + return `Error: ${error}. Result from sdk: ${result}`; + } + }, }); const WebStorageAPIs = (): ReactElement => ( From 1173e5e7647ff1660e6657253e650e4479dd23ea Mon Sep 17 00:00:00 2001 From: alexneyman Date: Wed, 14 Aug 2024 13:22:27 -0400 Subject: [PATCH 2/2] update webstorage test versions --- .../e2e-test-data/webStorage.json | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/apps/teams-test-app/e2e-test-data/webStorage.json b/apps/teams-test-app/e2e-test-data/webStorage.json index bdfd4f02fc..a959e1f58a 100644 --- a/apps/teams-test-app/e2e-test-data/webStorage.json +++ b/apps/teams-test-app/e2e-test-data/webStorage.json @@ -7,7 +7,7 @@ }, "checkIsSupported": { "domElementName": "checkWebStorageCapability", - "expectedOutput": "webStorage is not supported" + "expectedOutput": "webStorage is supported" }, "testCases": [ { @@ -15,7 +15,31 @@ "type": "callResponse", "boxSelector": "#box_isWebStorageClearedOnUserLogOut", "expectedAlertValue": "isWebStorageClearedOnUserLogOut called", - "expectedTestAppValue": "webStorage is cleared on user log out" + "expectedTestAppValue": "webStorage is cleared on user log out", + "hostSdkVersion": { + "web": "<4.0.2" + } + }, + { + "title": "isWebStorageClearedOnUserLogOut function Call - Success (True case)", + "type": "callResponse", + "boxSelector": "#box_isWebStorageClearedOnUserLogOut", + "expectedAlertValue": "isWebStorageClearedOnUserLogOut called", + "expectedTestAppValue": "webStorage is cleared on user log out. Result from sdk: true", + "hostSdkVersion": { + "web": ">=4.0.2" + } + }, + { + "title": "isWebStorageClearedOnUserLogOut function Call - Success (False case)", + "type": "callResponse", + "boxSelector": "#box_isWebStorageClearedOnUserLogOut", + "modulesToDisable": ["shouldWebStorageResolveToTrueToggle"], + "expectedAlertValue": "isWebStorageClearedOnUserLogOut called", + "expectedTestAppValue": "webStorage is not cleared on user log out. Result from sdk: false", + "hostSdkVersion": { + "web": ">=4.0.2" + } } ] }