Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Blaine Schmeisser
committed
Aug 3, 2016
1 parent
6b44ba0
commit 0461436
Showing
7 changed files
with
75 additions
and
2 deletions.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
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
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,36 @@ | ||
const expect = require('chai').expect | ||
const present = require('../src/lib/present') | ||
|
||
const clips = { | ||
short_hex: { _id: 1, type: 'text', raw: '#fff', createdAt: new Date() }, | ||
long_hex: { _id: 2, type: 'text', raw: '#000000', createdAt: new Date() }, | ||
word: { _id: 3, type: 'text', raw: 'Quadrupoles', createdAt: new Date() }, | ||
} | ||
|
||
describe('Present', () => { | ||
describe('given a short hex color', () => { | ||
it('finds the literal pole', () => { | ||
const clip = clips.short_hex | ||
const results = present([clip]) | ||
expect(results[0].preview).to.contain('color') | ||
expect(results[0].preview).to.contain('light') | ||
}) | ||
}) | ||
|
||
describe('given a long hex color', () => { | ||
it('finds the case insensntive pole', () => { | ||
const clip = clips.long_hex | ||
const results = present([clip]) | ||
expect(results[0].preview).to.contain('color') | ||
expect(results[0].preview).to.contain('dark') | ||
}) | ||
}) | ||
|
||
describe('given a word', () => { | ||
it('does not find the pole with extra characters', () => { | ||
const clip = clips.word | ||
const results = present([clip]) | ||
expect(results[0].preview).to.not.contain('color') | ||
}) | ||
}) | ||
}) |