{"size": 1255, "ext": "js", "max_stars_repo_path": "__tests__/Switch.test.js", "max_stars_repo_name": "marcin-mazurek/react-polymorph", "max_stars_repo_stars_event_min_datetime": "2017-09-11T00:25:48.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-19T02:09:26.000Z", "max_issues_repo_path": "__tests__/Switch.test.js", "max_issues_repo_name": "marcin-mazurek/react-polymorph", "max_issues_repo_issues_event_min_datetime": "2017-07-03T21:27:46.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T12:45:35.000Z", "max_forks_repo_path": "__tests__/Switch.test.js", "max_forks_repo_name": "marcin-mazurek/react-polymorph", "max_forks_repo_forks_event_min_datetime": "2017-12-06T12:18:34.000Z", "max_forks_repo_forks_event_max_datetime": "2022-01-18T19:31:19.000Z"}
{"max_stars_count": 78, "max_issues_count": 98, "max_forks_count": 20, "avg_line_length": 22.0175438596, "max_line_length": 63, "alphanum_fraction": 0.635059761}
import React from 'react';

import { Checkbox } from '../source/components/Checkbox';
import { SwitchSkin } from '../source/skins/simple/SwitchSkin';
import { IDENTIFIERS } from '../source/components';
import { renderInSimpleTheme } from './helpers/theming';

test('Switch renders correctly', () => {
  expect(renderInSimpleTheme(
    <Checkbox
      themeId={IDENTIFIERS.SWITCH}
      skin={SwitchSkin}
    />
  )).toMatchSnapshot();
});

test('Switch renders with label', () => {
  expect(renderInSimpleTheme(
    <Checkbox
      themeId={IDENTIFIERS.SWITCH}
      label="click here"
      skin={SwitchSkin}
    />
  )).toMatchSnapshot();
});

test('Switch is disabled', () => {
  expect(renderInSimpleTheme(
    <Checkbox
      themeId={IDENTIFIERS.SWITCH}
      disabled
      skin={SwitchSkin}
    />
  )).toMatchSnapshot();
});

test('Switch is disabled and renders a label', () => {
  expect(renderInSimpleTheme(
    <Checkbox
      themeId={IDENTIFIERS.SWITCH}
      disabled
      label="click here"
      skin={SwitchSkin}
    />
  )).toMatchSnapshot();
});

test('Switch is checked', () => {
  expect(renderInSimpleTheme(
    <Checkbox
      themeId={IDENTIFIERS.SWITCH}
      checked
      skin={SwitchSkin}
    />
  )).toMatchSnapshot();
});
