overleaf/services/web/test/frontend/features/editor-navigation-toolbar/components/layout-dropdown-button.test.js
Jessica Lawshe 3ad686c30b Merge pull request #5630 from overleaf/jel-layout-dropdown
New project layout dropdown

GitOrigin-RevId: 8d7f4ff6649fe249b762642e70522597e5e78dd4
2021-11-04 09:03:44 +00:00

23 lines
774 B
JavaScript

import { render, screen } from '@testing-library/react'
import LayoutDropdownButton from '../../../../../frontend/js/features/editor-navigation-toolbar/components/layout-dropdown-button'
describe('<LayoutDropdownButton />', function () {
const defaultProps = {
handleChangeLayout: () => {},
pdfLayout: 'flat',
view: 'editor',
}
it('should mark current layout option as selected (visually by checkmark, and aria-label for accessibility)', function () {
render(<LayoutDropdownButton {...defaultProps} />)
screen.getByRole('menuitem', {
name: 'Editor & PDF',
})
screen.getByRole('menuitem', {
name: 'PDF only (hide editor)',
})
screen.getByRole('menuitem', {
name: 'Selected Editor only (hide PDF)',
})
})
})