Skip to content

Commit

Permalink
fixup! Feat(web-react): Introduce UNSTABLE_Toggle component #DS-1346
Browse files Browse the repository at this point in the history
  • Loading branch information
curdaj committed Jul 18, 2024
1 parent 9e273b5 commit d3a475d
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,19 @@ describe('UNSTABLE_Toggle', () => {
it('should have label classname', () => {
render(<UNSTABLE_Toggle id="test-toggle" label="Toggle Label" />);

expect(screen.getByText('Toggle Label')).toHaveClass('UNSTABLE_Toggle__label');
expect(screen.getByText('Toggle Label')).toContainHTML('label');
const label = screen.getByText('Toggle Label');

expect(label).toHaveClass('UNSTABLE_Toggle__label');
expect(label).toContainHTML('label');
});

it('should have label with required classname', () => {
render(<UNSTABLE_Toggle id="test-toggle" label="Toggle Label" isRequired />);

expect(screen.getByText('Toggle Label')).toHaveClass('UNSTABLE_Toggle__label');
expect(screen.getByText('Toggle Label')).toHaveClass('UNSTABLE_Toggle__label--required');
const label = screen.getByText('Toggle Label');

expect(label).toHaveClass('UNSTABLE_Toggle__label');
expect(label).toHaveClass('UNSTABLE_Toggle__label--required');
});

it('should have hidden classname', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { UNSTABLE_Toggle } from '..';
import UNSTABLE_Toggle from '../UNSTABLE_Toggle';

const ToggleDisabled = () => (
<>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { UNSTABLE_Toggle } from '..';
import UNSTABLE_Toggle from '../UNSTABLE_Toggle';

const ToggleFluid = () => <UNSTABLE_Toggle id="toggle-fluid" label="Toggle Label" name="default" isFluid />;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { UNSTABLE_Toggle } from '..';
import UNSTABLE_Toggle from '../UNSTABLE_Toggle';

const ToggleHelperText = () => (
<>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { UNSTABLE_Toggle } from '..';
import UNSTABLE_Toggle from '../UNSTABLE_Toggle';

const ToggleHiddenLabel = () => (
<UNSTABLE_Toggle id="toggle-hidden-label" label="Toggle Label" name="default" isLabelHidden />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { UNSTABLE_Toggle } from '..';
import UNSTABLE_Toggle from '../UNSTABLE_Toggle';

const ToggleIndicators = () => (
<>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { UNSTABLE_Toggle } from '..';
import UNSTABLE_Toggle from '../UNSTABLE_Toggle';

const ToggleRequired = () => <UNSTABLE_Toggle id="toggle-required" label="Toggle Label" name="default" isRequired />;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { UNSTABLE_Toggle } from '..';
import UNSTABLE_Toggle from '../UNSTABLE_Toggle';

const ToggleValidation = () => (
<>
Expand Down

0 comments on commit d3a475d

Please sign in to comment.