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

Feature/emoji-hasEmoji #54

Merged
merged 14 commits into from
Jul 21, 2017
Merged

Feature/emoji-hasEmoji #54

merged 14 commits into from
Jul 21, 2017

Conversation

smeijer
Copy link

@smeijer smeijer commented Jul 16, 2017

Add Emoji.hasEmoji method. This PR is build upon #53, so either that one should be merged first, or this one should be refactored.

Readme should also cover Emoji.hasEmojiByName and Emoji.hasEmojiByCode, but like I wrote in #53, I think the readme could use a general makeover. So I wanted to postpone that change, to keep the upcoming release more agile. Emoji.hasEmoji is covered by the readme update.

This PR turnes the tests below green:

describe('hasEmoji', function() {

    it('Should be able to check a emoji by :name:', function() {
      var result = emoji.hasEmoji(':heart:');
      result.should.equal(true)
    });

    it('Should be able to check a emoji by name', function() {
      var result = emoji.hasEmoji('heart');
      result.should.equal(true);
    });

    it('Should be able to check a emoji by code text form)', function() {
      var result = emoji.hasEmoji('❤');
      result.should.equal(true);
    });

    it('Should be able to check a emoji by code in variant form', function() {
      var result = emoji.hasEmoji('❤️');
      result.should.equal(true);
    });

    it('Should return false for unknown emoji names', function() {
      var result = emoji.hasEmoji(':pizza-kiss-coffee:');
      result.should.equal(false);
    });

    it('Should return false for unknown emoji codes', function() {
      var result = emoji.hasEmoji('🍕❤️‍💋‍☕');
      result.should.equal(false);
    });

  });

@omnidan
Copy link
Owner

omnidan commented Jul 21, 2017

thank you so much 😁

@omnidan omnidan merged commit 6eeaecd into omnidan:master Jul 21, 2017
@omnidan omnidan mentioned this pull request Jul 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants