diff --git a/packages/backend/test/e2e/fetch-resource.ts b/packages/backend/test/e2e/fetch-resource.ts index 1cbfec3e5f..45e92588a4 100644 --- a/packages/backend/test/e2e/fetch-resource.ts +++ b/packages/backend/test/e2e/fetch-resource.ts @@ -84,6 +84,7 @@ describe('Webリソース', () => { aliceUploadedFile = await uploadFile(alice); alicesPost = await post(alice, { text: 'test', + fileIds: [aliceUploadedFile.body.id], }); alicePage = await page(alice, {}); alicePlay = await play(alice, {}); @@ -158,6 +159,42 @@ describe('Webリソース', () => { })); }); + describe.each([ + { ext: 'rss', type: 'application/rss+xml; charset=utf-8' }, + { ext: 'atom', type: 'application/atom+xml; charset=utf-8' }, + { ext: 'json', type: 'application/json; charset=utf-8' }, + ])('/@:username.with_replies.$ext', ({ ext, type }) => { + const path = (username: string): string => `/@${username}.with_replies.${ext}`; + + test('がGETできる。', async () => await ok({ + path: path(alice.username), + type, + })); + + test('は存在しないユーザーはGETできない。', async () => await notOk({ + path: path('nonexisting'), + status: 404, + })); + }); + + describe.each([ + { ext: 'rss', type: 'application/rss+xml; charset=utf-8' }, + { ext: 'atom', type: 'application/atom+xml; charset=utf-8' }, + { ext: 'json', type: 'application/json; charset=utf-8' }, + ])('/@:username.with_files.$ext', ({ ext, type }) => { + const path = (username: string): string => `/@${username}.with_files.${ext}`; + + test('がGETできる。', async () => await ok({ + path: path(alice.username), + type, + })); + + test('は存在しないユーザーはGETできない。', async () => await notOk({ + path: path('nonexisting'), + status: 404, + })); + }); + describe.each([{ path: '/api/foo' }])('$path', ({ path }) => { test('はGETできない。', async () => await notOk({ path,