This repository has been archived by the owner on Nov 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add glossaryitem tests and update snapshots
- Loading branch information
Dom Harrington
committed
Jun 28, 2018
1 parent
e4ecf84
commit 76dc904
Showing
4 changed files
with
31 additions
and
49 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,27 @@ | ||
const React = require('react'); | ||
const { shallow } = require('enzyme'); | ||
|
||
const GlossaryItem = require('../src/GlossaryItem'); | ||
|
||
test('should output a glossary item if the term exists', () => { | ||
const term = 'acme'; | ||
const definition = 'This is a definition'; | ||
const glossaryItem = shallow( | ||
<GlossaryItem | ||
term={term} | ||
terms={[{ term, definition }]} | ||
/>, | ||
); | ||
|
||
expect(glossaryItem.find('.glossary-item.highlight').text()).toBe(term); | ||
expect(glossaryItem.find('.tooltip-content-body').text()).toBe(`- ${term} - ${definition}`); | ||
}); | ||
|
||
test('should output nothing if the term does not exist', () => { | ||
expect(shallow( | ||
<GlossaryItem | ||
term="something" | ||
terms={[]} | ||
/>, | ||
).html()).toBe(null); | ||
}); |
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
6 changes: 3 additions & 3 deletions
6
packages/api-explorer/__tests__/block-types/__snapshots__/CallOut.test.jsx.snap
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`should render body 1`] = `"<div><p>body</p></div>"`; | ||
exports[`should render body 1`] = `"<p>body</p>"`; | ||
|
||
exports[`should render markdown in body 1`] = ` | ||
"<div><h1 class=\\"header-scroll\\"><div class=\\"anchor waypoint\\" id=\\"section-heading\\"></div>heading<a class=\\"fa fa-anchor\\" href=\\"#section-heading\\"></a></h1> | ||
<p><code><span class=\\"cm-s-neo\\">test</span></code></p></div>" | ||
"<h1 class=\\"header-scroll\\"><div class=\\"anchor waypoint\\" id=\\"section-heading\\"></div>heading<a class=\\"fa fa-anchor\\" href=\\"#section-heading\\"></a></h1> | ||
<p><code><span class=\\"cm-s-neo\\">test</span></code></p>" | ||
`; |
45 changes: 0 additions & 45 deletions
45
packages/api-explorer/__tests__/lib/markdown/renderer.test.js
This file was deleted.
Oops, something went wrong.