Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
kozakura913 committed Jan 11, 2025
1 parent f2e6a71 commit e9465d3
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ describe('quarantine instance', () => {
resolveRemoteUser('a.test', carol.id, bob),
]);
await bob.client.request('following/create', { userId: aliceInBobHost.id });
await bob.client.request('following/create', { userId: carolInBobHost.id });
aAdmin = await fetchAdmin('a.test');
await sleep();
});
describe('isQuarantineLimit true', () => {
let alicePublicNote: Misskey.entities.Note, alicePublicRenote: Misskey.entities.Note;
const expected :{text:string|null, createdAt:string}[] = [];
beforeAll(async () => {
await aAdmin.client.request('admin/federation/update-instance', { host: 'a.test', isQuarantineLimit: true });
//await aAdmin.client.request('admin/federation/update-instance', { host: 'a.test', isQuarantineLimit: true });
alicePublicNote = (await alice.client.request('notes/create', { text: 'I am Alice!' })).createdNote;
alicePublicRenote = (await alice.client.request('notes/create', { renoteId: alicePublicNote.id })).createdNote;
expected.push({
Expand All @@ -43,13 +44,14 @@ describe('quarantine instance', () => {
await sleep();
const fetch_notes = await bob.client.request('users/notes', { userId: aliceInBobHost.id, withReplies: false, withRenotes: true });
strictEqual(fetch_notes.length, expected.length, JSON.stringify(fetch_notes));
//deepStrictEqual(JSON.stringify(fetch_notes.map(note => {
// return {
// text: note.text,
// createdAt: note.createdAt,
// };
//})), JSON.stringify(Array.from(expected).reverse()));
deepStrictEqual(JSON.stringify(fetch_notes.map(note => {
return {
text: note.text,
createdAt: note.createdAt,
};
})), JSON.stringify(Array.from(expected).reverse()));
});
/*
test('home', async () => {
const aliceHomeNote: Misskey.entities.Note = (await alice.client.request('notes/create', { text: 'home note', visibility: 'home' })).createdNote;
const aliceHomeRenote: Misskey.entities.Note = (await alice.client.request('notes/create', { renoteId: alicePublicNote.id, visibility: 'home' })).createdNote;
Expand Down Expand Up @@ -97,7 +99,9 @@ describe('quarantine instance', () => {
};
})), JSON.stringify(Array.from(expected).reverse()));
});
*/
});
/*
describe('isQuarantineLimit false', () => {
let carolPublicNote: Misskey.entities.Note, carolPublicRenote: Misskey.entities.Note;
const expected :{text:string|null, createdAt:string}[] = [];
Expand Down Expand Up @@ -190,4 +194,5 @@ describe('quarantine instance', () => {
})), JSON.stringify(Array.from(expected).reverse()));
});
});
*/
});

0 comments on commit e9465d3

Please sign in to comment.