Last active
December 12, 2016 14:10
-
-
Save thiagoa/35cf1d068847a6b20023cbab5bd35f83 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import { expect } from 'chai'; | |
| import parseOneTweet from 'app/twitter/parseOneTweet'; | |
| describe('parseOneTweet', () => { | |
| it('returns a tweet object with parsed text', () => { | |
| const tweet = { | |
| created_at: '2016-01-01T00:00:00.000-03:00', | |
| mentions: ['dude'], | |
| text: '@dude 1 shot of Tequila\n\n2 shots of Tequila...\n3 shots of Tequila...', | |
| }; | |
| const newTweet = parseOneTweet(tweet); | |
| expect(newTweet.created_at).to.equal('2016-01-01T00:00:00.000-03:00'); | |
| expect(newTweet.mentions).to.deep.equal(['dude']); | |
| expect(newTweet.text).to.equal( | |
| '<p><a href="#" data-js-mention>@dude</a> 1 shot of Tequila</p>' + | |
| '<p>2 shots of Tequila...<br>3 shots of Tequila...</p>' | |
| ); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment