test: テストを追加
This commit is contained in:
parent
da6c80a94f
commit
eb9d1e9495
|
@ -146,6 +146,7 @@ describe('アンテナ', () => {
|
||||||
caseSensitive: false,
|
caseSensitive: false,
|
||||||
createdAt: new Date(response.createdAt).toISOString(),
|
createdAt: new Date(response.createdAt).toISOString(),
|
||||||
excludeKeywords: [['']],
|
excludeKeywords: [['']],
|
||||||
|
hideNotesInSensitiveChannel: false,
|
||||||
hasUnreadNote: false,
|
hasUnreadNote: false,
|
||||||
isActive: true,
|
isActive: true,
|
||||||
keywords: [['keyword']],
|
keywords: [['keyword']],
|
||||||
|
@ -217,6 +218,8 @@ describe('アンテナ', () => {
|
||||||
{ parameters: () => ({ withReplies: true }) },
|
{ parameters: () => ({ withReplies: true }) },
|
||||||
{ parameters: () => ({ withFile: false }) },
|
{ parameters: () => ({ withFile: false }) },
|
||||||
{ parameters: () => ({ withFile: true }) },
|
{ parameters: () => ({ withFile: true }) },
|
||||||
|
{ parameters: () => ({ hideNotesInSensitiveChannel: false }) },
|
||||||
|
{ parameters: () => ({ hideNotesInSensitiveChannel: true }) },
|
||||||
];
|
];
|
||||||
test.each(antennaParamPattern)('を作成できること($#)', async ({ parameters }) => {
|
test.each(antennaParamPattern)('を作成できること($#)', async ({ parameters }) => {
|
||||||
const response = await successfulApiCall({
|
const response = await successfulApiCall({
|
||||||
|
@ -626,6 +629,42 @@ describe('アンテナ', () => {
|
||||||
assert.deepStrictEqual(response, expected);
|
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.skip('が取得でき、日付指定のPaginationに一貫性があること', async () => { });
|
||||||
test.each([
|
test.each([
|
||||||
{ label: 'ID指定', offsetBy: 'id' },
|
{ label: 'ID指定', offsetBy: 'id' },
|
||||||
|
|
Loading…
Reference in New Issue