测试:登录态用例的会话刷新 spy 补 mock 实现
- `chat-composer` 的"登录态失效不重跑整轮"用例给 `requestPlatformSessionRefresh` 的 spy 补 `mockResolvedValue`,真回归时以 mock 结果干净失败,不再在测试里发起真实刷新 - 桩值用现役的 `stale`(`PlatformSessionRefreshResult` 只有 `refreshed / stale / failed` 三种)
This commit is contained in:
@@ -404,7 +404,10 @@ export function registerChatComposerControlTests() {
|
||||
throw new Error('authentication-required');
|
||||
},
|
||||
});
|
||||
const refresh = vi.spyOn(platformSession, 'requestPlatformSessionRefresh');
|
||||
// 桩掉实现:真回归(回合期间误调保活刷新)时以 mock 结果干净失败,不在测试里发起真实刷新。
|
||||
const refresh = vi
|
||||
.spyOn(platformSession, 'requestPlatformSessionRefresh')
|
||||
.mockResolvedValue({ status: 'stale' });
|
||||
try {
|
||||
const composer = within(surface).getByLabelText('陶泥儿对话内容');
|
||||
await submitDirectTurn(surface, composer, '继续制作');
|
||||
|
||||
Reference in New Issue
Block a user