From 7c5aa237e258f3daa0ff56555a6c09ea10509326 Mon Sep 17 00:00:00 2001 From: Poovamraj T T Date: Wed, 9 Aug 2023 23:39:09 +0530 Subject: [PATCH] Updated tests --- .../__snapshots__/index.spec.js.snap | 20 +++++++++---------- .../__tests__/credentials-manager.spec.js | 2 +- .../timestampConversion.spec.js.snap | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/auth/__tests__/__snapshots__/index.spec.js.snap b/src/auth/__tests__/__snapshots__/index.spec.js.snap index 21cbae07..82e7d575 100644 --- a/src/auth/__tests__/__snapshots__/index.spec.js.snap +++ b/src/auth/__tests__/__snapshots__/index.spec.js.snap @@ -29,7 +29,7 @@ exports[`auth Multifactor Challenge Flow should require MFA Token 1`] = ` exports[`auth OOB flow binding code should be optional 1`] = ` { "accessToken": "1234", - "expiresAt": 2023-01-02T00:00:00.000Z, + "expiresAt": 1672617600, "idToken": "id-123", "scope": "openid profile email address phone", "tokenType": "Bearer", @@ -65,7 +65,7 @@ exports[`auth OOB flow should handle malformed OOB code 1`] = `[invalid_grant: M exports[`auth OOB flow should handle success with binding code 1`] = ` { "accessToken": "1234", - "expiresAt": 2023-01-02T00:00:00.000Z, + "expiresAt": 1672617600, "idToken": "id-123", "scope": "openid profile email address phone", "tokenType": "Bearer", @@ -75,7 +75,7 @@ exports[`auth OOB flow should handle success with binding code 1`] = ` exports[`auth OOB flow should handle success without binding code 1`] = ` { "accessToken": "1234", - "expiresAt": 2023-01-02T00:00:00.000Z, + "expiresAt": 1672617600, "idToken": "id-123", "scope": "openid profile email address phone", "tokenType": "Bearer", @@ -129,7 +129,7 @@ exports[`auth OTP flow when MFA is not associated 1`] = `[unsupported_challenge_ exports[`auth OTP flow when MFA succeeds 1`] = ` { "accessToken": "1234", - "expiresAt": 2023-01-02T00:00:00.000Z, + "expiresAt": 1672617600, "idToken": "id-123", "scope": "openid profile email address phone", "tokenType": "Bearer", @@ -174,7 +174,7 @@ exports[`auth Recovery Code flow should require MFA Token and Recovery Code 1`] exports[`auth Recovery Code flow when Recovery code succeeds 1`] = ` { "accessToken": "1234", - "expiresAt": 2023-01-02T00:00:00.000Z, + "expiresAt": 1672617600, "idToken": "id-123", "scope": "openid profile email address phone", "tokenType": "Bearer", @@ -224,7 +224,7 @@ exports[`auth code exchange for native social should handle unexpected error 1`] exports[`auth code exchange for native social should return successful response 1`] = ` { "accessToken": "an access token", - "expiresAt": 2062-02-13T23:31:30.000Z, + "expiresAt": 2907099090, "idToken": "an id token", "scope": "openid", "state": "a random state for auth", @@ -234,7 +234,7 @@ exports[`auth code exchange for native social should return successful response exports[`auth code exchange for native social should return successful response with optional parameters 1`] = ` { "accessToken": "an access token", - "expiresAt": 2062-02-13T23:31:30.000Z, + "expiresAt": 2907099090, "idToken": "an id token", "scope": "openid", "state": "a random state for auth", @@ -296,7 +296,7 @@ exports[`auth code exchange should handle unexpected error 1`] = `[a0.response.i exports[`auth code exchange should return successful response 1`] = ` { "accessToken": "an access token", - "expiresAt": 2062-02-13T23:31:30.000Z, + "expiresAt": 2907099090, "idToken": "an id token", "scope": "openid", "state": "a random state for auth", @@ -427,7 +427,7 @@ exports[`auth password realm should handle unexpected error 1`] = `[a0.response. exports[`auth password realm should return successful response 1`] = ` { "accessToken": "an access token", - "expiresAt": 2062-02-13T23:31:30.000Z, + "expiresAt": 2907099090, "idToken": "an id token", "scope": "openid", "state": "a random state for auth", @@ -829,7 +829,7 @@ exports[`auth refresh token should handle unknown error 1`] = `[a0.response.inva exports[`auth refresh token should return successful response 1`] = ` { "accessToken": "an access token", - "expiresAt": 2062-02-13T23:31:30.000Z, + "expiresAt": 2907099090, "idToken": "an id token", "scope": "openid", "state": "a random state for auth", diff --git a/src/credentials-manager/__tests__/credentials-manager.spec.js b/src/credentials-manager/__tests__/credentials-manager.spec.js index c44626fb..92a43931 100644 --- a/src/credentials-manager/__tests__/credentials-manager.spec.js +++ b/src/credentials-manager/__tests__/credentials-manager.spec.js @@ -19,7 +19,7 @@ describe('credentials manager tests', () => { idToken: '1234', accessToken: '1234', tokenType: 'Bearer', - expiresIn: 86000, + expiresAt: 1691603391, }; describe('test saving credentials', () => { diff --git a/src/utils/__tests__/__snapshots__/timestampConversion.spec.js.snap b/src/utils/__tests__/__snapshots__/timestampConversion.spec.js.snap index b5f454e4..4a14d0b8 100644 --- a/src/utils/__tests__/__snapshots__/timestampConversion.spec.js.snap +++ b/src/utils/__tests__/__snapshots__/timestampConversion.spec.js.snap @@ -4,6 +4,6 @@ exports[`timestamp conversion test convertExpiresInToExpiresAt should handle nul exports[`timestamp conversion test convertExpiresInToExpiresAt should handle undefined 1`] = `null`; -exports[`timestamp conversion test convertExpiresInToExpiresAt should handle zero 1`] = `1672531200000`; +exports[`timestamp conversion test convertExpiresInToExpiresAt should handle zero 1`] = `1672531200`; -exports[`timestamp conversion test convertExpiresInToExpiresAt should successfully convert 1`] = `1672617600000`; +exports[`timestamp conversion test convertExpiresInToExpiresAt should successfully convert 1`] = `1672617600`;