-
Notifications
You must be signed in to change notification settings - Fork 113
Expand file tree
/
Copy pathcomponent.tsx
More file actions
42 lines (38 loc) · 1.37 KB
/
component.tsx
File metadata and controls
42 lines (38 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// ***********************************************************
// This example support/component.ts is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************
import '@ui5/webcomponents-react/dist/Assets.js';
import { ThemeProvider } from '@ui5/webcomponents-react/ThemeProvider';
// Alternatively you can use CommonJS syntax:
// require('./commands')
import { mount } from 'cypress/react';
// Import commands.js using ES2015 syntax:
import './commands';
// Augment the Cypress namespace to include type definitions for
// your custom command.
// Alternatively, can be defined in cypress/support/component.d.ts
// with a <reference path="./component" /> at the top of your spec.
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace Cypress {
interface Chainable {
mount: typeof mount;
}
}
}
Cypress.Commands.add('mount', (component, options) => {
return mount(<ThemeProvider>{component}</ThemeProvider>, options);
});
// Example use:
// cy.mount(<MyComponent />)