overleaf/services/web/test/frontend/features/editor-left-menu/components/actions-copy-project.test.js
M Fahru b85ae6e58e Migrate actions menu in editor left menu to react (#10102)
* Migrate actions menu in editor left menu to react

* Move margin from inline style to css file

* remove focus selector to avoid "highlighting" the button after closing modal and regain focus

* Add disabled state on word count button when the compiling is loading or failed

* Use div instead of button for disabled word count button

* Add accessibility text props when LeftMenuButton is disabled

* Add actions menu test cases and storybook components

* use util assign function and wrap function prop in usecallback

GitOrigin-RevId: 81ab104be21fbcf5dfbc72c07d29eeb32976c61f
2022-10-28 08:05:14 +00:00

18 lines
642 B
JavaScript

import { fireEvent, screen } from '@testing-library/dom'
import fetchMock from 'fetch-mock'
import ActionsCopyProject from '../../../../../frontend/js/features/editor-left-menu/components/actions-copy-project'
import { renderWithEditorContext } from '../../../helpers/render-with-context'
describe('<ActionsCopyProject />', function () {
afterEach(function () {
fetchMock.reset()
})
it('shows correct modal when clicked', async function () {
renderWithEditorContext(<ActionsCopyProject />)
fireEvent.click(screen.getByRole('button', { name: 'Copy Project' }))
screen.getByPlaceholderText('New Project Name')
})
})