Update Sidebar test with new UI
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
Siklos 2022-08-08 11:33:46 +02:00
parent 6fe4025a58
commit 6b8531d3ae

View file

@ -5,29 +5,23 @@ import Sidebar from './Sidebar';
describe.concurrent('Sidebar', () => {
it('Start default', () => {
const handleClick = vi.fn();
render(
<Sidebar
componentOptions={[]}
isOpen={true}
onClick={handleClick}
buttonOnClick={() => {}}
/>
);
const stuff = screen.queryByText(/stuff/i);
const close = screen.getByText(/close/i);
expect(screen.getByText(/Components/i).classList.contains('left-0')).toBeDefined();
expect(stuff).toBeNull();
fireEvent.click(close);
expect(handleClick).toHaveBeenCalledTimes(1);
});
it('Start close', () => {
render(<Sidebar
componentOptions={[]}
isOpen={false}
onClick={() => {}}
buttonOnClick={() => {}}
/>);
@ -49,7 +43,6 @@ describe.concurrent('Sidebar', () => {
}
]}
isOpen={true}
onClick={() => {}}
buttonOnClick={handleButtonClick}
/>);
const stuff = screen.getByText(/stuff/i);