|
|
|
@@ -6,7 +6,6 @@
|
|
|
|
|
process.env.NODE_ENV = 'test';
|
|
|
|
|
|
|
|
|
|
import * as assert from 'assert';
|
|
|
|
|
import { DEFAULT_POLICIES } from '@/core/RoleService.js';
|
|
|
|
|
import {
|
|
|
|
|
api,
|
|
|
|
|
failedApiCall,
|
|
|
|
@@ -19,6 +18,7 @@ import {
|
|
|
|
|
userList,
|
|
|
|
|
} from '../utils.js';
|
|
|
|
|
import type * as misskey from 'misskey-js';
|
|
|
|
|
import { DEFAULT_POLICIES } from '@/core/RoleService.js';
|
|
|
|
|
|
|
|
|
|
const compareBy = <T extends { id: string }>(selector: (s: T) => string = (s: T): string => s.id) => (a: T, b: T): number => {
|
|
|
|
|
return selector(a).localeCompare(selector(b));
|
|
|
|
@@ -235,11 +235,11 @@ describe('アンテナ', () => {
|
|
|
|
|
await failedApiCall({
|
|
|
|
|
endpoint: 'antennas/create',
|
|
|
|
|
parameters: { ...defaultParam, keywords: [[]], excludeKeywords: [[]] },
|
|
|
|
|
user: alice
|
|
|
|
|
user: alice,
|
|
|
|
|
}, {
|
|
|
|
|
status: 400,
|
|
|
|
|
code: 'EMPTY_KEYWORD',
|
|
|
|
|
id: '53ee222e-1ddd-4f9a-92e5-9fb82ddb463a'
|
|
|
|
|
id: '53ee222e-1ddd-4f9a-92e5-9fb82ddb463a',
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
//#endregion
|
|
|
|
@@ -274,11 +274,11 @@ describe('アンテナ', () => {
|
|
|
|
|
await failedApiCall({
|
|
|
|
|
endpoint: 'antennas/update',
|
|
|
|
|
parameters: { ...defaultParam, antennaId: antenna.id, keywords: [[]], excludeKeywords: [[]] },
|
|
|
|
|
user: alice
|
|
|
|
|
user: alice,
|
|
|
|
|
}, {
|
|
|
|
|
status: 400,
|
|
|
|
|
code: 'EMPTY_KEYWORD',
|
|
|
|
|
id: '721aaff6-4e1b-4d88-8de6-877fae9f68c4'
|
|
|
|
|
id: '721aaff6-4e1b-4d88-8de6-877fae9f68c4',
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@@ -375,14 +375,23 @@ describe('アンテナ', () => {
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
// https://github.com/misskey-dev/misskey/issues/9025
|
|
|
|
|
label: 'ただし、フォロワー限定投稿とDM投稿を含まない。フォロワーであっても。',
|
|
|
|
|
label: 'フォロワー限定投稿とDM投稿を含む',
|
|
|
|
|
parameters: () => ({}),
|
|
|
|
|
posts: [
|
|
|
|
|
{ note: (): Promise<Note> => post(userFollowedByAlice, { text: `${keyword}`, visibility: 'public' }), included: true },
|
|
|
|
|
{ note: (): Promise<Note> => post(userFollowedByAlice, { text: `${keyword}`, visibility: 'home' }), included: true },
|
|
|
|
|
{ note: (): Promise<Note> => post(userFollowedByAlice, { text: `${keyword}`, visibility: 'followers' }) },
|
|
|
|
|
{ note: (): Promise<Note> => post(userFollowedByAlice, { text: `${keyword}`, visibility: 'specified', visibleUserIds: [alice.id] }) },
|
|
|
|
|
{ note: (): Promise<Note> => post(userFollowedByAlice, { text: `${keyword}`, visibility: 'followers' }), included: true },
|
|
|
|
|
{ note: (): Promise<Note> => post(bob, { text: `${keyword}`, visibility: 'specified', visibleUserIds: [alice.id] }), included: true },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: 'フォロワー限定投稿とDM投稿を含まない',
|
|
|
|
|
parameters: () => ({}),
|
|
|
|
|
posts: [
|
|
|
|
|
{ note: (): Promise<Note> => post(bob, { text: `${keyword}`, visibility: 'public' }), included: true },
|
|
|
|
|
{ note: (): Promise<Note> => post(bob, { text: `${keyword}`, visibility: 'home' }), included: true },
|
|
|
|
|
{ note: (): Promise<Note> => post(bob, { text: `${keyword}`, visibility: 'followers' }) },
|
|
|
|
|
{ note: (): Promise<Note> => post(bob, { text: `${keyword}`, visibility: 'specified', visibleUserIds: [carol.id] }) },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|