From 1095155702059bf440b55e52b5aa1187e4ade9c8 Mon Sep 17 00:00:00 2001 From: Bernardo Sunderhus Date: Thu, 13 Oct 2022 11:39:15 +0000 Subject: [PATCH] chore: removes unnecessary tests --- .../react-dialog/e2e/DialogTrigger.e2e.tsx | 103 ------------------ .../DialogTrigger/DialogTrigger.test.tsx | 14 --- 2 files changed, 117 deletions(-) delete mode 100644 packages/react-components/react-dialog/e2e/DialogTrigger.e2e.tsx diff --git a/packages/react-components/react-dialog/e2e/DialogTrigger.e2e.tsx b/packages/react-components/react-dialog/e2e/DialogTrigger.e2e.tsx deleted file mode 100644 index 9de66aec81f438..00000000000000 --- a/packages/react-components/react-dialog/e2e/DialogTrigger.e2e.tsx +++ /dev/null @@ -1,103 +0,0 @@ -import * as React from 'react'; -import { mount as mountBase } from '@cypress/react'; - -import { FluentProvider } from '@fluentui/react-provider'; -import { teamsLightTheme } from '@fluentui/react-theme'; - -import { - Dialog, - DialogActions, - DialogBody, - DialogContent, - DialogSurface, - DialogTitle, - DialogTrigger, -} from '@fluentui/react-dialog'; -import { Button } from '@fluentui/react-components'; -import { dialogSurfaceSelector, dialogTriggerOpenSelector } from './selectors'; - -const mount = (element: JSX.Element) => mountBase({element}); - -describe('DialogTrigger', () => { - it(`should not open dialog when 'aria-disabled' is true`, () => { - mount( - - - - - - - Dialog title - - 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? - - - - - - - - - - , - ); - cy.get(dialogTriggerOpenSelector).realClick(); - cy.get(dialogSurfaceSelector).should('not.exist'); - }); - it(`should open dialog when 'aria-disabled' is false`, () => { - mount( - - - - - - - Dialog title - - 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? - - - - - - - - - - , - ); - cy.get(dialogTriggerOpenSelector).realClick(); - cy.get(dialogSurfaceSelector).should('exist'); - }); - it('should work with any element besides - - - - - - , - ); - cy.get(dialogTriggerOpenSelector).realClick(); - cy.get(dialogSurfaceSelector).should('exist'); - }); -}); diff --git a/packages/react-components/react-dialog/src/components/DialogTrigger/DialogTrigger.test.tsx b/packages/react-components/react-dialog/src/components/DialogTrigger/DialogTrigger.test.tsx index 0e94dbdc315a12..9d49031ea4ceac 100644 --- a/packages/react-components/react-dialog/src/components/DialogTrigger/DialogTrigger.test.tsx +++ b/packages/react-components/react-dialog/src/components/DialogTrigger/DialogTrigger.test.tsx @@ -95,20 +95,6 @@ describe('DialogTrigger', () => { `); }); - it('should not open dialog when aria-disabled is true', () => { - const requestOpenChange = jest.fn(); - mockUseDialogContext({ requestOpenChange }); - - const { getByRole } = render( - - - , - ); - fireEvent.click(getByRole('button')); - - expect(requestOpenChange).toBeCalledTimes(0); - }); - it('should open dialog when aria-disabled is false', () => { const requestOpenChange = jest.fn(); mockUseDialogContext({ requestOpenChange });