Commit 9f7b884d authored by Max Alekseenko's avatar Max Alekseenko

add test for marketplace app modal

parent 84571f45
import { test, expect, devices } from '@playwright/experimental-ct-react';
import type { Page, Route } from '@playwright/test';
import React from 'react';
import { apps as appsMock } from 'mocks/apps/apps';
import TestApp from 'playwright/TestApp';
import MarketplaceAppModal from './MarketplaceAppModal';
const props = {
onClose: () => {},
onFavoriteClick: () => {},
data: appsMock[0],
isFavorite: false,
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const testFn = async({ mount, page }: { mount: any; page: Page }) => {
await page.route(appsMock[0].logo, (route: Route) =>
route.fulfill({
status: 200,
path: './playwright/mocks/image_s.jpg',
}),
);
await mount(
<TestApp>
<MarketplaceAppModal { ...props }/>
</TestApp>,
);
await expect(page).toHaveScreenshot();
};
test('base view +@dark-mode', testFn);
test.describe('mobile', () => {
test.use({ viewport: devices['iPhone 13 Pro'].viewport });
test('base view', testFn);
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment