fix tests may break due to upstream changes

This commit is contained in:
まっちゃとーにゅ 2023-12-28 05:13:47 +09:00
parent af56eea4d6
commit c8b686ef5e
No known key found for this signature in database
GPG Key ID: 143DE582A97FE052
4 changed files with 12 additions and 12 deletions

View File

@ -44,7 +44,7 @@ describe('Note', () => {
}); });
test('ファイルを添付できる', async () => { test('ファイルを添付できる', async () => {
const file = await uploadUrl(alice, 'https://raw.githubusercontent.com/misskey-dev/misskey/develop/packages/backend/test/resources/Lenna.jpg'); const file = await uploadUrl(alice, 'https://raw.githubusercontent.com/MisskeyIO/misskey/io/packages/backend/test/resources/Lenna.jpg');
const res = await api('/notes/create', { const res = await api('/notes/create', {
fileIds: [file.id], fileIds: [file.id],
@ -56,7 +56,7 @@ describe('Note', () => {
}, 1000 * 10); }, 1000 * 10);
test('他人のファイルで怒られる', async () => { test('他人のファイルで怒られる', async () => {
const file = await uploadUrl(bob, 'https://raw.githubusercontent.com/misskey-dev/misskey/develop/packages/backend/test/resources/Lenna.jpg'); const file = await uploadUrl(bob, 'https://raw.githubusercontent.com/MisskeyIO/misskey/io/packages/backend/test/resources/Lenna.jpg');
const res = await api('/notes/create', { const res = await api('/notes/create', {
text: 'test', text: 'test',

View File

@ -365,8 +365,8 @@ describe('Timelines', () => {
await api('/following/create', { userId: bob.id }, alice); await api('/following/create', { userId: bob.id }, alice);
await sleep(1000); await sleep(1000);
const [bobFile, carolFile] = await Promise.all([ const [bobFile, carolFile] = await Promise.all([
uploadUrl(bob, 'https://raw.githubusercontent.com/misskey-dev/assets/main/public/icon.png'), uploadUrl(bob, 'https://raw.githubusercontent.com/MisskeyIO/misskey/io/packages/backend/test/resources/Lenna.png'),
uploadUrl(carol, 'https://raw.githubusercontent.com/misskey-dev/assets/main/public/icon.png'), uploadUrl(carol, 'https://raw.githubusercontent.com/MisskeyIO/misskey/io/packages/backend/test/resources/Lenna.png'),
]); ]);
const bobNote1 = await post(bob, { text: 'hi' }); const bobNote1 = await post(bob, { text: 'hi' });
const bobNote2 = await post(bob, { fileIds: [bobFile.id] }); const bobNote2 = await post(bob, { fileIds: [bobFile.id] });
@ -665,7 +665,7 @@ describe('Timelines', () => {
test.concurrent('[withFiles: true] ファイル付きノートのみ含まれる', async () => { test.concurrent('[withFiles: true] ファイル付きノートのみ含まれる', async () => {
const [alice, bob] = await Promise.all([signup(), signup()]); const [alice, bob] = await Promise.all([signup(), signup()]);
const file = await uploadUrl(bob, 'https://raw.githubusercontent.com/misskey-dev/assets/main/public/icon.png'); const file = await uploadUrl(bob, 'https://raw.githubusercontent.com/MisskeyIO/misskey/io/packages/backend/test/resources/Lenna.png');
const bobNote1 = await post(bob, { text: 'hi' }); const bobNote1 = await post(bob, { text: 'hi' });
const bobNote2 = await post(bob, { fileIds: [file.id] }); const bobNote2 = await post(bob, { fileIds: [file.id] });
@ -803,7 +803,7 @@ describe('Timelines', () => {
test.concurrent('[withFiles: true] ファイル付きノートのみ含まれる', async () => { test.concurrent('[withFiles: true] ファイル付きノートのみ含まれる', async () => {
const [alice, bob] = await Promise.all([signup(), signup()]); const [alice, bob] = await Promise.all([signup(), signup()]);
const file = await uploadUrl(bob, 'https://raw.githubusercontent.com/misskey-dev/assets/main/public/icon.png'); const file = await uploadUrl(bob, 'https://raw.githubusercontent.com/MisskeyIO/misskey/io/packages/backend/test/resources/Lenna.png');
const bobNote1 = await post(bob, { text: 'hi' }); const bobNote1 = await post(bob, { text: 'hi' });
const bobNote2 = await post(bob, { fileIds: [file.id] }); const bobNote2 = await post(bob, { fileIds: [file.id] });
@ -999,7 +999,7 @@ describe('Timelines', () => {
const list = await api('/users/lists/create', { name: 'list' }, alice).then(res => res.body); const list = await api('/users/lists/create', { name: 'list' }, alice).then(res => res.body);
await api('/users/lists/push', { listId: list.id, userId: bob.id }, alice); await api('/users/lists/push', { listId: list.id, userId: bob.id }, alice);
const file = await uploadUrl(bob, 'https://raw.githubusercontent.com/misskey-dev/assets/main/public/icon.png'); const file = await uploadUrl(bob, 'https://raw.githubusercontent.com/MisskeyIO/misskey/io/packages/backend/test/resources/Lenna.png');
const bobNote1 = await post(bob, { text: 'hi' }); const bobNote1 = await post(bob, { text: 'hi' });
const bobNote2 = await post(bob, { fileIds: [file.id] }); const bobNote2 = await post(bob, { fileIds: [file.id] });
@ -1158,7 +1158,7 @@ describe('Timelines', () => {
test.concurrent('[withFiles: true] ファイル付きノートのみ含まれる', async () => { test.concurrent('[withFiles: true] ファイル付きノートのみ含まれる', async () => {
const [alice, bob] = await Promise.all([signup(), signup()]); const [alice, bob] = await Promise.all([signup(), signup()]);
const file = await uploadUrl(bob, 'https://raw.githubusercontent.com/misskey-dev/assets/main/public/icon.png'); const file = await uploadUrl(bob, 'https://raw.githubusercontent.com/MisskeyIO/misskey/io/packages/backend/test/resources/Lenna.png');
const bobNote1 = await post(bob, { text: 'hi' }); const bobNote1 = await post(bob, { text: 'hi' });
const bobNote2 = await post(bob, { fileIds: [file.id] }); const bobNote2 = await post(bob, { fileIds: [file.id] });

View File

@ -21,8 +21,8 @@ describe('users/notes', () => {
beforeAll(async () => { beforeAll(async () => {
app = await startServer(); app = await startServer();
alice = await signup({ username: 'alice' }); alice = await signup({ username: 'alice' });
const jpg = await uploadUrl(alice, 'https://raw.githubusercontent.com/misskey-dev/misskey/develop/packages/backend/test/resources/Lenna.jpg'); const jpg = await uploadUrl(alice, 'https://raw.githubusercontent.com/MisskeyIO/misskey/io/packages/backend/test/resources/Lenna.jpg');
const png = await uploadUrl(alice, 'https://raw.githubusercontent.com/misskey-dev/misskey/develop/packages/backend/test/resources/Lenna.png'); const png = await uploadUrl(alice, 'https://raw.githubusercontent.com/MisskeyIO/misskey/io/packages/backend/test/resources/Lenna.png');
jpgNote = await post(alice, { jpgNote = await post(alice, {
fileIds: [jpg.id], fileIds: [jpg.id],
}); });

View File

@ -15,12 +15,12 @@ export const onUnhandledRequest = ((req, print) => {
export const commonHandlers = [ export const commonHandlers = [
rest.get('/fluent-emoji/:codepoints.png', async (req, res, ctx) => { rest.get('/fluent-emoji/:codepoints.png', async (req, res, ctx) => {
const { codepoints } = req.params; const { codepoints } = req.params;
const value = await fetch(`https://raw.githubusercontent.com/misskey-dev/emojis/main/dist/${codepoints}.png`).then((response) => response.blob()); const value = await fetch(`https://raw.githubusercontent.com/MisskeyIO/emojis/main/dist/${codepoints}.png`).then((response) => response.blob());
return res(ctx.set('Content-Type', 'image/png'), ctx.body(value)); return res(ctx.set('Content-Type', 'image/png'), ctx.body(value));
}), }),
rest.get('/fluent-emojis/:codepoints.png', async (req, res, ctx) => { rest.get('/fluent-emojis/:codepoints.png', async (req, res, ctx) => {
const { codepoints } = req.params; const { codepoints } = req.params;
const value = await fetch(`https://raw.githubusercontent.com/misskey-dev/emojis/main/dist/${codepoints}.png`).then((response) => response.blob()); const value = await fetch(`https://raw.githubusercontent.com/MisskeyIO/emojis/main/dist/${codepoints}.png`).then((response) => response.blob());
return res(ctx.set('Content-Type', 'image/png'), ctx.body(value)); return res(ctx.set('Content-Type', 'image/png'), ctx.body(value));
}), }),
rest.get('/twemoji/:codepoints.svg', async (req, res, ctx) => { rest.get('/twemoji/:codepoints.svg', async (req, res, ctx) => {