Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions frontend/messages/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -460,13 +460,16 @@
},
"wizard": {
"keysStaySafe": "Canary har kun brug for dette til at overvåge dine transaktioner. Dine private nøgler forbliver sikre i din wallet.",
"tryBaconWallet": "Ny her? Prøv med en eksempel-wallet først for at se, hvordan Canary fungerer.",
"useBaconWallet": "Brug Bacon Wallet",
"guidesPrompt": "Unsure how to obtain output descriptors or XPUBs? Follow our guides below:",
"trySampleWallet": "Ny her? Prøv med en eksempel-wallet først for at se, hvordan Canary fungerer.",
"sampleWallets": {
"bacon": "Brug Bacon Wallet",
"satoshi-genesis": "Brug Satoshi Genesis-adresse"
},
"guidesPrompt": "Er du i tvivl om, hvordan du finder output descriptors eller XPUB'er? Følg vores vejledninger nedenfor:",
"exportSteps": "Følg disse trin for at eksportere din descriptor fra {walletName}",
"pasteXpub": "Indsæt din XPUB nedenfor.",
"pasteDescriptor": "Indsæt din output descriptor eller XPUB nedenfor.",
"baconPrefilled": "Vi har udfyldt Bacon eksempel-wallet for dig. Klik blot på Tilføj Wallet for at fortsætte.",
"samplePrefilled": "Vi har udfyldt {name} eksempel-wallet for dig. Klik blot på Tilføj Wallet for at fortsætte.",
"enterDetails": "Indtast detaljer",
"walletType": {
"software": "software",
Expand Down
11 changes: 7 additions & 4 deletions frontend/messages/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -460,13 +460,16 @@
},
"wizard": {
"keysStaySafe": "Canary braucht dies nur, um Ihre Transaktionen zu überwachen. Ihre privaten Schlüssel bleiben sicher in Ihrer Wallet.",
"tryBaconWallet": "Neu hier? Probieren Sie zuerst eine Beispiel-Wallet aus, um zu sehen, wie Canary funktioniert.",
"useBaconWallet": "Bacon-Wallet verwenden",
"guidesPrompt": "Unsure how to obtain output descriptors or XPUBs? Follow our guides below:",
"trySampleWallet": "Neu hier? Probieren Sie zuerst eine Beispiel-Wallet aus, um zu sehen, wie Canary funktioniert.",
"sampleWallets": {
"bacon": "Bacon-Wallet verwenden",
"satoshi-genesis": "Satoshi Genesis-Adresse verwenden"
},
"guidesPrompt": "Unsicher, wie Sie Output-Deskriptoren oder XPUBs erhalten? Folgen Sie unseren Anleitungen unten:",
"exportSteps": "Befolgen Sie diese Schritte, um Ihren Descriptor aus {walletName} zu exportieren",
"pasteXpub": "Fügen Sie Ihren XPUB unten ein.",
"pasteDescriptor": "Fügen Sie Ihren Output-Descriptor oder XPUB unten ein.",
"baconPrefilled": "Wir haben die Bacon-Beispiel-Wallet für Sie vorausgefüllt. Klicken Sie einfach auf Wallet hinzufügen, um fortzufahren.",
"samplePrefilled": "Wir haben die {name}-Beispiel-Wallet für Sie vorausgefüllt. Klicken Sie einfach auf Wallet hinzufügen, um fortzufahren.",
"enterDetails": "Details eingeben",
"walletType": {
"software": "Software",
Expand Down
9 changes: 6 additions & 3 deletions frontend/messages/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -460,13 +460,16 @@
},
"wizard": {
"keysStaySafe": "Canary only needs your output descriptor, XPUB, or address to monitor your transactions. Your private keys stay safe in your wallet.",
"tryBaconWallet": "New here? Try with a sample wallet first to see how Canary works.",
"useBaconWallet": "Use Bacon Wallet",
"trySampleWallet": "New here? Try with a sample wallet first to see how Canary works.",
"sampleWallets": {
"bacon": "Use Bacon Wallet",
"satoshi-genesis": "Use Satoshi Genesis Address"
},
"guidesPrompt": "Unsure how to obtain output descriptors or XPUBs? Follow our guides below:",
"exportSteps": "Follow these steps to export your descriptor from {walletName}",
"pasteXpub": "Paste your XPUB below.",
"pasteDescriptor": "Paste your output descriptor or XPUB below.",
"baconPrefilled": "We've prefilled the Bacon sample wallet for you. Just click Add Wallet to continue.",
"samplePrefilled": "We've prefilled the {name} sample wallet for you. Just click Add Wallet to continue.",
"enterDetails": "Enter Details",
"walletType": {
"software": "software",
Expand Down
11 changes: 7 additions & 4 deletions frontend/messages/es-419.json
Original file line number Diff line number Diff line change
Expand Up @@ -460,13 +460,16 @@
},
"wizard": {
"keysStaySafe": "Canary solo necesita esto para monitorear tus transacciones. Tus claves privadas permanecen seguras en tu billetera.",
"tryBaconWallet": "¿Nuevo aquí? Prueba primero con una billetera de muestra para ver cómo funciona Canary.",
"useBaconWallet": "Usar Billetera Bacon",
"guidesPrompt": "Unsure how to obtain output descriptors or XPUBs? Follow our guides below:",
"trySampleWallet": "¿Nuevo aquí? Prueba primero con una billetera de muestra para ver cómo funciona Canary.",
"sampleWallets": {
"bacon": "Usar Billetera Bacon",
"satoshi-genesis": "Usar Dirección Satoshi Genesis"
},
"guidesPrompt": "¿No estás seguro de cómo obtener descriptores de salida o XPUBs? Sigue nuestras guías a continuación:",
"exportSteps": "Sigue estos pasos para exportar tu descriptor desde {walletName}",
"pasteXpub": "Pega tu XPUB abajo.",
"pasteDescriptor": "Pega tu descriptor de salida o XPUB abajo.",
"baconPrefilled": "Hemos rellenado la billetera de muestra Bacon para ti. Solo haz clic en Agregar Billetera para continuar.",
"samplePrefilled": "Hemos rellenado la billetera de muestra {name} para ti. Solo haz clic en Agregar Billetera para continuar.",
"enterDetails": "Ingresar Detalles",
"walletType": {
"software": "software",
Expand Down
11 changes: 7 additions & 4 deletions frontend/messages/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -460,13 +460,16 @@
},
"wizard": {
"keysStaySafe": "Canary n'a besoin de cela que pour surveiller vos transactions. Vos clés privées restent en sécurité dans votre portefeuille.",
"tryBaconWallet": "Nouveau ici ? Essayez d'abord avec un portefeuille exemple pour voir comment fonctionne Canary.",
"useBaconWallet": "Utiliser le portefeuille Bacon",
"guidesPrompt": "Unsure how to obtain output descriptors or XPUBs? Follow our guides below:",
"trySampleWallet": "Nouveau ici ? Essayez d'abord avec un portefeuille exemple pour voir comment fonctionne Canary.",
"sampleWallets": {
"bacon": "Utiliser le portefeuille Bacon",
"satoshi-genesis": "Utiliser l'adresse Satoshi Genesis"
},
"guidesPrompt": "Vous ne savez pas comment obtenir des descripteurs de sortie ou des XPUBs ? Suivez nos guides ci-dessous :",
"exportSteps": "Suivez ces étapes pour exporter votre descripteur depuis {walletName}",
"pasteXpub": "Collez votre XPUB ci-dessous.",
"pasteDescriptor": "Collez votre descripteur de sortie ou XPUB ci-dessous.",
"baconPrefilled": "Nous avons prérempli le portefeuille exemple Bacon pour vous. Cliquez simplement sur Ajouter le portefeuille pour continuer.",
"samplePrefilled": "Nous avons prérempli le portefeuille exemple {name} pour vous. Cliquez simplement sur Ajouter le portefeuille pour continuer.",
"enterDetails": "Entrer les détails",
"walletType": {
"software": "logiciel",
Expand Down
11 changes: 7 additions & 4 deletions frontend/messages/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -460,13 +460,16 @@
},
"wizard": {
"keysStaySafe": "Canaryはトランザクションの監視にのみ必要です。秘密鍵はウォレット内で安全に保管されます。",
"tryBaconWallet": "初めてですか?まずサンプルウォレットでCanaryの動作を確認してください。",
"useBaconWallet": "Baconウォレットを使用",
"guidesPrompt": "Unsure how to obtain output descriptors or XPUBs? Follow our guides below:",
"trySampleWallet": "初めてですか?まずサンプルウォレットでCanaryの動作を確認してください。",
"sampleWallets": {
"bacon": "Baconウォレットを使用",
"satoshi-genesis": "Satoshi Genesisアドレスを使用"
},
"guidesPrompt": "出力ディスクリプタやXPUBの取得方法がわからない場合は、以下のガイドをご覧ください:",
"exportSteps": "{walletName}からディスクリプタをエクスポートするには、以下の手順に従ってください",
"pasteXpub": "下にXPUBを貼り付けてください。",
"pasteDescriptor": "下に出力ディスクリプタまたはXPUBを貼り付けてください。",
"baconPrefilled": "Baconサンプルウォレットを事前入力しました。ウォレットを追加をクリックして続行してください。",
"samplePrefilled": "{name}サンプルウォレットを事前入力しました。ウォレットを追加をクリックして続行してください。",
"enterDetails": "詳細を入力",
"walletType": {
"software": "ソフトウェア",
Expand Down
11 changes: 7 additions & 4 deletions frontend/messages/nb.json
Original file line number Diff line number Diff line change
Expand Up @@ -460,13 +460,16 @@
},
"wizard": {
"keysStaySafe": "Canary trenger bare dette for å overvåke transaksjonene dine. Dine private nøkler forblir trygge i lommeboken din.",
"tryBaconWallet": "Ny her? Prøv med en prøvelommebok først for å se hvordan Canary fungerer.",
"useBaconWallet": "Bruk Bacon-lommebok",
"guidesPrompt": "Unsure how to obtain output descriptors or XPUBs? Follow our guides below:",
"trySampleWallet": "Ny her? Prøv med en prøvelommebok først for å se hvordan Canary fungerer.",
"sampleWallets": {
"bacon": "Bruk Bacon-lommebok",
"satoshi-genesis": "Bruk Satoshi Genesis-adresse"
},
"guidesPrompt": "Usikker på hvordan du henter output-deskriptorer eller XPUB-er? Følg veiledningene våre nedenfor:",
"exportSteps": "Følg disse trinnene for å eksportere deskriptoren fra {walletName}",
"pasteXpub": "Lim inn XPUB nedenfor.",
"pasteDescriptor": "Lim inn output-deskriptoren eller XPUB nedenfor.",
"baconPrefilled": "Vi har forhåndsutfylt Bacon-prøvelommeboken for deg. Bare klikk på Legg til lommebok for å fortsette.",
"samplePrefilled": "Vi har forhåndsutfylt {name}-prøvelommeboken for deg. Bare klikk på Legg til lommebok for å fortsette.",
"enterDetails": "Skriv inn detaljer",
"walletType": {
"software": "programvare",
Expand Down
11 changes: 7 additions & 4 deletions frontend/messages/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -460,13 +460,16 @@
},
"wizard": {
"keysStaySafe": "O Canary só precisa disso para monitorar suas transações. Suas chaves privadas permanecem seguras na sua carteira.",
"tryBaconWallet": "Novo aqui? Experimente primeiro com uma carteira de amostra para ver como o Canary funciona.",
"useBaconWallet": "Usar Carteira Bacon",
"guidesPrompt": "Unsure how to obtain output descriptors or XPUBs? Follow our guides below:",
"trySampleWallet": "Novo aqui? Experimente primeiro com uma carteira de amostra para ver como o Canary funciona.",
"sampleWallets": {
"bacon": "Usar Carteira Bacon",
"satoshi-genesis": "Usar Endereço Satoshi Genesis"
},
"guidesPrompt": "Não tem certeza de como obter descritores de saída ou XPUBs? Siga nossos guias abaixo:",
"exportSteps": "Siga estes passos para exportar seu descritor do {walletName}",
"pasteXpub": "Cole seu XPUB abaixo.",
"pasteDescriptor": "Cole seu descritor de saída ou XPUB abaixo.",
"baconPrefilled": "Preenchemos a carteira de amostra Bacon para você. Basta clicar em Adicionar Carteira para continuar.",
"samplePrefilled": "Preenchemos a carteira de amostra {name} para você. Basta clicar em Adicionar Carteira para continuar.",
"enterDetails": "Inserir Detalhes",
"walletType": {
"software": "software",
Expand Down
11 changes: 7 additions & 4 deletions frontend/messages/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -460,13 +460,16 @@
},
"wizard": {
"keysStaySafe": "Canary behöver bara detta för att övervaka dina transaktioner. Dina privata nycklar förblir säkra i din plånbok.",
"tryBaconWallet": "Ny här? Prova med en exempelplånbok först för att se hur Canary fungerar.",
"useBaconWallet": "Använd Bacon Wallet",
"guidesPrompt": "Unsure how to obtain output descriptors or XPUBs? Follow our guides below:",
"trySampleWallet": "Ny här? Prova med en exempelplånbok först för att se hur Canary fungerar.",
"sampleWallets": {
"bacon": "Använd Bacon Wallet",
"satoshi-genesis": "Använd Satoshi Genesis-adress"
},
"guidesPrompt": "Osäker på hur du hittar output descriptors eller XPUB:ar? Följ våra guider nedan:",
"exportSteps": "Följ dessa steg för att exportera din deskriptor från {walletName}",
"pasteXpub": "Klistra in din XPUB nedan.",
"pasteDescriptor": "Klistra in din utdata-deskriptor eller XPUB nedan.",
"baconPrefilled": "Vi har fyllt i Bacon-exempelplånboken åt dig. Klicka bara på Lägg till plånbok för att fortsätta.",
"samplePrefilled": "Vi har fyllt i {name}-exempelplånboken åt dig. Klicka bara på Lägg till plånbok för att fortsätta.",
"enterDetails": "Ange detaljer",
"walletType": {
"software": "mjukvara",
Expand Down
84 changes: 77 additions & 7 deletions frontend/src/app/wallets/add/[[...slug]]/__tests__/page.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { render, screen, waitFor, act, fireEvent } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import AddWalletPage from '../page'
import { SAMPLE_WALLET_SLUG } from '@/components/add-wallet-form'
import { SAMPLE_WALLETS } from '@/components/add-wallet-form'
// Import ApiError from utils to use in tests
import { ApiError } from '../../../../../lib/utils'

Expand Down Expand Up @@ -142,7 +142,7 @@ describe('AddWalletPage', () => {

it('shows form with prefilled data for bacon wallet', async () => {
await act(async () => {
renderWithSlug([SAMPLE_WALLET_SLUG])
renderWithSlug([SAMPLE_WALLETS[0].slug])
})

await waitFor(() => {
Expand Down Expand Up @@ -176,7 +176,7 @@ describe('AddWalletPage', () => {
}
})

it('shows Bacon wallet option for first wallet', async () => {
it('shows sample wallet options for first wallet', async () => {
walletsContextMockValue = { ...defaultWalletsContextMock, wallets: [] }

await act(async () => {
Expand All @@ -187,10 +187,11 @@ describe('AddWalletPage', () => {
expect(screen.getByText('Use Bacon Wallet')).toBeInTheDocument()
})

expect(screen.getByText('Use Satoshi Genesis Address')).toBeInTheDocument()
expect(screen.getByText(/Try with a sample wallet/)).toBeInTheDocument()
})

it('hides Bacon wallet option when wallets exist', async () => {
it('hides sample wallet options when non-sample wallets exist', async () => {
walletsContextMockValue = {
...defaultWalletsContextMock,
wallets: [{ checksum: 'test', name: 'Test Wallet' }] as never[],
Expand All @@ -205,6 +206,47 @@ describe('AddWalletPage', () => {
})

expect(screen.queryByText('Use Bacon Wallet')).not.toBeInTheDocument()
expect(screen.queryByText('Use Satoshi Genesis Address')).not.toBeInTheDocument()
})

it('still shows remaining sample wallets when one sample wallet is added', async () => {
walletsContextMockValue = {
...defaultWalletsContextMock,
wallets: [{ checksum: 'bacon123', name: 'Bacon' }] as never[],
}

await act(async () => {
renderWithSlug(undefined)
})

await waitFor(() => {
expect(screen.getByText('Use Satoshi Genesis Address')).toBeInTheDocument()
})

// Bacon should not be shown since it's already added
expect(screen.queryByText('Use Bacon Wallet')).not.toBeInTheDocument()
})

it('hides sample prompt when all sample wallets are added', async () => {
walletsContextMockValue = {
...defaultWalletsContextMock,
wallets: [
{ checksum: 'bacon123', name: 'Bacon' },
{ checksum: 'satoshi123', name: 'Satoshi (Genesis)' },
] as never[],
}

await act(async () => {
renderWithSlug(undefined)
})

await waitFor(() => {
expect(screen.getByText('Sparrow')).toBeInTheDocument()
})

expect(screen.queryByText(/Try with a sample wallet/)).not.toBeInTheDocument()
expect(screen.queryByText('Use Bacon Wallet')).not.toBeInTheDocument()
expect(screen.queryByText('Use Satoshi Genesis Address')).not.toBeInTheDocument()
})
})

Expand All @@ -223,7 +265,7 @@ describe('AddWalletPage', () => {
}
})

it('hides Bacon wallet option in cloud mode', async () => {
it('hides sample wallet options in cloud mode', async () => {
walletsContextMockValue = { ...defaultWalletsContextMock, wallets: [] }

await act(async () => {
Expand All @@ -235,6 +277,7 @@ describe('AddWalletPage', () => {
})

expect(screen.queryByText('Use Bacon Wallet')).not.toBeInTheDocument()
expect(screen.queryByText('Use Satoshi Genesis Address')).not.toBeInTheDocument()
})

it('shows upgrade prompt when wallet limit reached', async () => {
Expand Down Expand Up @@ -285,7 +328,7 @@ describe('AddWalletPage', () => {
expect(screen.getByText('Sparrow')).toBeInTheDocument()
})

it('navigates to bacon form when Bacon wallet is clicked', async () => {
it('fills form inline when Bacon wallet is clicked', async () => {
const user = userEvent.setup()
walletsContextMockValue = { ...defaultWalletsContextMock, wallets: [] }

Expand All @@ -299,7 +342,34 @@ describe('AddWalletPage', () => {

await user.click(screen.getByText('Use Bacon Wallet'))

expect(mockPush).toHaveBeenCalledWith(`/wallets/add/${SAMPLE_WALLET_SLUG}`)
// Form should be filled inline, no navigation
expect(mockPush).not.toHaveBeenCalled()
const nameInput = screen.getByLabelText('Wallet Name') as HTMLInputElement
await waitFor(() => {
expect(nameInput.value).toBe('Bacon')
})
})

it('fills form inline when Satoshi Genesis is clicked', async () => {
const user = userEvent.setup()
walletsContextMockValue = { ...defaultWalletsContextMock, wallets: [] }

await act(async () => {
renderWithSlug(undefined)
})

await waitFor(() => {
expect(screen.getByText('Use Satoshi Genesis Address')).toBeInTheDocument()
})

await user.click(screen.getByText('Use Satoshi Genesis Address'))

// Form should be filled inline, no navigation
expect(mockPush).not.toHaveBeenCalled()
const nameInput = screen.getByLabelText('Wallet Name') as HTMLInputElement
await waitFor(() => {
expect(nameInput.value).toBe('Satoshi (Genesis)')
})
})
})

Expand Down
Loading
Loading