Skip to content

Commit

Permalink
Merge pull request #33 from near/fix-failing-unit-test
Browse files Browse the repository at this point in the history
Fix failing unit test
  • Loading branch information
charleslavon authored Jul 3, 2024
2 parents bc01be2 + 46eb765 commit 5ea996f
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 5ea996f

Please sign in to comment.