chore: add tests
This commit is contained in:
parent
a404b8af09
commit
61ebb3772a
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue