mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-05 05:28:20 +08:00
0dcd6e8c22
* fix(InputNumber): Fix incorrect disable state style for input box components with front and rear label configuration * fix(InputNumber): Add case previews for pre and post tags and prefix activation in the disabled state in InputNumber, and add corresponding test cases * fix(InputNumber): Fix the issue of incorrect inputNumber background color caused by the original prefix icon being disabled * fix(InputNumber): Remove the toggle disable state interaction in the addon case * fix(InputNumber): Optimize and merge style processing * fix(InputNumber): Adjust the addon case and remove irrelevant cases * fix(InputNumber): Update the snapshot in the InputNumber component unit test * fix(InputNumber): Fix the issue of incorrect test snapshots caused by adjusting the controls in the disabled state display * fix(InputNumber): Fix the issue of incorrect test snapshots caused by adjusting the controls in the disabled state display * fix(InputNumber): Fix the issue of incorrect test snapshots caused by adjusting the controls in the disabled state display * fix(InputNumber): Fix the issue of incorrect test snapshots caused by adjusting the controls in the disabled state display * fix(InputNumber): Fix the issue of incorrect test snapshots caused by adjusting the controls in the disabled state display
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-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-wrapper-disabled')).toBeInTheDocument();
|
|
expect(container.querySelector('.ant-input-number-affix-wrapper-disabled')).toBeInTheDocument();
|
|
});
|
|
});
|