Simplify relay request headers
CI / test (pull_request) Has been cancelled

This commit is contained in:
2026-06-24 03:52:16 +09:00
parent 1f6e228272
commit 6503bb1b76
8 changed files with 23 additions and 68 deletions
@@ -68,9 +68,7 @@ describe('TwitterClient tweet', () => {
expect(String(url)).toContain(`${testRelayBaseUrl}/i/api/graphql/`);
expect(String(url)).toContain('CreateTweet');
expect(options.method).toBe('POST');
expect(options.headers).not.toHaveProperty('cookie');
expect(options.headers).not.toHaveProperty('authorization');
expect(options.headers).not.toHaveProperty('x-csrf-token');
expect(options.headers).toEqual({ 'content-type': 'application/json' });
const body = JSON.parse(options.body);
expect(body.variables.tweet_text).toBe('Hello world!');
@@ -392,9 +390,10 @@ describe('TwitterClient reply', () => {
const [, options] = mockFetch.mock.calls[1];
expect(String(mockFetch.mock.calls[1][0])).toContain('statuses/update.json');
expect(options.method).toBe('POST');
expect(options.body).toContain('status=This+is+a+reply');
expect(options.body).toContain('in_reply_to_status_id=1234567890');
expect(options.body).toContain('auto_populate_reply_metadata=true');
expect(options.body).toContain('media_ids=111%2C222');
const body = String(options.body);
expect(body).toContain('status=This+is+a+reply');
expect(body).toContain('in_reply_to_status_id=1234567890');
expect(body).toContain('auto_populate_reply_metadata=true');
expect(body).toContain('media_ids=111%2C222');
});
});