mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 16:06:28 +08:00
feat(descriptions): support html attributes id
type (#46367)
test(descriptions): add html attributes `id` test close #46350 Co-authored-by: lijianan <574980606@qq.com>
This commit is contained in:
parent
2cc68acd9e
commit
0a671878ec
@ -188,6 +188,16 @@ describe('Descriptions', () => {
|
||||
expect(wrapper.container.firstChild).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('Descriptions support id', () => {
|
||||
const wrapper = render(
|
||||
<Descriptions id="descriptions">
|
||||
<Descriptions.Item>Cloud Database</Descriptions.Item>
|
||||
</Descriptions>,
|
||||
);
|
||||
const descriptionItemsElement = wrapper.container.querySelector('#descriptions');
|
||||
expect(descriptionItemsElement).not.toBeNull();
|
||||
});
|
||||
|
||||
it('keep key', () => {
|
||||
render(
|
||||
<Descriptions>
|
||||
|
@ -47,6 +47,7 @@ export interface DescriptionsProps {
|
||||
labelStyle?: React.CSSProperties;
|
||||
contentStyle?: React.CSSProperties;
|
||||
items?: DescriptionsItemType[];
|
||||
id?: string;
|
||||
}
|
||||
|
||||
const Descriptions: React.FC<DescriptionsProps> & CompoundedComponent = (props) => {
|
||||
|
Loading…
Reference in New Issue
Block a user