Update tests
I have no idea why changing soapbox -> mastodon fixes this, but I'm tired
This commit is contained in:
parent
3f2716bae9
commit
89b9c739b1
|
@ -52,12 +52,12 @@ describe('emoji_index', () => {
|
||||||
it('(different behavior from emoji-mart) do not erases custom emoji if not passed again', () => {
|
it('(different behavior from emoji-mart) do not erases custom emoji if not passed again', () => {
|
||||||
const custom = [
|
const custom = [
|
||||||
{
|
{
|
||||||
id: 'soapbox',
|
id: 'mastodon',
|
||||||
name: 'soapbox',
|
name: 'mastodon',
|
||||||
short_names: ['soapbox'],
|
short_names: ['mastodon'],
|
||||||
text: '',
|
text: '',
|
||||||
emoticons: [],
|
emoticons: [],
|
||||||
keywords: ['soapbox'],
|
keywords: ['mastodon'],
|
||||||
imageUrl: 'http://example.com',
|
imageUrl: 'http://example.com',
|
||||||
custom: true,
|
custom: true,
|
||||||
},
|
},
|
||||||
|
@ -67,23 +67,23 @@ describe('emoji_index', () => {
|
||||||
const expected = [];
|
const expected = [];
|
||||||
const lightExpected = [
|
const lightExpected = [
|
||||||
{
|
{
|
||||||
id: 'soapbox',
|
id: 'mastodon',
|
||||||
custom: true,
|
custom: true,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
expect(search('soap').map(trimEmojis)).toEqual(lightExpected);
|
expect(search('masto').map(trimEmojis)).toEqual(lightExpected);
|
||||||
expect(emojiIndex.search('soap').map(trimEmojis)).toEqual(expected);
|
expect(emojiIndex.search('masto').map(trimEmojis)).toEqual(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('(different behavior from emoji-mart) erases custom emoji if another is passed', () => {
|
it('(different behavior from emoji-mart) erases custom emoji if another is passed', () => {
|
||||||
const custom = [
|
const custom = [
|
||||||
{
|
{
|
||||||
id: 'soapbox',
|
id: 'mastodon',
|
||||||
name: 'soapbox',
|
name: 'mastodon',
|
||||||
short_names: ['soapbox'],
|
short_names: ['mastodon'],
|
||||||
text: '',
|
text: '',
|
||||||
emoticons: [],
|
emoticons: [],
|
||||||
keywords: ['soapbox'],
|
keywords: ['mastodon'],
|
||||||
imageUrl: 'http://example.com',
|
imageUrl: 'http://example.com',
|
||||||
custom: true,
|
custom: true,
|
||||||
},
|
},
|
||||||
|
@ -91,19 +91,19 @@ describe('emoji_index', () => {
|
||||||
search('', { custom });
|
search('', { custom });
|
||||||
emojiIndex.search('', { custom });
|
emojiIndex.search('', { custom });
|
||||||
const expected = [];
|
const expected = [];
|
||||||
expect(search('soap', { custom: [] }).map(trimEmojis)).toEqual(expected);
|
expect(search('masto', { custom: [] }).map(trimEmojis)).toEqual(expected);
|
||||||
expect(emojiIndex.search('soap').map(trimEmojis)).toEqual(expected);
|
expect(emojiIndex.search('masto').map(trimEmojis)).toEqual(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('handles custom emoji', () => {
|
it('handles custom emoji', () => {
|
||||||
const custom = [
|
const custom = [
|
||||||
{
|
{
|
||||||
id: 'soapbox',
|
id: 'mastodon',
|
||||||
name: 'soapbox',
|
name: 'mastodon',
|
||||||
short_names: ['soapbox'],
|
short_names: ['mastodon'],
|
||||||
text: '',
|
text: '',
|
||||||
emoticons: [],
|
emoticons: [],
|
||||||
keywords: ['soapbox'],
|
keywords: ['mastodon'],
|
||||||
imageUrl: 'http://example.com',
|
imageUrl: 'http://example.com',
|
||||||
custom: true,
|
custom: true,
|
||||||
},
|
},
|
||||||
|
@ -112,12 +112,12 @@ describe('emoji_index', () => {
|
||||||
emojiIndex.search('', { custom });
|
emojiIndex.search('', { custom });
|
||||||
const expected = [
|
const expected = [
|
||||||
{
|
{
|
||||||
id: 'soapbox',
|
id: 'mastodon',
|
||||||
custom: true,
|
custom: true,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
expect(search('soap', { custom }).map(trimEmojis)).toEqual(expected);
|
expect(search('masto', { custom }).map(trimEmojis)).toEqual(expected);
|
||||||
expect(emojiIndex.search('soap', { custom }).map(trimEmojis)).toEqual(expected);
|
expect(emojiIndex.search('masto', { custom }).map(trimEmojis)).toEqual(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should filter only emojis we care about, exclude pineapple', () => {
|
it('should filter only emojis we care about, exclude pineapple', () => {
|
||||||
|
|
Loading…
Reference in New Issue