mirror of
https://github.com/tompro/sattle.git
synced 2026-10-26 01:49:58 +00:00
test(e2e): clean the e2e program's diagnostics
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { test, expect } from '../fixtures';
|
||||
import type { Page } from '@playwright/test';
|
||||
import { MINT2_ORIGIN } from '../helpers/MintMocker';
|
||||
import { createFreshWallet, fundMockMintWallet } from '../helpers/wallet';
|
||||
import { fundMockMintWallet } from '../helpers/wallet';
|
||||
|
||||
const AMOUNT_MSAT = 50_000; // 50 sats
|
||||
// 64 hex chars - a valid payment receipt, distinct from the claimed note secret
|
||||
|
||||
@@ -212,7 +212,7 @@ test.describe('NWC settings page', () => {
|
||||
// NIP-47 client sends: kind 23194, NIP-04 encrypted to the service,
|
||||
// schnorr-signed by the connection's client secret
|
||||
const invoice = 'lnbc210n1pjqrstuvwxyz';
|
||||
const content = await nip04Encrypt(
|
||||
const content = nip04Encrypt(
|
||||
clientSecret,
|
||||
walletServicePubkey,
|
||||
JSON.stringify({ method: 'pay_invoice', params: { invoice } }),
|
||||
@@ -254,7 +254,7 @@ test.describe('NWC settings page', () => {
|
||||
);
|
||||
if (!responseEvent) throw new Error('the service published no response');
|
||||
const response: unknown = JSON.parse(
|
||||
await nip04Decrypt(clientSecret, walletServicePubkey, responseEvent.content),
|
||||
nip04Decrypt(clientSecret, walletServicePubkey, responseEvent.content),
|
||||
);
|
||||
if (typeof response !== 'object' || response === null) {
|
||||
throw new Error('the service response is not an object');
|
||||
|
||||
@@ -7,7 +7,6 @@ import {
|
||||
noteSignature,
|
||||
verifyNoteSignature,
|
||||
} from 'lnurlcash-kit';
|
||||
import { MINT_ORIGIN } from '../helpers/MintMocker';
|
||||
import { fundMockMintWallet } from '../helpers/wallet';
|
||||
|
||||
const FUNDING_MSAT = 50_000; // 50 sats
|
||||
|
||||
@@ -3,6 +3,14 @@ import type { Page, TestInfo } from '@playwright/test';
|
||||
import { test, expect } from '../fixtures';
|
||||
import { createFreshWallet } from '../helpers/wallet';
|
||||
|
||||
// the dev-only lifecycle hook (boot/wallet.ts) used to drive the forget
|
||||
// transition, which has no UI surface
|
||||
declare global {
|
||||
interface Window {
|
||||
__sattleWalletTest: { state: () => string; forget: () => Promise<void> };
|
||||
}
|
||||
}
|
||||
|
||||
const MINT_KEY_A = `02${'aa'.repeat(32)}`;
|
||||
const MINT_KEY_B = `03${'bb'.repeat(32)}`;
|
||||
const MINT_KEY_C = `02${'cc'.repeat(32)}`;
|
||||
|
||||
Reference in New Issue
Block a user