Skip to content

Commit

Permalink
split bindings for exports.ts
Browse files Browse the repository at this point in the history
型が合わなくて文句を言ってくるので適切に分割
  • Loading branch information
KisaragiEffective committed Jun 20, 2024
1 parent c884abb commit 9e7f22f
Showing 1 changed file with 29 additions and 23 deletions.
52 changes: 29 additions & 23 deletions packages/backend/test/e2e/exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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');
Expand All @@ -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);
Expand All @@ -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');
Expand Down

0 comments on commit 9e7f22f

Please sign in to comment.