Skip to content

Commit

Permalink
test: revert test (#48909)
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ authored May 14, 2024
1 parent 973305d commit a2d8659
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions components/theme/__tests__/token.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import theme from '..';
import { render, renderHook } from '../../../tests/utils';
import ConfigProvider from '../../config-provider';
import type { ThemeConfig } from '../../config-provider/context';
import Input from '../../input';
import Row from '../../row';
import Slider from '../../slider';
import genRadius from '../themes/shared/genRadius';

const { useToken } = theme;
Expand Down Expand Up @@ -314,30 +314,24 @@ describe('Theme', () => {
<ConfigProvider
theme={{
components: {
Slider: {
Input: {
colorPrimary: '#00B96B',
algorithm,
},
},
}}
>
<Slider value={5} />
<Input />
</ConfigProvider>
);

const { container, rerender } = render(<Demo />);
expect(container.querySelector('.ant-slider-track')).toHaveStyle({
'background-color': '#91caff',
});
expect(container.querySelector('input')).toHaveStyle({ 'border-color': '#4096ff' });

rerender(<Demo algorithm />);
expect(container.querySelector('.ant-slider-track')).toHaveStyle({
'background-color': '#6ce0a4',
});
expect(container.querySelector('input')).toHaveStyle({ 'border-color': '#20c77c' });

rerender(<Demo algorithm={theme.darkAlgorithm} />);
expect(container.querySelector('.ant-slider-track')).toHaveStyle({
'background-color': '#0e462e',
});
expect(container.querySelector('input')).toHaveStyle({ 'border-color': '#1fb572' });
});
});

0 comments on commit a2d8659

Please sign in to comment.