test(ui-chat): pin the owner page branch-refusal notice
A refused branch now reports itself on the owner's own page: the Chat injection writes the notice on the addressed Session and the composer bar renders it as an alert, so the owner-visible change has an assertion at both seams.
This commit is contained in:
1 parent
52b2bd064f
commit
5ff6b3cdc5
2 files changed
+11
-1
No files matched your search
@@ -294,7 +294,7 @@ describe('Chat inject API', () => {
|
||||
await b.runtime.dispose()
|
||||
})
|
||||
|
||||
it('states why a refused branch failed, on the Session it was asked of', async () => {
|
||||
it('states why a refused branch failed on the owner page, on the Session it was asked of', async () => {
|
||||
/** The notice the addressed Session's composer bar consumes, as the page would show it. */
|
||||
const noticeOf = (sessionId: SessionId): string | undefined => {
|
||||
const entry = b.runtime.slots.entries('conversation.composer.bar')[0]
|
||||
@@ -305,6 +305,9 @@ describe('Chat inject API', () => {
|
||||
return composer.hooks.notices.getSnapshot()?.text
|
||||
}
|
||||
const b = await bench()
|
||||
// This page presents the owner's own browser session: the notice is an owner-visible change, not
|
||||
// only a served-page one.
|
||||
expect(b.runtime.ctx.remoteAccess.owner).toBe(true)
|
||||
const { injected } = b.chatViewApi(b.rootReference)
|
||||
// The Host's own message reaches the reader with the stable code beside it, and the Session it was
|
||||
// asked of is the one that shows it.
|
||||
|
||||
@@ -1959,6 +1959,13 @@ describe('strips and variants', () => {
|
||||
}
|
||||
})
|
||||
|
||||
it('announces a refused branch from the machine store as an alert', () => {
|
||||
const { view, shell } = bench()
|
||||
// The Chat page reports a refused branch through this store; the bar renders the new copy.
|
||||
act(() => { shell.notify('error', '未能完成分支:fork child rename failed') })
|
||||
expect(view.getByRole('alert').textContent).toContain('未能完成分支:fork child rename failed')
|
||||
})
|
||||
|
||||
it('renders an information notice from the machine store as a status strip', () => {
|
||||
const { view, shell } = bench()
|
||||
act(() => { shell.notify('info', '命令完成了') })
|
||||
|
||||
Reference in new issue
Block a user