Skip to content

Commit c3b3b29

Browse files
author
WB01676250
committed
fix: typography
1 parent b497bf8 commit c3b3b29

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

components/typography/__tests__/copy.test.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import * as copyObj from 'copy-to-clipboard';
55
import { fireEvent, render, renderHook, waitFakeTimer, waitFor } from '../../../tests/utils';
66
import Base from '../Base';
77
import useCopyClick from '../hooks/useCopyClick';
8+
import Link from '../Link';
89

910
describe('Typography copy', () => {
1011
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
@@ -388,4 +389,21 @@ describe('Typography copy', () => {
388389

389390
spy.mockRestore();
390391
});
392+
393+
it('link should merge correct props when disabled and copyable', () => {
394+
const { getByText } = render(
395+
<Link href="https://ant.design" disabled copyable title="Disabled Link">
396+
Disabled Link
397+
</Link>,
398+
);
399+
400+
const element = getByText('Disabled Link').closest('.ant-typography');
401+
402+
expect(element?.tagName.toLowerCase()).toBe('span');
403+
404+
expect(element?.getAttribute('role')).toBe('link');
405+
expect(element?.getAttribute('aria-disabled')).toBe('true');
406+
407+
expect(element?.getAttribute('title')).toBe('Disabled Link');
408+
});
391409
});

0 commit comments

Comments
 (0)