fix: 合并图库吸顶区域并关闭自动刷新

This commit is contained in:
GouJ
2026-09-04 11:38:30 +08:00
parent acc0a1e9ad
commit bd66f7e719
16 changed files with 359 additions and 197 deletions
@@ -19,6 +19,7 @@ afterEach(() => {
wrapper?.unmount()
wrapper = undefined
document.body.innerHTML = ''
vi.useRealTimers()
vi.unstubAllGlobals()
Object.assign(getOperation('gallery-test'), { pending: false, label: '', error: '', notice: '' })
})
@@ -134,6 +135,7 @@ describe('形态图片选择与操作', () => {
})
it('图库不自动生图,主图切换经确认后 PUT,失败图片不能设主图', async () => {
vi.useFakeTimers()
let primary = false
const fetcher = vi.fn<typeof fetch>().mockImplementation(async (_url, init) => {
if (init?.method === 'PUT') {
@@ -162,6 +164,8 @@ describe('形态图片选择与操作', () => {
})
await flushPromises()
expect(fetcher.mock.calls).toHaveLength(1)
await vi.advanceTimersByTimeAsync(30_000)
expect(fetcher.mock.calls).toHaveLength(1)
await expandSections()
expect(document.body.textContent).toContain('<script>模型提示词</script>')
expect(document.querySelector('[role="dialog"] script')).toBeNull()