File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 */
88
99import React , { ReactNode } from 'react' ;
10- import { EuiProvider } from '../../../src' ;
10+ import { EuiProvider , EuiProviderProps } from '../../../src' ;
1111import type { mount } from '@cypress/react18' ;
1212
1313// Pick cypress mount function based on which React version is currently being
@@ -20,8 +20,16 @@ if (process.env.REACT_VERSION === '18') {
2020 cypressMount = require ( '@cypress/react' ) . mount ;
2121}
2222
23- const mountCommand = ( children : ReactNode ) : ReturnType < typeof mount > => {
24- return cypressMount ( < EuiProvider > { children } </ EuiProvider > ) ;
23+ export interface MountOptions {
24+ providerProps ?: Partial < EuiProviderProps < any > > ;
25+ }
26+
27+ const mountCommand = (
28+ children : ReactNode ,
29+ options : MountOptions = { }
30+ ) : ReturnType < typeof mount > => {
31+ const { providerProps } = options ;
32+ return cypressMount ( < EuiProvider { ...providerProps } > { children } </ EuiProvider > ) ;
2533} ;
2634
2735// Export only the type to not confuse code-completion tools
You can’t perform that action at this time.
0 commit comments