Files
explore/ui/token/TokenInventory.pw.tsx
tom goriunovandGitHub bd4094ebd1 Bump up Node.js to v22 (#2410)
* Bump up Node.js to v22

Fixes #2404

* update Playwright to v1.49.0

* fix tests

* one more fix

* fix screenshots
2024-11-25 12:43:05 +01:00

41 lines
1.0 KiB
TypeScript

import { Box } from '@chakra-ui/react';
import React from 'react';
import { tokenInfoERC721a } from 'mocks/tokens/tokenInfo';
import { base as tokenInstance } from 'mocks/tokens/tokenInstance';
import { test, expect } from 'playwright/lib';
import TokenInventory from './TokenInventory';
test('base view +@mobile', async({ render, mockAssetResponse }) => {
const item = { ...tokenInstance, image_url: null };
await mockAssetResponse(tokenInstance.image_url as string, './playwright/mocks/image_s.jpg');
const component = await render(
<Box pt={{ base: '134px', lg: 0 }}>
<TokenInventory
// @ts-ignore:
inventoryQuery={{
data: {
items: [ tokenInstance, item, item ],
next_page_params: { unique_token: 1 },
},
// @ts-ignore:
pagination: { page: 1, isVisible: true },
}}
// @ts-ignore:
tokenQuery={{
data: tokenInfoERC721a,
}}
/>
</Box>,
);
await expect(component).toHaveScreenshot();
});