-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add test for heading and tag component (#123)
- Loading branch information
1 parent
8dc3c59
commit 914e736
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react' | ||
import { render, screen } from '../../utils/testUtils' | ||
|
||
import Heading from '.' | ||
|
||
describe('<Heading/>', () => { | ||
it('should render the heading', () => { | ||
render( | ||
<Heading> | ||
<span>This is the heading</span> | ||
</Heading> | ||
) | ||
|
||
expect(screen.getByText('This is the heading')).toBeInTheDocument() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react' | ||
import { render, screen } from '../../utils/testUtils' | ||
|
||
import Tag from '.' | ||
|
||
describe('<Tag/>', () => { | ||
it('should render the tag value given', () => { | ||
render(<Tag value="coffee" />) | ||
|
||
expect(screen.getByText('coffee')).toBeInTheDocument() | ||
}) | ||
|
||
it('should render tag with uppercase content', async () => { | ||
const dom = render(<Tag value="coffee" isUppercase={true} />) | ||
|
||
expect(dom.getByText(/COFFEE/i)).toBeInTheDocument() | ||
}) | ||
}) |