Skip to content

Commit

Permalink
chore: update test
Browse files Browse the repository at this point in the history
  • Loading branch information
MadCcc authored and RedJue committed Aug 17, 2023
1 parent f29b475 commit 9e3b697
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions components/descriptions/__tests__/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,17 @@ describe('Descriptions', () => {

it('Should Descriptions not throw react key prop error in jsx mode', () => {
render(
<Descriptions>
<Descriptions.Item key="1">Test key prop</Descriptions.Item>
<Descriptions title="User Info">
<Descriptions.Item key="1" label="UserName">
Zhou Maomao
</Descriptions.Item>
<Descriptions.Item label="Telephone">1810000000</Descriptions.Item>
</Descriptions>,
);
// expect(errorSpy).not.toHaveBeenCalledWith(
// 'Warning: DescriptionsItem: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)',
// );
expect(errorSpy).not.toHaveBeenCalled();
expect(errorSpy).not.toHaveBeenCalledWith(
expect.stringContaining('`key` is not a prop'),
expect.anything(),
expect.anything(),
);
});
});

0 comments on commit 9e3b697

Please sign in to comment.