diff --git a/src/components/Slider/Slider.test.tsx b/src/components/Slider/Slider.test.tsx index 8db9dc1..faf45ff 100644 --- a/src/components/Slider/Slider.test.tsx +++ b/src/components/Slider/Slider.test.tsx @@ -98,7 +98,7 @@ describe('The Slider component', () => { it('displays a boundary slider', () => { setup({ variant: 'boundary' }); - expect(screen.getAllByRole('slider')).toHaveLength(3); + expect(screen.getByRole('slider')).toBeInTheDocument(); }); it('displays the correct boundary slider min and max texts', () => { diff --git a/src/components/Slider/Slider.tsx b/src/components/Slider/Slider.tsx index bdfa7b6..e0b148b 100644 --- a/src/components/Slider/Slider.tsx +++ b/src/components/Slider/Slider.tsx @@ -1,4 +1,4 @@ -import { StyleProps, useMediaQuery } from '@chakra-ui/react'; +import { Box, StyleProps, useMediaQuery } from '@chakra-ui/react'; import React, { useEffect, useMemo, useState } from 'react'; import { Slider, @@ -48,6 +48,8 @@ export const BoemlySlider: React.FC = ({ const [sliderValue, setSliderValue] = useState(initialValue); const [inputValue, setInputValue] = useState(initialValue.toString()); + const sliderHeight = 4; + // Update internal sliderValue when the external value prop changes useEffect(() => { if (value !== undefined) { @@ -84,11 +86,13 @@ export const BoemlySlider: React.FC = ({ mt="8" > - - - - - + = ({ - - - - - +