From 59b50aa1f5d921d359b926528c44500425c6d0e2 Mon Sep 17 00:00:00 2001 From: Tiffany Larson Date: Thu, 31 Oct 2024 11:48:59 -0400 Subject: [PATCH] Update passwordless test and snapshot --- .../__snapshots__/passwordless.test.js.snap | 15 +++++++++++++-- .../connection/passwordless/passwordless.test.js | 4 ++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/__tests__/connection/passwordless/__snapshots__/passwordless.test.js.snap b/src/__tests__/connection/passwordless/__snapshots__/passwordless.test.js.snap index dd4c3b01a..2a89a0b27 100644 --- a/src/__tests__/connection/passwordless/__snapshots__/passwordless.test.js.snap +++ b/src/__tests__/connection/passwordless/__snapshots__/passwordless.test.js.snap @@ -89,6 +89,17 @@ exports[`passwordless connection initPasswordless() calls initNS with showTerms `; exports[`passwordless connection initPasswordless() should call webAPI.getUserCountry when there is no default location 1`] = ` +[ + undefined, + "passwordlessCaptcha", + { + "successFn": undefined, + "syncFn": [Function], + }, +] +`; + +exports[`passwordless connection initPasswordless() should call webAPI.getUserCountry when there is no default location 2`] = ` [ undefined, "location", @@ -100,14 +111,14 @@ exports[`passwordless connection initPasswordless() should call webAPI.getUserCo ] `; -exports[`passwordless connection initPasswordless() should call webAPI.getUserCountry when there is no default location 2`] = ` +exports[`passwordless connection initPasswordless() should call webAPI.getUserCountry when there is no default location 3`] = ` [ "id", "cb", ] `; -exports[`passwordless connection initPasswordless() should call webAPI.getUserCountry when there is no default location 3`] = ` +exports[`passwordless connection initPasswordless() should call webAPI.getUserCountry when there is no default location 4`] = ` [ "model", "en", diff --git a/src/__tests__/connection/passwordless/passwordless.test.js b/src/__tests__/connection/passwordless/passwordless.test.js index a8cdd6d39..dc0115637 100644 --- a/src/__tests__/connection/passwordless/passwordless.test.js +++ b/src/__tests__/connection/passwordless/passwordless.test.js @@ -89,9 +89,9 @@ describe('passwordless connection', () => { it('should call webAPI.getUserCountry when there is no default location', () => { initPasswordless(null, {}); const sync = require('sync'); - expectMockToMatch(sync, 1); + expectMockToMatch(sync, 2); - const { syncFn, successFn } = sync.mock.calls[0][2]; + const { syncFn, successFn } = sync.mock.calls[1][2]; syncFn(null, 'cb'); expectMockToMatch(require('core/web_api').getUserCountry, 1);