summaryrefslogtreecommitdiff
path: root/packages/backend/test/e2e
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2025-03-25 17:25:30 -0400
committerHazelnoot <acomputerdog@gmail.com>2025-03-25 17:25:30 -0400
commitd41d77fcd7c7c40b8409a22baecd0c0101db6e1e (patch)
treecec01a636388c2873dc46f8078a11e35faee0c7a /packages/backend/test/e2e
parentremerge: remove FetchAllowSoftFailMask in favor of our same-authority checks (diff)
downloadsharkey-d41d77fcd7c7c40b8409a22baecd0c0101db6e1e.tar.gz
sharkey-d41d77fcd7c7c40b8409a22baecd0c0101db6e1e.tar.bz2
sharkey-d41d77fcd7c7c40b8409a22baecd0c0101db6e1e.zip
revert 7bfada9792bc4d29d47d3895643543cbe15191cd: enhance: remove bull-board support
Diffstat (limited to 'packages/backend/test/e2e')
-rw-r--r--packages/backend/test/e2e/fetch-resource.ts32
1 files changed, 25 insertions, 7 deletions
diff --git a/packages/backend/test/e2e/fetch-resource.ts b/packages/backend/test/e2e/fetch-resource.ts
index 740295bda8..b85cebf724 100644
--- a/packages/backend/test/e2e/fetch-resource.ts
+++ b/packages/backend/test/e2e/fetch-resource.ts
@@ -6,7 +6,7 @@
process.env.NODE_ENV = 'test';
import * as assert from 'assert';
-import { channel, clip, galleryPost, page, play, post, signup, simpleGet, uploadFile } from '../utils.js';
+import { channel, clip, cookie, galleryPost, page, play, post, signup, simpleGet, uploadFile } from '../utils.js';
import type { SimpleGetResponse } from '../utils.js';
import type * as misskey from 'misskey-js';
@@ -156,20 +156,20 @@ describe('Webリソース', () => {
describe(' has entry such ', () => {
beforeEach(() => {
- post(alice, { text: '**a**' });
+ post(alice, { text: "**a**" })
});
test('MFMを含まない。', async () => {
- const content = await simpleGet(path(alice.username), '*/*', undefined, res => res.text());
+ const content = await simpleGet(path(alice.username), "*/*", undefined, res => res.text());
const _body: unknown = content.body;
// JSONフィードのときは改めて文字列化する
- const body: string = typeof (_body) === 'object' ? JSON.stringify(_body) : _body as string;
+ const body: string = typeof (_body) === "object" ? JSON.stringify(_body) : _body as string;
- if (body.includes('**a**')) {
- throw new Error('MFM shouldn\'t be included');
+ if (body.includes("**a**")) {
+ throw new Error("MFM shouldn't be included");
}
});
- });
+ })
});
describe.each([{ path: '/api/foo' }])('$path', ({ path }) => {
@@ -180,6 +180,24 @@ describe('Webリソース', () => {
}));
});
+ describe.each([{ path: '/queue' }])('$path', ({ path }) => {
+ test('はログインしないとGETできない。', async () => await notOk({
+ path,
+ status: 401,
+ }));
+
+ test('はadminでなければGETできない。', async () => await notOk({
+ path,
+ cookie: cookie(bob),
+ status: 403,
+ }));
+
+ test('はadminならGETできる。', async () => await ok({
+ path,
+ cookie: cookie(alice),
+ }));
+ });
+
describe.each([{ path: '/streaming' }])('$path', ({ path }) => {
test('はGETできない。', async () => await notOk({
path,