Skip to content

Commit

Permalink
feat(v15.1): Generate updated regex for Emoji 15.1 & add JS Emoji 15.…
Browse files Browse the repository at this point in the history
…1 spot tests
  • Loading branch information
jdecked committed Mar 28, 2024
1 parent 4a99acb commit 3e61457
Show file tree
Hide file tree
Showing 3 changed files with 6,828 additions and 6,660 deletions.
121 changes: 121 additions & 0 deletions src/__tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -847,4 +847,125 @@ describe('version spot checks', () => {
]);
});
});

describe('Emoji 15.1', () => {
test('head shaking horizontally', () => {
expect(parse('\ud83d\ude42\u200d\u2194\ufe0f')).toMatchObject([
{
indices: [0, 5],
text: '\ud83d\ude42\u200d\u2194\ufe0f'
}
]);
});

test('head shaking vertically', () => {
expect(parse('\ud83d\ude42\u200d\u2195\ufe0f')).toMatchObject([
{
indices: [0, 5],
text: '\ud83d\ude42\u200d\u2195\ufe0f'
}
]);
});

describe('directional diversity emoji', () => {
test('person walking facing right (trailing gender without variant, directional)', () => {
expect(parse('\ud83d\udeb6\u200d\u27a1\ufe0f')).toMatchObject([
{
indices: [0, 5],
text: '\ud83d\udeb6\u200d\u27a1\ufe0f'
}
]);
});

test('person walking facing right, medium skin tone', () => {
expect(parse('\ud83d\udeb6\ud83c\udffd\u200d\u27a1\ufe0f')).toMatchObject([
{
indices: [0, 7],
text: '\ud83d\udeb6\ud83c\udffd\u200d\u27a1\ufe0f'
}
]);
});

test('woman walking facing right, medium skin tone', () => {
expect(parse('\ud83d\udeb6\ud83c\udffd\u200d\u2640\ufe0f\u200d\u27a1\ufe0f')).toMatchObject([
{
indices: [0, 10],
text: '\ud83d\udeb6\ud83c\udffd\u200d\u2640\ufe0f\u200d\u27a1\ufe0f'
}
]);
});

test('man walking (trailing gender without variant)', () => {
expect(parse('\ud83d\udeb6\u200d\u2642\ufe0f')).toMatchObject([
{
indices: [0, 5],
text: '\ud83d\udeb6\u200d\u2642\ufe0f'
}
]);
});

test('woman with white cane facing right (leading gender, directional)', () => {
expect(parse('\ud83d\udc69\u200d\ud83e\uddaf\u200d\u27a1\ufe0f')).toMatchObject([
{
indices: [0, 8],
text: '\ud83d\udc69\u200d\ud83e\uddaf\u200d\u27a1\ufe0f'
}
]);
});

test('person with white cane facing right, medium skin tone', () => {
expect(parse('\ud83e\uddd1\ud83c\udffd\u200d\ud83e\uddaf\u200d\u27a1\ufe0f')).toMatchObject([
{
indices: [0, 10],
text: '\ud83e\uddd1\ud83c\udffd\u200d\ud83e\uddaf\u200d\u27a1\ufe0f'
}
]);
});

test('man with white cane facing right, medium skin tone', () => {
expect(parse('\ud83d\udc68\ud83c\udffd\u200d\ud83e\uddaf\u200d\u27a1\ufe0f')).toMatchObject([
{
indices: [0, 10],
text: '\ud83d\udc68\ud83c\udffd\u200d\ud83e\uddaf\u200d\u27a1\ufe0f'
}
]);
});

test('person with white cane (leading gender)', () => {
expect(parse('\ud83e\uddd1\u200d\ud83e\uddaf')).toMatchObject([
{
indices: [0, 5],
text: '\ud83e\uddd1\u200d\ud83e\uddaf'
}
]);
});
});

test('family: adult, adult, child, child', () => {
expect(parse('\ud83e\uddd1\u200d\ud83e\uddd1\u200d\ud83e\uddd2\u200d\ud83e\uddd2')).toMatchObject([
{
indices: [0, 11],
text: '\ud83e\uddd1\u200d\ud83e\uddd1\u200d\ud83e\uddd2\u200d\ud83e\uddd2'
}
]);
});

test('phoenix', () => {
expect(parse('\ud83d\udc26\u200d\ud83d\udd25')).toMatchObject([
{
indices: [0, 5],
text: '\ud83d\udc26\u200d\ud83d\udd25'
}
]);
});

test('broken chain', () => {
expect(parse('\u26d3\ufe0f\u200d\ud83d\udca5')).toMatchObject([
{
indices: [0, 5],
text: '\u26d3\ufe0f\u200d\ud83d\udca5'
}
]);
});
});
});
Loading

0 comments on commit 3e61457

Please sign in to comment.