mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-16 09:39:10 +08:00
3af521d422
* feat: Input filled variant * feat: InputNumber filled variant * feat: mentions variant * fix: TextArea status with affix * chore: update snapshot * chore: update snapshot * feat: pagination input * fix: fix diff * feat: input-number disabled * fixL InputNumber * chore: update snapshot * feat: better style * chore: update * chore: update snapshot * feat: use variant classNames * chore: update snapshot * feat: mentions affix style * chore
40 lines
1.2 KiB
TypeScript
40 lines
1.2 KiB
TypeScript
import React from 'react';
|
|
import InputNumber from '..';
|
|
import { render } from '../../../tests/utils';
|
|
|
|
describe('addon', () => {
|
|
it('disabled status when prefix is active', () => {
|
|
const { container } = render(<InputNumber prefix="¥" defaultValue={100} disabled controls />);
|
|
expect(container.querySelector('.ant-input-number-affix-wrapper-disabled')).toBeInTheDocument();
|
|
});
|
|
|
|
it('disabled status when addon is active', () => {
|
|
const { container } = render(
|
|
<InputNumber
|
|
prefix="¥"
|
|
addonBefore="Before"
|
|
addonAfter="After"
|
|
defaultValue={100}
|
|
disabled
|
|
controls
|
|
/>,
|
|
);
|
|
expect(container.querySelector('.ant-input-number-group-wrapper-disabled')).toBeInTheDocument();
|
|
});
|
|
|
|
it('disabled status when prefix and addon is active', () => {
|
|
const { container } = render(
|
|
<InputNumber
|
|
prefix="¥"
|
|
addonBefore="Before"
|
|
addonAfter="After"
|
|
defaultValue={100}
|
|
disabled
|
|
controls
|
|
/>,
|
|
);
|
|
expect(container.querySelector('.ant-input-number-group-wrapper-disabled')).toBeInTheDocument();
|
|
expect(container.querySelector('.ant-input-number-affix-wrapper-disabled')).toBeInTheDocument();
|
|
});
|
|
});
|