UNPKG

@reown/appkit-scaffold-ui

Version:

The full stack toolkit to build onchain app UX.

29 lines 1.56 kB
import { fixture } from '@open-wc/testing'; import { afterEach, describe, expect, it, vi } from 'vitest'; import { html } from 'lit'; import { RouterController } from '@reown/appkit-controllers'; import { W3mAccountNftsWidget } from '../../src/partials/w3m-account-nfts-widget'; import { HelpersUtil } from '../utils/HelpersUtil'; const TITLE = 'nft-template-title'; const DESCRIPTION = 'nft-template-description'; const LINK_RECEIVE_FUNDS = 'link-receive-funds'; describe('W3mAccountNftsWidget', () => { afterEach(() => { vi.resetAllMocks(); }); it('it should display basic content', async () => { const accountsNftsWidget = await fixture(html `<w3m-account-nfts-widget></w3m-account-nfts-widget>`); const title = HelpersUtil.getByTestId(accountsNftsWidget, TITLE); const description = HelpersUtil.getByTestId(accountsNftsWidget, DESCRIPTION); expect(HelpersUtil.getTextContent(title)).toBe('Coming soon'); expect(HelpersUtil.getTextContent(description)).toBe('Stay tuned for our upcoming NFT feature'); }); it('it should navigate to wallet receive view if link is clicked', async () => { vi.spyOn(RouterController, 'push'); const accountsNftsWidget = await fixture(html `<w3m-account-nfts-widget></w3m-account-nfts-widget>`); const link = HelpersUtil.getByTestId(accountsNftsWidget, LINK_RECEIVE_FUNDS); link.click(); expect(RouterController.push).toHaveBeenCalledWith('WalletReceive'); }); }); //# sourceMappingURL=w3m-account-nfts-widget.test.js.map