From 1b9c5cdb30338649f5a9fec187e1c2f35061565f Mon Sep 17 00:00:00 2001 From: NasgulNexus Date: Mon, 11 Mar 2024 19:26:10 +0100 Subject: [PATCH] test(Playwright): add beforeMount theme and mobile provider --- playwright/core/DynamicForm.tsx | 26 ++++++++++---------------- playwright/core/DynamicView.tsx | 10 +--------- playwright/playwright/index.tsx | 15 +++++++++++++++ 3 files changed, 26 insertions(+), 25 deletions(-) diff --git a/playwright/core/DynamicForm.tsx b/playwright/core/DynamicForm.tsx index 4a10f7e3..4aac0365 100644 --- a/playwright/core/DynamicForm.tsx +++ b/playwright/core/DynamicForm.tsx @@ -1,7 +1,5 @@ import React from 'react'; -import {MobileProvider, ThemeProvider} from '@gravity-ui/uikit'; - import noop from 'lodash/noop'; import {Form} from 'react-final-form'; @@ -13,19 +11,15 @@ export const DynamicForm = ({spec}: {spec: Spec}) => { const generateRandomValue = () => 'value'; return ( - - -
- {() => ( - - )} - -
-
+
+ {() => ( + + )} + ); }; diff --git a/playwright/core/DynamicView.tsx b/playwright/core/DynamicView.tsx index c0a6fab5..494ffe0a 100644 --- a/playwright/core/DynamicView.tsx +++ b/playwright/core/DynamicView.tsx @@ -1,18 +1,10 @@ import React from 'react'; -import {MobileProvider, ThemeProvider} from '@gravity-ui/uikit'; - import {DynamicView as DynamicViewBase} from '../../src/lib/core/components/View/DynamicView'; import {Spec} from '../../src/lib/core/types/specs'; import {FormValue} from '../../src/lib/core/types/value'; import {dynamicViewConfig} from '../../src/lib/kit/constants/config'; export const DynamicView = ({spec, value}: {spec: Spec; value: FormValue}) => { - return ( - - - - - - ); + return ; }; diff --git a/playwright/playwright/index.tsx b/playwright/playwright/index.tsx index 67aac616..9ca09e1c 100644 --- a/playwright/playwright/index.tsx +++ b/playwright/playwright/index.tsx @@ -1 +1,16 @@ +import React from 'react'; + +import {beforeMount} from '@playwright/experimental-ct-react/hooks'; +import {MobileProvider, ThemeProvider} from '@gravity-ui/uikit'; + import './index.scss'; + +beforeMount(async ({App}) => { + return ( + + + + + + ); +});