|
@@ -6,6 +6,9 @@ import { clustersPayload } from 'redux/reducers/clusters/__test__/fixtures';
|
|
|
import userEvent from '@testing-library/user-event';
|
|
|
import fetchMock from 'fetch-mock';
|
|
|
|
|
|
+const burgerButtonOptions = { name: 'burger' };
|
|
|
+const logoutButtonOptions = { name: 'Log out' };
|
|
|
+
|
|
|
describe('App', () => {
|
|
|
describe('initial state', () => {
|
|
|
beforeEach(() => {
|
|
@@ -24,11 +27,16 @@ describe('App', () => {
|
|
|
within(header).getByText('UI for Apache Kafka')
|
|
|
).toBeInTheDocument();
|
|
|
expect(within(header).getAllByRole('separator').length).toEqual(3);
|
|
|
- expect(within(header).getByRole('button')).toBeInTheDocument();
|
|
|
+ expect(
|
|
|
+ within(header).getByRole('button', burgerButtonOptions)
|
|
|
+ ).toBeInTheDocument();
|
|
|
+ expect(
|
|
|
+ within(header).getByRole('button', logoutButtonOptions)
|
|
|
+ ).toBeInTheDocument();
|
|
|
});
|
|
|
it('handle burger click correctly', () => {
|
|
|
const header = screen.getByLabelText('Page Header');
|
|
|
- const burger = within(header).getByRole('button');
|
|
|
+ const burger = within(header).getByRole('button', burgerButtonOptions);
|
|
|
const sidebar = screen.getByLabelText('Sidebar');
|
|
|
const overlay = screen.getByLabelText('Overlay');
|
|
|
expect(sidebar).toBeInTheDocument();
|