Skip to content
Snippets Groups Projects
Commit b5915abb authored by Tadeusz Miesiąc's avatar Tadeusz Miesiąc
Browse files

test(missing test): added missing test case

parent 930ce2b0
No related branches found
No related tags found
2 merge requests!223reset the pin numbers before search results are fetch (so the results will be...,!46feat(submaps drawer component): submaps drawer component
Pipeline #80529 failed
import { StoreType } from '@/redux/store';
import { getReduxWrapperWithStore } from '@/utils/testing/getReduxWrapperWithStore';
import {
InitialStoreState,
getReduxWrapperWithStore,
} from '@/utils/testing/getReduxWrapperWithStore';
import { render, screen } from '@testing-library/react';
import { initialStateFixture } from '@/redux/drawer/drawerFixture';
import { TopBar } from './TopBar.component';
const renderComponent = (): { store: StoreType } => {
const { Wrapper, store } = getReduxWrapperWithStore();
const renderComponent = (initialStoreState: InitialStoreState = {}): { store: StoreType } => {
const { Wrapper, store } = getReduxWrapperWithStore(initialStoreState);
return (
render(
......@@ -25,4 +29,16 @@ describe('TopBar - component', () => {
expect(screen.getByTestId('user-avatar')).toBeInTheDocument();
expect(screen.getByTestId('search-bar')).toBeInTheDocument();
});
it('should open submaps drawer on submaps button click', () => {
const { store } = renderComponent({ drawer: initialStateFixture });
const button = screen.getByRole('button', { name: 'Submaps' });
button.click();
const { isOpen, drawerName } = store.getState().drawer;
expect(isOpen).toBe(true);
expect(drawerName).toBe('submaps');
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment