Skip to content

Commit

Permalink
feat(Slider): add new slider component (#893)
Browse files Browse the repository at this point in the history
* feat(slider): add new slider component

* fix: undo changing alias-tokens

* fix: update tokens

* fix: comments

* fix: comments

* fix: extract code

* fix: aria-label

* fix: lock and snapshot
  • Loading branch information
savutsang authored Oct 29, 2024
1 parent 14322de commit 4d8cdab
Show file tree
Hide file tree
Showing 15 changed files with 1,428 additions and 8 deletions.
1 change: 1 addition & 0 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"url": "https://github.com/kronostechnologies/design-elements/issues"
},
"dependencies": {
"@mui/base": "5.0.0-beta.60",
"@tanstack/react-table": "^8.10.7",
"date-fns": "^4.0.0",
"feather-icons": "^4.29.0",
Expand Down
22 changes: 22 additions & 0 deletions packages/react/src/components/slider/slider.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { renderWithProviders } from '../../test-utils/renderer';
import { Slider } from './slider';

describe('Slider', () => {
test('matches snapshot (single value)', () => {
const wrapper = renderWithProviders(<Slider label="Label" max={100} min={0} value={20} />);

expect(wrapper).toMatchSnapshot();
});

test('matches snapshot (range values)', () => {
const wrapper = renderWithProviders(<Slider label="Label" max={100} min={0} value={[10, 30]} />);

expect(wrapper).toMatchSnapshot();
});

test('matches snapshot (with step)', () => {
const wrapper = renderWithProviders(<Slider label="Label" max={100} min={0} value={30} step={10} />);

expect(wrapper).toMatchSnapshot();
});
});
Loading

0 comments on commit 4d8cdab

Please sign in to comment.