This commit is contained in:
@@ -15,7 +15,7 @@ type TwitterClientPrivate = TwitterClient & {
|
||||
refreshQueryIds: () => Promise<void>;
|
||||
fetchWithTimeout: (url: string, init: RequestInit) => Promise<ResponseLike>;
|
||||
ensureClientUserId: () => Promise<void>;
|
||||
getBaseHeaders: () => Record<string, string>;
|
||||
getHeaders: () => Record<string, string>;
|
||||
fetchUserArticlePlainText: (userId: string, tweetId: string) => Promise<{ title?: string; plainText?: string }>;
|
||||
fetchTweetDetail: (tweetId: string) => Promise<{ success: true } | { success: false; error: string }>;
|
||||
postStatusUpdate: (input: { text: string }) => Promise<{ success: boolean; error?: string }>;
|
||||
@@ -108,7 +108,7 @@ describe('TwitterClient core coverage', () => {
|
||||
expect(result.error).toBe('Tweet not found in response');
|
||||
});
|
||||
|
||||
it('adds client user id header after ensureClientUserId', async () => {
|
||||
it('does not add Twitter headers after ensureClientUserId', async () => {
|
||||
const client = new TwitterClient({ relayBaseUrl: testRelayBaseUrl });
|
||||
process.env.NODE_ENV = 'production';
|
||||
|
||||
@@ -119,9 +119,9 @@ describe('TwitterClient core coverage', () => {
|
||||
|
||||
const clientPrivate = client as unknown as TwitterClientPrivate;
|
||||
await clientPrivate.ensureClientUserId();
|
||||
const headers = clientPrivate.getBaseHeaders();
|
||||
const headers = clientPrivate.getHeaders();
|
||||
|
||||
expect(headers['x-twitter-client-user-id']).toBe('42');
|
||||
expect(headers).toEqual({});
|
||||
});
|
||||
|
||||
describe('fetchUserArticlePlainText failures', () => {
|
||||
|
||||
Reference in New Issue
Block a user