Skip to content

Commit

Permalink
Fix failing unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
benmalcom committed Jul 2, 2024
1 parent bc01be2 commit 46eb765
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions src/lib/near-fastauth-wallet.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
import { setupFastAuthWallet } from './near-fastauth-wallet';

describe('nearFastauthWallet', () => {
it('should work', () => {
expect(setupFastAuthWallet()).toEqual('near-fastauth-wallet');
describe('nearFastAuthWallet', () => {
it('Should create a FastAuthWallet with correct metadata', async () => {
const walletFactory = setupFastAuthWallet({
walletUrl: 'https://wallet.url',
});
expect(walletFactory).toBeInstanceOf(Object);

const factoryOptions = {
languageCode: undefined,
network: {
networkId: 'testnet',
},
debug: false,
optimizeWalletOrder: false,
randomizeWalletOrder: false,
relayerUrl: undefined,
};

const walletModule = await walletFactory({ options: factoryOptions });
expect(walletModule.id).toBe('fast-auth-wallet');
expect(walletModule.type).toBe('browser');
expect(walletModule.metadata.name).toBe('FastAuthWallet');
expect(walletModule.metadata.walletUrl).toBe('https://wallet.url');
});
});

0 comments on commit 46eb765

Please sign in to comment.