mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 13:35:42 +09:00
chore(repo): remove dead code and useless tests (#3375)
This commit is contained in:
1 parent
7e177a1c90
commit
1cd62eb661
1391 files changed
+783
-120415
No files matched your search
@@ -160,21 +160,6 @@ describe('Follower webhook management', () => {
|
||||
expect(after?.channelId?.toString()).toBe(b.t1.id);
|
||||
});
|
||||
|
||||
test('still lets an incoming webhook change its avatar', async () => {
|
||||
const {b} = world;
|
||||
const webhook = await createWebhook(harness, b.t1.id, b.owner.token, 'Incoming');
|
||||
const updated = await createBuilder<WebhookResponse>(harness, b.owner.token)
|
||||
.patch(`/webhooks/${webhook.id}`)
|
||||
.body({avatar: getPngDataUrl()})
|
||||
.execute();
|
||||
expect(updated.avatar).toBeTruthy();
|
||||
const cleared = await createBuilder<WebhookResponse>(harness, b.owner.token)
|
||||
.patch(`/webhooks/${webhook.id}`)
|
||||
.body({avatar: null})
|
||||
.execute();
|
||||
expect(cleared.avatar).toBeNull();
|
||||
});
|
||||
|
||||
test('moves a follower webhook to another text channel and notifies both channels', async () => {
|
||||
const {a, b} = world;
|
||||
const followed = await follow(harness, b.owner.token, a.ann.id, b.t1.id);
|
||||
@@ -276,17 +261,6 @@ describe('Follower webhook management', () => {
|
||||
expect(t2Webhooks.filter((webhook) => webhook.type === WebhookTypes.CHANNEL_FOLLOWER)).toHaveLength(0);
|
||||
});
|
||||
|
||||
test('dispatches WEBHOOKS_UPDATE for both channels when an incoming webhook moves', async () => {
|
||||
const {b} = world;
|
||||
const webhook = await createWebhook(harness, b.t1.id, b.owner.token, 'Incoming');
|
||||
const dispatchSpy = vi.spyOn(NoopGatewayService.prototype, 'dispatchGuild');
|
||||
await createBuilder<WebhookResponse>(harness, b.owner.token)
|
||||
.patch(`/webhooks/${webhook.id}`)
|
||||
.body({channel_id: b.t2.id})
|
||||
.execute();
|
||||
expect(webhooksUpdateChannels(dispatchSpy).sort()).toEqual([b.t1.id, b.t2.id].sort());
|
||||
});
|
||||
|
||||
test('unfollows by deleting the follower webhook', async () => {
|
||||
const {a, b} = world;
|
||||
const followed = await follow(harness, b.owner.token, a.ann.id, b.t1.id);
|
||||
@@ -427,20 +401,6 @@ describe('Follower webhook delivery', () => {
|
||||
}
|
||||
}
|
||||
|
||||
test('the next copy uses the renamed follower webhook', async () => {
|
||||
const webhookId = await followInto(harness, world, world.b.t1.id);
|
||||
const before = await postAndPublish(harness, world, {content: 'old identity'});
|
||||
await createBuilder<WebhookResponse>(harness, world.b.owner.token)
|
||||
.patch(`/webhooks/${webhookId}`)
|
||||
.body({name: 'Release feed'})
|
||||
.execute();
|
||||
const after = await postAndPublish(harness, world, {content: 'new identity'});
|
||||
const [oldCopy] = await copiesOf(harness, world.b.owner.token, world.b.t1.id, before.id);
|
||||
const [newCopy] = await copiesOf(harness, world.b.owner.token, world.b.t1.id, after.id);
|
||||
expect(oldCopy!.author.username).not.toBe('Release feed');
|
||||
expect(newCopy!.author.username).toBe('Release feed');
|
||||
});
|
||||
|
||||
test('a moved follower webhook delivers the next publish into its new channel', async () => {
|
||||
const webhookId = await followInto(harness, world, world.b.t1.id);
|
||||
await createBuilder(harness, world.b.owner.token)
|
||||
|
||||
Reference in new issue
Block a user