Skip to content

Commit

Permalink
Rename ConnectDevicePage to ExtLedgerAccessPopup
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaw3d authored and buberdds committed Nov 12, 2024
1 parent 9558b45 commit 849bf52
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions .changelog/2093.trivial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Rename ledger popup in extension
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import { AlertBox } from 'app/components/AlertBox'
import { WalletErrors } from 'types/errors'
import { importAccountsActions } from 'app/state/importaccounts'
import { requestDevice } from 'app/lib/ledger'
import logotype from '../../../../public/Icon Blue 192.png'
import { WalletType } from '../../state/wallet/types'
import { WalletType } from '../../../src/app/state/wallet/types'
import logotype from '../../../public/Icon Blue 192.png'

type ConnectionStatus = 'connected' | 'disconnected' | 'connecting' | 'error'
type ConnectionStatusIconPros = {
Expand Down Expand Up @@ -44,7 +44,7 @@ function ConnectionStatusIcon({ success = true, label, withMargin = false }: Con
)
}

export function ConnectDevicePage() {
export function ExtLedgerAccessPopup() {
const { t } = useTranslation()
const dispatch = useDispatch()
const [connection, setConnection] = useState<ConnectionStatus>('disconnected')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`<ConnectDevicePage /> should render component 1`] = `
exports[`<ExtLedgerAccessPopup /> should render component 1`] = `
.c0 {
display: -webkit-box;
display: -webkit-flex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { render, screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { requestDevice } from 'app/lib/ledger'
import { importAccountsActions } from 'app/state/importaccounts'
import { ConnectDevicePage } from '..'
import { WalletType } from '../../../state/wallet/types'
import { ExtLedgerAccessPopup } from '../ExtLedgerAccessPopup'
import { WalletType } from '../../../../src/app/state/wallet/types'

jest.mock('app/lib/ledger')

Expand All @@ -14,17 +14,17 @@ jest.mock('react-redux', () => ({
useDispatch: () => mockDispatch,
}))

describe('<ConnectDevicePage />', () => {
describe('<ExtLedgerAccessPopup />', () => {
it('should render component', () => {
const { container } = render(<ConnectDevicePage />)
const { container } = render(<ExtLedgerAccessPopup />)

expect(container).toMatchSnapshot()
})

it('should render success state', async () => {
jest.mocked(requestDevice).mockResolvedValue({} as USBDevice)

render(<ConnectDevicePage />)
render(<ExtLedgerAccessPopup />)

await userEvent.click(screen.getByRole('button'))

Expand All @@ -40,7 +40,7 @@ describe('<ConnectDevicePage />', () => {
it('should render error state', async () => {
jest.mocked(requestDevice).mockRejectedValue(new Error('error'))

render(<ConnectDevicePage />)
render(<ExtLedgerAccessPopup />)

userEvent.click(screen.getByRole('button'))

Expand Down
4 changes: 2 additions & 2 deletions extension/src/popup/routes.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { RouteObject } from 'react-router-dom'
import { App } from 'app'
import { ConnectDevicePage } from 'app/pages/ConnectDevicePage'
import { ExtLedgerAccessPopup } from '../ExtLedgerAccessPopup/ExtLedgerAccessPopup'
import { FromLedgerWebExtension } from 'app/pages/OpenWalletPage/webextension'
import { commonRoutes } from '../../../src/commonRoutes'
import { SelectOpenMethod } from '../../../src/app/pages/OpenWalletPage'
Expand All @@ -24,6 +24,6 @@ export const routes: RouteObject[] = [
},
{
path: 'open-wallet/connect-device',
element: <ConnectDevicePage />,
element: <ExtLedgerAccessPopup />,
},
]

0 comments on commit 849bf52

Please sign in to comment.