1
0
forked from mirror/misskey

split bindings for exports.ts

型が合わなくて文句を言ってくるので適切に分割
This commit is contained in:
Kisaragi Marine 2024-06-21 04:48:42 +09:00
parent c884abb487
commit 9e7f22f655
No known key found for this signature in database
GPG Key ID: C6631564CD2110E4

View File

@ -116,19 +116,19 @@ describe('export-clips', () => {
});
test('multiple clips', async () => {
let res = await api('clips/create', {
const res1 = await api('clips/create', {
name: 'kawaii',
description: 'kawaii',
}, alice);
assert.strictEqual(res.status, 200);
const clip1 = res.body;
assert.strictEqual(res1.status, 200);
const clip1 = res1.body;
res = await api('clips/create', {
const res2 = await api('clips/create', {
name: 'yuri',
description: 'yuri',
}, alice);
assert.strictEqual(res.status, 200);
const clip2 = res.body;
assert.strictEqual(res2.status, 200);
const clip2 = res2.body;
const note1 = await post(alice, {
text: 'baz1',
@ -138,20 +138,26 @@ describe('export-clips', () => {
text: 'baz2',
});
res = await api('clips/add-note', {
clipId: clip1.id,
noteId: note1.id,
}, alice);
assert.strictEqual(res.status, 204);
{
const res = await api('clips/add-note', {
clipId: clip1.id,
noteId: note1.id,
}, alice);
assert.strictEqual(res.status, 204);
}
res = await api('clips/add-note', {
clipId: clip2.id,
noteId: note2.id,
}, alice);
assert.strictEqual(res.status, 204);
{
const res = await api('clips/add-note', {
clipId: clip2.id,
noteId: note2.id,
}, alice);
assert.strictEqual(res.status, 204);
}
res = await api('i/export-clips', {}, alice);
assert.strictEqual(res.status, 204);
{
const res = await api('i/export-clips', {}, alice);
assert.strictEqual(res.status, 204);
}
const exported = await pollFirstDriveFile();
assert.strictEqual(exported[0].name, 'kawaii');
@ -163,7 +169,7 @@ describe('export-clips', () => {
});
test('Clipping other user\'s note', async () => {
let res = await api('clips/create', {
const res = await api('clips/create', {
name: 'kawaii',
description: 'kawaii',
}, alice);
@ -175,14 +181,14 @@ describe('export-clips', () => {
visibility: 'followers',
});
res = await api('clips/add-note', {
const res2 = await api('clips/add-note', {
clipId: clip.id,
noteId: note.id,
}, alice);
assert.strictEqual(res.status, 204);
assert.strictEqual(res2.status, 204);
res = await api('i/export-clips', {}, alice);
assert.strictEqual(res.status, 204);
const res3 = await api('i/export-clips', {}, alice);
assert.strictEqual(res3.status, 204);
const exported = await pollFirstDriveFile();
assert.strictEqual(exported[0].name, 'kawaii');