-
Notifications
You must be signed in to change notification settings - Fork 2.8k
/
Copy pathDialog.cy.tsx
31 lines (26 loc) · 977 Bytes
/
Dialog.cy.tsx
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
import * as React from 'react';
import { mount as mountBase } from '@cypress/react';
import { Dialog, DialogSurface, DialogTrigger, DialogBody, Button } from '@fluentui/react-components';
import { Provider } from '../Provider/Provider';
const mount = (element: JSX.Element) => {
mountBase(<Provider>{element}</Provider>);
};
describe('Dialog', () => {
it('should render a Dialog', () => {
mount(
<Dialog>
<DialogTrigger>
<Button>Open dialog</Button>
</DialogTrigger>
<DialogSurface>
<DialogBody>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam exercitationem cumque repellendus eaque
est dolor eius expedita nulla ullam? Tenetur reprehenderit aut voluptatum impedit voluptates in natus iure
cumque eaque?
</DialogBody>
</DialogSurface>
</Dialog>,
);
cy.get('button').click().get('.fui-DialogSurface').should('exist');
});
});