import { describe, expect, it, vi } from 'vitest' vi.mock('../../../../../packages/publisher-platforms/src/toutiao', () => ({ publishToutiaoArticle: vi.fn(async () => ({ success: true, status: 'success', articleId: 'pgc-1', mediaName: '头条号测试账号', externalManageUrl: 'https://mp.toutiao.com/profile_v4/index', externalArticleUrl: 'https://www.toutiao.com/article/pgc-1/', message: '头条号发布成功。', })), })) vi.mock('./media-image', () => ({ fetchImageAssetBlob: vi.fn(async () => ({ blob: new Blob(['image'], { type: 'image/png' }), width: 1, height: 1, fileName: 'image.png', })), })) import { publishToutiaoArticle } from '../../../../../packages/publisher-platforms/src/toutiao' import { toutiaoAdapter } from './toutiao' import { fetchImageAssetBlob } from './media-image' describe('toutiao adapter', () => { it('fetches relative public assets through the desktop asset pipeline before platform upload', async () => { const result = await toutiaoAdapter.publish( { taskId: 'task-1', accountId: 'account-1', session: {} as never, view: null, playwright: null, signal: new AbortController().signal, phase: 'initial', reportProgress: vi.fn(), article: { article_id: 889, title: '2026年室内门锁怎么选?五款高适配产品参考', html_content: null, markdown_content: '