ant-design/components/typography/__tests__/prefixCls.test.tsx
Matthew 52dedca8ed
fix: Pass custom prefixCls to Typography from Base (#38580) (#38586)
* fix: Pass custom prefixCls to Typography from Base (#38580)

* test: Added test for typography custom prefixCls
2022-11-16 10:23:51 +08:00

21 lines
654 B
TypeScript

import React from 'react';
import { render } from '../../../tests/utils';
import Base from '../Base';
describe('Typography keep prefixCls', () => {
describe('Base', () => {
it('should support className when has prefix', () => {
const { container: wrapper } = render(
<Base component="p" prefixCls="custom-prefixCls" className="custom-class">
test prefixCls
</Base>,
);
expect(
(wrapper.firstChild as HTMLElement)?.className.includes('custom-prefixCls'),
).toBeTruthy();
expect((wrapper.firstChild as HTMLElement)?.className.includes('custom-class')).toBeTruthy();
});
});
});