test(web): enable developer tools in trajectory image fixture

This commit is contained in:
zhc committed 2026-09-18 11:03:06 +08:00
1 parent 012f993ed4
commit 07e3619ec3
2 files changed
+21 -3

No files matched your search

+20 -2
View File
@@ -71,7 +71,14 @@ interface ControlBaseline {
interface CapturedFixture {
readonly sessionList: { readonly ok: true; readonly value: { readonly items: readonly SessionSummary[] } }
readonly settingsDescribe: unknown
readonly settingsDescribe: {
readonly ok: true
readonly value: {
readonly writable: boolean
readonly hasDocument: boolean
readonly namespaces: readonly unknown[]
}
}
readonly credentialsDescribe: unknown
readonly modelCatalog: unknown
readonly agentPresets: unknown
@@ -90,6 +97,8 @@ interface CapturedFixture {
}
export interface AssembledRemoteOptions {
/** Supply an enabled Host preference for diagnostic View scenarios. */
readonly developerTools?: boolean
/** Return the fixture's image-dimension admission error from Session prompt. */
readonly rejectPrompt?: boolean
}
@@ -131,7 +140,16 @@ export function createAssembledRemote(options: AssembledRemoteOptions = {}): Ass
const mock = RemoteMock.create().load(remoteDefaultResponses)
mock.load({
unary: {
'settings/describe': structuredClone(fixture.settingsDescribe),
'settings/describe': options.developerTools === true
? ok({
...fixture.settingsDescribe.value,
namespaces: [...fixture.settingsDescribe.value.namespaces, {
ns: 'ui-developer-tools',
schema: { type: 'object', dict: { enabled: { type: 'boolean' } } },
value: { enabled: true }, applies: 'live', secrets: [], revision: 0,
}],
})
: structuredClone(fixture.settingsDescribe),
'credentials/describe': structuredClone(fixture.credentialsDescribe),
'session/modelCatalog': structuredClone(fixture.modelCatalog),
'agentPresets/list': structuredClone(fixture.agentPresets),
@@ -81,7 +81,7 @@ it('renders durable record images in the Trajectory details panel from the share
configurable: true,
value: () => {},
})
mountAssembledApp()
mountAssembledApp({ remote: { developerTools: true } })
await openFixtureSession()
const chatSrc = document.querySelector('[data-align="end"] img')?.getAttribute('src')
if (chatSrc === null || chatSrc === undefined) throw new Error('chat gallery image missing')