Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add util tests #480

Merged
merged 16 commits into from
Mar 3, 2017
Prev Previous commit
Next Next commit
Add tests for /util/glossary.js
  • Loading branch information
Jeremia Kimelman committed Mar 1, 2017
commit 724fb10427f412bcdd3a230761ff9fb614a40d86
19 changes: 19 additions & 0 deletions test/util/glossary.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* eslint no-undef: 0 */

import mapCrimeToGlossaryTerm from '../../src/util/glossary'

describe('glossary utility', () => {
it('default export should be a function', () => {
expect(typeof mapCrimeToGlossaryTerm).toEqual('function')
})

it('should return a term if it exists', () => {
const actual = mapCrimeToGlossaryTerm('larceny-theft')
expect(actual).toEqual('larceny')
})

it('should return undefined if there is no matching term', () => {
const actual = mapCrimeToGlossaryTerm('fake-term')
expect(actual).toEqual(undefined)
})
})