fix: harden engagement mutations (#53) (thanks @the-vampiire)

This commit is contained in:
Peter Steinberger
2026-06-24 18:44:38 +09:00
committed by yuta
parent 81f1229660
commit a167ac4380
5 changed files with 129 additions and 2 deletions
+4 -1
View File
@@ -124,7 +124,7 @@ describe('TwitterClient engagement', () => {
});
describe('unretweet', () => {
it('successfully unrets a tweet', async () => {
it('successfully unretweets a tweet', async () => {
mockFetch.mockResolvedValueOnce({
ok: true,
status: 200,
@@ -140,6 +140,9 @@ describe('TwitterClient engagement', () => {
const [url, options] = mockFetch.mock.calls[0];
expect(options.method).toBe('POST');
expect(String(url)).toContain('/DeleteRetweet');
const body = JSON.parse(options.body);
expect(body.variables.tweet_id).toBe('1234567890');
expect(body.variables.source_tweet_id).toBe('1234567890');
});
});