Skip to content

Commit 10b113b

Browse files
committed
[Typography foundations] Add tests for InlineCode component
1 parent 0feec08 commit 10b113b

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import React from 'react';
2+
import {mountWithApp} from 'tests/utilities';
3+
4+
import {InlineCode} from '../InlineCode';
5+
6+
describe('<Text />', () => {
7+
const text = 'Hello world';
8+
9+
it('renders its children', () => {
10+
const inlineCode = mountWithApp(<InlineCode>{text}</InlineCode>);
11+
expect(inlineCode).toContainReactText(text);
12+
});
13+
14+
it('renders its children inside a code tag', () => {
15+
const inlineCode = mountWithApp(<InlineCode>{text}</InlineCode>);
16+
expect(inlineCode).toContainReactComponent('code');
17+
});
18+
19+
it('renders its children with code block styling', () => {
20+
const inlineCode = mountWithApp(<InlineCode>{text}</InlineCode>);
21+
expect(inlineCode).toContainReactComponent('code', {
22+
className: expect.stringContaining('Code'),
23+
});
24+
});
25+
});

0 commit comments

Comments
 (0)