aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/organisms/toolbar/settings.test.tsx
blob: 66fa6a676812a277e15b7c71f53caafcc0492a4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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
        motionStorageKey="reduced-motion"
        isActive={false}
        setIsActive={doNothing}
      />
    );
    expect(
      rtlScreen.getByRole('checkbox', { name: 'Open settings' })
    ).toBeInTheDocument();
  });

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