Skip to content

Commit

Permalink
chore: updating tests
Browse files Browse the repository at this point in the history
  • Loading branch information
georgewrmarshall committed Nov 23, 2024
1 parent 4aa61a2 commit f62ebe9
Showing 1 changed file with 2 additions and 34 deletions.
36 changes: 2 additions & 34 deletions packages/design-system-react/src/components/text/Text.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
TextTransform,
OverflowWrap,
} from '.';
import { ValidTag } from './Text.types';
import { TEXT_CLASS_MAP } from './Text.constants';

describe('Text Component', () => {
Expand Down Expand Up @@ -84,37 +83,6 @@ describe('Text Component', () => {
});
});

describe('HTML Elements', () => {
const regularElements: ValidTag[] = [
'dd',
'div',
'dt',
'em',
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
'li',
'p',
'span',
'strong',
'ul',
'label',
'header',
'a',
'button',
];

regularElements.forEach((tag) => {
it(`renders as ${tag} element when specified`, () => {
const { container } = render(<Text as={tag}>Test</Text>);
expect(container.firstChild?.nodeName.toLowerCase()).toBe(tag);
});
});
});

describe('Combined Props', () => {
it('combines all styling props correctly', () => {
const { container } = render(
Expand All @@ -128,9 +96,9 @@ describe('Text Component', () => {
overflowWrap={OverflowWrap.BreakWord}
ellipsis
className="custom-class"
as="div"
asChild
>
Test
<div>Test</div>
</Text>,
);

Expand Down

0 comments on commit f62ebe9

Please sign in to comment.