Merge branch 'develop' into mkjs-n
This commit is contained in:
@@ -43,7 +43,6 @@ describe('ユーザー', () => {
|
||||
|
||||
type MeDetailed = UserDetailedNotMe &
|
||||
misskey.entities.MeDetailed & {
|
||||
showTimelineReplies: boolean,
|
||||
achievements: object[],
|
||||
loggedInDays: number,
|
||||
policies: object,
|
||||
@@ -160,7 +159,6 @@ describe('ユーザー', () => {
|
||||
mutedInstances: user.mutedInstances,
|
||||
mutingNotificationTypes: user.mutingNotificationTypes,
|
||||
emailNotificationTypes: user.emailNotificationTypes,
|
||||
showTimelineReplies: user.showTimelineReplies,
|
||||
achievements: user.achievements,
|
||||
loggedInDays: user.loggedInDays,
|
||||
policies: user.policies,
|
||||
@@ -406,7 +404,6 @@ describe('ユーザー', () => {
|
||||
assert.deepStrictEqual(response.mutedInstances, []);
|
||||
assert.deepStrictEqual(response.mutingNotificationTypes, []);
|
||||
assert.deepStrictEqual(response.emailNotificationTypes, ['follow', 'receiveFollowRequest']);
|
||||
assert.strictEqual(response.showTimelineReplies, false);
|
||||
assert.deepStrictEqual(response.achievements, []);
|
||||
assert.deepStrictEqual(response.loggedInDays, 0);
|
||||
assert.deepStrictEqual(response.policies, DEFAULT_POLICIES);
|
||||
@@ -470,8 +467,6 @@ describe('ユーザー', () => {
|
||||
{ parameters: (): object => ({ isBot: false }) },
|
||||
{ parameters: (): object => ({ isCat: true }) },
|
||||
{ parameters: (): object => ({ isCat: false }) },
|
||||
{ parameters: (): object => ({ showTimelineReplies: true }) },
|
||||
{ parameters: (): object => ({ showTimelineReplies: false }) },
|
||||
{ parameters: (): object => ({ injectFeaturedNote: true }) },
|
||||
{ parameters: (): object => ({ injectFeaturedNote: false }) },
|
||||
{ parameters: (): object => ({ receiveAnnouncementEmail: true }) },
|
||||
|
@@ -15,78 +15,74 @@ describe('ReactionService', () => {
|
||||
reactionService = app.get<ReactionService>(ReactionService);
|
||||
});
|
||||
|
||||
describe('toDbReaction', () => {
|
||||
describe('normalize', () => {
|
||||
test('絵文字リアクションはそのまま', async () => {
|
||||
assert.strictEqual(await reactionService.toDbReaction('👍'), '👍');
|
||||
assert.strictEqual(await reactionService.toDbReaction('🍅'), '🍅');
|
||||
assert.strictEqual(await reactionService.normalize('👍'), '👍');
|
||||
assert.strictEqual(await reactionService.normalize('🍅'), '🍅');
|
||||
});
|
||||
|
||||
test('既存のリアクションは絵文字化する pudding', async () => {
|
||||
assert.strictEqual(await reactionService.toDbReaction('pudding'), '🍮');
|
||||
assert.strictEqual(await reactionService.normalize('pudding'), '🍮');
|
||||
});
|
||||
|
||||
test('既存のリアクションは絵文字化する like', async () => {
|
||||
assert.strictEqual(await reactionService.toDbReaction('like'), '👍');
|
||||
assert.strictEqual(await reactionService.normalize('like'), '👍');
|
||||
});
|
||||
|
||||
test('既存のリアクションは絵文字化する love', async () => {
|
||||
assert.strictEqual(await reactionService.toDbReaction('love'), '❤');
|
||||
assert.strictEqual(await reactionService.normalize('love'), '❤');
|
||||
});
|
||||
|
||||
test('既存のリアクションは絵文字化する laugh', async () => {
|
||||
assert.strictEqual(await reactionService.toDbReaction('laugh'), '😆');
|
||||
assert.strictEqual(await reactionService.normalize('laugh'), '😆');
|
||||
});
|
||||
|
||||
test('既存のリアクションは絵文字化する hmm', async () => {
|
||||
assert.strictEqual(await reactionService.toDbReaction('hmm'), '🤔');
|
||||
assert.strictEqual(await reactionService.normalize('hmm'), '🤔');
|
||||
});
|
||||
|
||||
test('既存のリアクションは絵文字化する surprise', async () => {
|
||||
assert.strictEqual(await reactionService.toDbReaction('surprise'), '😮');
|
||||
assert.strictEqual(await reactionService.normalize('surprise'), '😮');
|
||||
});
|
||||
|
||||
test('既存のリアクションは絵文字化する congrats', async () => {
|
||||
assert.strictEqual(await reactionService.toDbReaction('congrats'), '🎉');
|
||||
assert.strictEqual(await reactionService.normalize('congrats'), '🎉');
|
||||
});
|
||||
|
||||
test('既存のリアクションは絵文字化する angry', async () => {
|
||||
assert.strictEqual(await reactionService.toDbReaction('angry'), '💢');
|
||||
assert.strictEqual(await reactionService.normalize('angry'), '💢');
|
||||
});
|
||||
|
||||
test('既存のリアクションは絵文字化する confused', async () => {
|
||||
assert.strictEqual(await reactionService.toDbReaction('confused'), '😥');
|
||||
assert.strictEqual(await reactionService.normalize('confused'), '😥');
|
||||
});
|
||||
|
||||
test('既存のリアクションは絵文字化する rip', async () => {
|
||||
assert.strictEqual(await reactionService.toDbReaction('rip'), '😇');
|
||||
assert.strictEqual(await reactionService.normalize('rip'), '😇');
|
||||
});
|
||||
|
||||
test('既存のリアクションは絵文字化する star', async () => {
|
||||
assert.strictEqual(await reactionService.toDbReaction('star'), '⭐');
|
||||
assert.strictEqual(await reactionService.normalize('star'), '⭐');
|
||||
});
|
||||
|
||||
test('異体字セレクタ除去', async () => {
|
||||
assert.strictEqual(await reactionService.toDbReaction('㊗️'), '㊗');
|
||||
assert.strictEqual(await reactionService.normalize('㊗️'), '㊗');
|
||||
});
|
||||
|
||||
test('異体字セレクタ除去 必要なし', async () => {
|
||||
assert.strictEqual(await reactionService.toDbReaction('㊗'), '㊗');
|
||||
});
|
||||
|
||||
test('fallback - undefined', async () => {
|
||||
assert.strictEqual(await reactionService.toDbReaction(undefined), '❤');
|
||||
assert.strictEqual(await reactionService.normalize('㊗'), '㊗');
|
||||
});
|
||||
|
||||
test('fallback - null', async () => {
|
||||
assert.strictEqual(await reactionService.toDbReaction(null), '❤');
|
||||
assert.strictEqual(await reactionService.normalize(null), '❤');
|
||||
});
|
||||
|
||||
test('fallback - empty', async () => {
|
||||
assert.strictEqual(await reactionService.toDbReaction(''), '❤');
|
||||
assert.strictEqual(await reactionService.normalize(''), '❤');
|
||||
});
|
||||
|
||||
test('fallback - unknown', async () => {
|
||||
assert.strictEqual(await reactionService.toDbReaction('unknown'), '❤');
|
||||
assert.strictEqual(await reactionService.normalize('unknown'), '❤');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user