This commit is contained in:
samunohito 2024-06-30 22:20:46 +09:00
parent 28fdf1b9a6
commit a685336a8b
3 changed files with 4 additions and 4 deletions

View file

@ -20,7 +20,6 @@ import type { MiUser } from '@/models/User.js';
import type { MiChannel } from '@/models/Channel.js'; import type { MiChannel } from '@/models/Channel.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import { IdService } from '@/core/IdService.js'; import { IdService } from '@/core/IdService.js';
import { isNotNull } from '@/misc/is-not-null.js';
import { DriveFileEntityService } from './DriveFileEntityService.js'; import { DriveFileEntityService } from './DriveFileEntityService.js';
import { NoteEntityService } from './NoteEntityService.js'; import { NoteEntityService } from './NoteEntityService.js';
@ -98,7 +97,7 @@ export class ChannelEntityService {
...( ...(
opts?.pinnedNotes opts?.pinnedNotes
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
? channel.pinnedNoteIds.map(it => opts.pinnedNotes!.get(it)).filter(isNotNull) ? channel.pinnedNoteIds.map(it => opts.pinnedNotes!.get(it)).filter(it => it != null)
: await this.notesRepository.findBy({ id: In(channel.pinnedNoteIds) }) : await this.notesRepository.findBy({ id: In(channel.pinnedNoteIds) })
), ),
); );

View file

@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
// noinspection JSUnusedLocalSymbols
/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-explicit-any */
// How to run: // How to run:
@ -12,8 +11,8 @@
import * as assert from 'assert'; import * as assert from 'assert';
import { entities } from 'misskey-js'; import { entities } from 'misskey-js';
import { Redis } from 'ioredis'; import { Redis } from 'ioredis';
import { loadConfig } from '@/config.js';
import { afterEach, beforeAll } from '@jest/globals'; import { afterEach, beforeAll } from '@jest/globals';
import { loadConfig } from '@/config.js';
import { import {
api, api,
initTestDb, initTestDb,
@ -91,6 +90,7 @@ describe('Timelines', () => {
beforeAll(async () => { beforeAll(async () => {
redisForTimelines = new Redis(loadConfig().redisForTimelines); redisForTimelines = new Redis(loadConfig().redisForTimelines);
root = await signup({ username: 'root' });
// FTT無効の状態で見たいときはコメントアウトを外す // FTT無効の状態で見たいときはコメントアウトを外す
await api('admin/update-meta', { enableFanoutTimeline: false }, root); await api('admin/update-meta', { enableFanoutTimeline: false }, root);

View file

@ -6,4 +6,5 @@
module.exports = async () => { module.exports = async () => {
// DBはUTCっぽいので、テスト側も合わせておく // DBはUTCっぽいので、テスト側も合わせておく
process.env.TZ = 'UTC'; process.env.TZ = 'UTC';
process.env.NODE_ENV = 'test';
}; };