aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/organisms/toolbar/settings.test.tsx
blob: 6dbed2bd3e35211dcf2edb6d11292af9269dbee1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { describe, expect, it } from '@jest/globals';
import { render, screen as rtlScreen } from '../../../../tests/utils';
import { Settings } from './settings';

const doNothing = () => {
  // do nothing
};

describe('Settings', () => {
  it('renders a button to open settings modal', () => {
    render(<Settings isActive={false} setIsActive={doNothing} />);
    expect(
      rtlScreen.getByRole('checkbox', { name: 'Open settings' })
    ).toBeInTheDocument();
  });

  it('renders a button to close settings modal', () => {
    render(<Settings isActive={true} setIsActive={doNothing} />);
    expect(
      rtlScreen.getByRole('checkbox', { name: 'Close settings' })
    ).toBeInTheDocument();
  });
});