feat: 完成 UI 基础层与核心页面迁移

This commit is contained in:
Wxw-Gu
2026-08-19 17:43:07 +08:00
parent a72ae49e2c
commit e9cc996ebb
62 changed files with 4279 additions and 5178 deletions
@@ -132,4 +132,26 @@ describe('useExternalProviderConsent', () => {
expect(resolved).toHaveBeenCalledOnce()
expect(resolved).toHaveBeenCalledWith(true)
})
it.each([true, false])(
'settles the previous pending request when a new request replaces it, then resolves %s',
async (secondDecision) => {
const { result } = renderHook(() => useExternalProviderConsent())
let first!: Promise<boolean>
let second!: Promise<boolean>
act(() => {
first = result.current.requestExternalProviderConsent('First', 'first-recipient')
second = result.current.requestExternalProviderConsent('Second', 'second-recipient')
})
await expect(first).resolves.toBe(false)
expect(result.current.externalProviderConsent).toEqual({
providerName: 'Second',
recipient: 'second-recipient'
})
act(() => result.current.settleExternalProviderConsent(secondDecision))
await expect(second).resolves.toBe(secondDecision)
}
)
})