mirror of
https://git.boykissers.com/pawkey/pawkey-sk.git
synced 2025-12-20 04:04:16 +00:00
feat: アンテナでセンシティブなチャンネルからのノートを除外できるように (#15346)
* feat(db): マイグレーションを追加 * feat(backend): カラムの定義を追加 * wip * feat: フラグを設定出来るように * feat: /notesエンドポイントを対応 * feat: websocketを対応 * test: テストを追加 * docs: CHANGELOGを更新 * docs: CHANGELOGの追加場所を修正 * chore: api.jsonを更新 * docs(CHANGELOG): General欄に移動 * docs: フォーマットを揃える * chore: クエリを削除 * revert: 英訳を消す * chore: note.channelを追加するところを変える * docs: CHANGELOGを更新する * docs(CHANGELOG): 2025.3.2に移動 * chore: changelogを下に移動 * ci: CI再実行用の空コミット --------- Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
This commit is contained in:
@@ -146,6 +146,7 @@ describe('アンテナ', () => {
|
||||
caseSensitive: false,
|
||||
createdAt: new Date(response.createdAt).toISOString(),
|
||||
excludeKeywords: [['']],
|
||||
hideNotesInSensitiveChannel: false,
|
||||
hasUnreadNote: false,
|
||||
isActive: true,
|
||||
keywords: [['keyword']],
|
||||
@@ -217,6 +218,8 @@ describe('アンテナ', () => {
|
||||
{ parameters: () => ({ withReplies: true }) },
|
||||
{ parameters: () => ({ withFile: false }) },
|
||||
{ parameters: () => ({ withFile: true }) },
|
||||
{ parameters: () => ({ hideNotesInSensitiveChannel: false }) },
|
||||
{ parameters: () => ({ hideNotesInSensitiveChannel: true }) },
|
||||
];
|
||||
test.each(antennaParamPattern)('を作成できること($#)', async ({ parameters }) => {
|
||||
const response = await successfulApiCall({
|
||||
@@ -626,6 +629,42 @@ describe('アンテナ', () => {
|
||||
assert.deepStrictEqual(response, expected);
|
||||
});
|
||||
|
||||
test('が取得できること(センシティブチャンネルのノートを除く)', async () => {
|
||||
const keyword = 'キーワード';
|
||||
const antenna = await successfulApiCall({
|
||||
endpoint: 'antennas/create',
|
||||
parameters: { ...defaultParam, keywords: [[keyword]], hideNotesInSensitiveChannel: true },
|
||||
user: alice,
|
||||
});
|
||||
const nonSensitiveChannel = await successfulApiCall({
|
||||
endpoint: 'channels/create',
|
||||
parameters: { name: 'test', isSensitive: false },
|
||||
user: alice,
|
||||
});
|
||||
const sensitiveChannel = await successfulApiCall({
|
||||
endpoint: 'channels/create',
|
||||
parameters: { name: 'test', isSensitive: true },
|
||||
user: alice,
|
||||
});
|
||||
|
||||
const noteInLocal = await post(bob, { text: `test ${keyword}` });
|
||||
const noteInNonSensitiveChannel = await post(bob, { text: `test ${keyword}`, channelId: nonSensitiveChannel.id });
|
||||
await post(bob, { text: `test ${keyword}`, channelId: sensitiveChannel.id });
|
||||
|
||||
const response = await successfulApiCall({
|
||||
endpoint: 'antennas/notes',
|
||||
parameters: { antennaId: antenna.id },
|
||||
user: alice,
|
||||
});
|
||||
// 最後に投稿したものが先頭に来る。
|
||||
const expected = [
|
||||
noteInNonSensitiveChannel,
|
||||
noteInLocal,
|
||||
];
|
||||
assert.deepStrictEqual(response, expected);
|
||||
});
|
||||
|
||||
|
||||
test.skip('が取得でき、日付指定のPaginationに一貫性があること', async () => { });
|
||||
test.each([
|
||||
{ label: 'ID指定', offsetBy: 'id' },
|
||||
|
||||
Reference in New Issue
Block a user