Skip to content

Commit

Permalink
fix: test typing
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarenaldi committed Dec 17, 2024
1 parent ec9029a commit 3e7e329
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions packages/client/src/actions/onboarding.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { assertOk, never } from '@lens-protocol/types';
import { describe, expect, it } from 'vitest';

import { type Account, Role } from '@lens-protocol/graphql';
import { uri } from '@lens-protocol/types';
import { loginAsOnboardingUser, signer, signerWallet } from '../../testing-utils';
import { handleWith } from '../viem';
import { createAccountWithUsername, fetchAccount } from './account';
Expand All @@ -24,15 +25,13 @@ describe('Given an onboarding user', () => {
// Create an account with username
createAccountWithUsername(sessionClient, {
username: { localName: `testname${Date.now()}` },
metadataUri: `data:application/json,${JSON.stringify(metadata)}`,
metadataUri: uri(`data:application/json,${JSON.stringify(metadata)}`),
})
// Sign if necessary
// biome-ignore lint/suspicious/noExplicitAny: temporary
.andThen(handleWith(walletClient) as any)
.andThen(handleWith(walletClient))

// Wait for the transaction to be mined
// biome-ignore lint/suspicious/noExplicitAny: temporary
.andThen(sessionClient.waitForTransaction as any)
.andThen(sessionClient.waitForTransaction)

// Fetch the account
.andThen((txHash) => fetchAccount(sessionClient, { txHash }))
Expand All @@ -42,7 +41,11 @@ describe('Given an onboarding user', () => {
})

// Switch to the newly created account
.andThen((account) => sessionClient.switchAccount({ account: account?.address })),
.andThen((account) =>
sessionClient.switchAccount({
account: account?.address ?? never('Account not found'),
}),
),
)
.match(
(value) => value,
Expand Down

0 comments on commit 3e7e329

Please sign in to comment.