Skip to content

Commit b6f7f4f

Browse files
committed
lint
1 parent 303ed13 commit b6f7f4f

File tree

5 files changed

+10
-16
lines changed

5 files changed

+10
-16
lines changed

packages/template-retail-react-app/app/components/passkey-registration-modal/index.jsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ import {arrayBufferToBase64Url} from '@salesforce/retail-react-app/app/utils/uti
3838
import {AuthHelpers, useAuthHelper} from '@salesforce/commerce-sdk-react'
3939

4040
// Constants
41-
import {API_ERROR_MESSAGE, INVALID_TOKEN_ERROR_MESSAGE} from '@salesforce/retail-react-app/app/constants'
41+
import {
42+
API_ERROR_MESSAGE,
43+
INVALID_TOKEN_ERROR_MESSAGE
44+
} from '@salesforce/retail-react-app/app/constants'
4245

4346
/**
4447
* Modal for registering a new passkey with a nickname
@@ -148,7 +151,7 @@ const PasskeyRegistrationModal = ({isOpen, onClose}) => {
148151
return {success: true}
149152
} catch (err) {
150153
console.error('Error registering passkey:', err)
151-
const message = /Unauthorized/i.test(err.message)
154+
const message = /Unauthorized/i.test(err.message)
152155
? formatMessage(INVALID_TOKEN_ERROR_MESSAGE)
153156
: formatMessage(API_ERROR_MESSAGE)
154157

packages/template-retail-react-app/app/hooks/use-auth-modal.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ import {API_ERROR_MESSAGE} from '@salesforce/retail-react-app/app/constants'
3636
import {
3737
getAuthorizePasswordlessErrorMessage,
3838
getPasswordResetErrorMessage,
39-
getLoginPasswordlessErrorMessage,
40-
getPasskeyAuthenticateErrorMessage
39+
getLoginPasswordlessErrorMessage
4140
} from '@salesforce/retail-react-app/app/utils/auth-utils'
4241
import useNavigation from '@salesforce/retail-react-app/app/hooks/use-navigation'
4342
import {usePrevious} from '@salesforce/retail-react-app/app/hooks/use-previous'
@@ -240,7 +239,7 @@ export const AuthModal = ({
240239
form.reset()
241240
// Prompt user to login without username (discoverable credentials)
242241
loginWithPasskey().catch(() => {
243-
form.setError('global', {type: 'manual', message:formatMessage(API_ERROR_MESSAGE)})
242+
form.setError('global', {type: 'manual', message: formatMessage(API_ERROR_MESSAGE)})
244243
})
245244
}
246245
}, [isOpen])

packages/template-retail-react-app/app/hooks/use-auth-modal.test.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import {mockedRegisteredCustomer} from '@salesforce/retail-react-app/app/mocks/m
2727
import * as ReactHookForm from 'react-hook-form'
2828
import mockConfig from '@salesforce/retail-react-app/config/mocks/default'
2929
import {getConfig} from '@salesforce/pwa-kit-runtime/utils/ssr-config'
30-
import {API_ERROR_MESSAGE} from '@salesforce/retail-react-app/app/constants'
3130

3231
jest.mock('@salesforce/pwa-kit-runtime/utils/ssr-config', () => ({
3332
getConfig: jest.fn()
@@ -815,9 +814,7 @@ describe('Passkey login', () => {
815814

816815
// Should show error - 401 error from WebAuthn API should be caught and converted to user-friendly message
817816
await waitFor(() => {
818-
expect(
819-
screen.getByText(/Something went wrong. Try again!/i)
820-
).toBeInTheDocument()
817+
expect(screen.getByText(/Something went wrong. Try again!/i)).toBeInTheDocument()
821818
})
822819
})
823820

packages/template-retail-react-app/app/pages/checkout/partials/contact-info.jsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ import {
4949
getAuthorizePasswordlessErrorMessage
5050
} from '@salesforce/retail-react-app/app/utils/auth-utils'
5151
import useMultiSite from '@salesforce/retail-react-app/app/hooks/use-multi-site'
52-
import {getPasswordlessErrorMessage} from '@salesforce/retail-react-app/app/utils/auth-utils'
53-
import {
54-
API_ERROR_MESSAGE
55-
} from '@salesforce/retail-react-app/app/constants'
52+
import {API_ERROR_MESSAGE} from '@salesforce/retail-react-app/app/constants'
5653

5754
const ContactInfo = ({isSocialEnabled = false, isPasswordlessEnabled = false, idps = []}) => {
5855
const {formatMessage} = useIntl()

packages/template-retail-react-app/app/pages/login/index.test.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -628,9 +628,7 @@ describe('Passkey login', () => {
628628

629629
// Should show error - 401 error from WebAuthn API should be caught and converted to user-friendly message
630630
await waitFor(() => {
631-
expect(
632-
screen.getByText(/Something went wrong. Try again!/i)
633-
).toBeInTheDocument()
631+
expect(screen.getByText(/Something went wrong. Try again!/i)).toBeInTheDocument()
634632
})
635633
})
636634
})

0 commit comments

Comments
 (0)