Skip to content

Commit ba952ae

Browse files
committed
test(emoji): Added test for Emoji class and modified base test filename.
1 parent a5b011b commit ba952ae

5 files changed

Lines changed: 27 additions & 2 deletions

File tree

src/modules/emoticons/smiley.es6

Whitespace-only changes.

test/index.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/index.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
require('./modules/utils.test');
2+
require('./modules/emoticons/emoji.test');
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
var Emoji = require('../../../src/modules/emoticons/emoji.es6');
2+
var expect = require('chai').expect;
3+
4+
var string = 'I am happy :smile:';
5+
var string2 = 'I am happy :smile: :+1:';
6+
7+
var emoji = new Emoji(string);
8+
var emoji2 = new Emoji(string2);
9+
10+
describe('Emoji Unit test', function(){
11+
"use strict";
12+
13+
it('should return a string', function(){
14+
expect(emoji.process()).to.be.a('string');
15+
});
16+
17+
it('should convert a emoji text into emoji', function(){
18+
expect(emoji.process()).to.equal(`I am happy <span class="emoticon emoticon-smile" title=":smile:"></span>`);
19+
expect(emoji2.process()).to.equal(
20+
`I am happy <span class="emoticon emoticon-smile" title=":smile:"></span> <span class="emoticon emoticon-+1" title=":+1:"></span>`
21+
)
22+
})
23+
});
24+
25+
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
var utils = require('../../src/modules/utils.es6');
2-
var mocha = require('mocha');
32
var expect = require('chai').expect;
43

54
describe('toUrl() method',function(){

0 commit comments

Comments
 (0)