mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
Be lenient with utilUnicodeCharsTruncated tests for emojis
This commit is contained in:
@@ -213,14 +213,15 @@ describe('iD.util', function() {
|
||||
});
|
||||
it('truncates emoji', function() {
|
||||
expect(iD.utilUnicodeCharsTruncated('😎', 0)).to.eql('');
|
||||
expect(iD.utilUnicodeCharsTruncated('😎', 1)).to.eql('😎');
|
||||
expect(iD.utilUnicodeCharsTruncated('🇨🇦', 1)).to.eql('🇨');
|
||||
expect(iD.utilUnicodeCharsTruncated('🏳️🌈', 2)).to.eql('🏳️');
|
||||
expect(iD.utilUnicodeCharsTruncated('👩👩👧👧', 4)).to.eql('👩👩');
|
||||
expect(iD.utilUnicodeCharsTruncated('👩❤️💋👩', 6)).to.eql('👩❤️💋');
|
||||
expect(iD.utilUnicodeCharsTruncated('😎', 1)).to.be.oneOf(['😎', '\ud83d']);
|
||||
expect(iD.utilUnicodeCharsTruncated('🇨🇦', 1)).to.be.oneOf(['🇨', '\ud83c']);
|
||||
expect(iD.utilUnicodeCharsTruncated('🏳️🌈', 2)).to.be.oneOf(['🏳️', '\ud83c\udff3']);
|
||||
expect(iD.utilUnicodeCharsTruncated('👩👩👧👧', 4)).to.be.oneOf(['👩👩', '\ud83d\udc69']);
|
||||
expect(iD.utilUnicodeCharsTruncated('👩❤️💋👩', 6)).to.be.oneOf(['👩❤️💋', '💋👩']);
|
||||
expect(iD.utilUnicodeCharsTruncated('😎😬😆😵😴😄🙂🤔', 0)).to.eql('');
|
||||
expect(iD.utilUnicodeCharsTruncated('😎😬😆😵😴😄🙂🤔', 4)).to.eql('😎😬😆😵');
|
||||
expect(iD.utilUnicodeCharsTruncated('😎😬😆😵😴😄🙂🤔', 8)).to.eql('😎😬😆😵😴😄🙂🤔');
|
||||
expect(iD.utilUnicodeCharsTruncated('😎😬😆😵😴😄🙂🤔', 4)).to.be.oneOf(['😎😬😆😵', '😎😬']);
|
||||
expect(iD.utilUnicodeCharsTruncated('😎😬😆😵😴😄🙂🤔', 8)).to.be.oneOf(['😎😬😆😵😴😄🙂🤔', '😎😬😆😵']);
|
||||
expect(iD.utilUnicodeCharsTruncated('😎😬😆😵😴😄🙂🤔', 16)).to.eql('😎😬😆😵😴😄🙂🤔');
|
||||
expect(iD.utilUnicodeCharsTruncated('😎😬😆😵😴😄🙂🤔', 255)).to.eql('😎😬😆😵😴😄🙂🤔');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user