test: stabilize asynchronous UI checks in release CI
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s

Control the native inventory retry response and wait for the complete
browser-close result instead of asserting on intermediate renders.
Run native note-layout input in a visible isolated Electron window,
scan the fixture dependencies up front, and report timeout explicitly.
Keep all behavior and geometry assertions and Electron sandboxing.

The three focused regressions, full typecheck, and lint pass locally.
Linux CI must confirm the release failures are resolved. No product,
Agent, version, or release-tag changes are included.
This commit is contained in:
mesalogo
2026-09-26 01:53:04 +08:00
parent 107dc974e3
commit cd27163660
4 changed files with 46 additions and 13 deletions
+15 -6
View File
@@ -9368,6 +9368,7 @@ describe("App", () => {
supportsToolExecution: true, detail: "Ready",
});
const empty = await api.runtimeCustomization.getNativeSnapshot({ provider: "opencode" });
const retry = deferred<typeof empty>();
vi.mocked(api.runtimeCustomization.getNativeSnapshot).mockClear();
vi.mocked(api.runtimeCustomization.getNativeSnapshot)
.mockResolvedValueOnce({
@@ -9375,18 +9376,26 @@ describe("App", () => {
available: false,
inventoryStatus: "unavailable",
})
.mockResolvedValueOnce({
.mockReturnValueOnce(retry.promise);
render(<App />);
await waitFor(() =>
expect(api.runtimeCustomization.getNativeSnapshot).toHaveBeenCalledTimes(2),
);
openComposerOptions();
expect(screen.queryByRole("button", { name: /OpenCode Runtime Agent/u })).not.toBeInTheDocument();
await act(async () => {
retry.resolve({
...empty,
available: true,
inventoryStatus: "partial",
agents: [{ id: "planner", name: "Planner", mode: "primary", native: true, hidden: false }],
commands: [{ id: "review", name: "review", source: "command" }],
});
render(<App />);
openComposerOptions();
fireEvent.click(await screen.findByRole("button", { name: /OpenCode Runtime Agent/u }));
await retry.promise;
});
fireEvent.click(screen.getByRole("button", { name: /OpenCode Runtime Agent/u }));
expect(screen.getByRole("menuitemradio", { name: /Planner/u })).toBeVisible();
fireEvent.keyDown(screen.getByRole("menu", { name: "OpenCode Runtime Agent" }), { key: "Escape" });
fireEvent.click(screen.getByRole("button", { name: /Runtime 快捷操作/u }));
@@ -1795,8 +1795,11 @@ describe('RightAssistantSidebar resizing', () => {
).toBeInTheDocument()
fireEvent.click(screen.getByRole('button', { name: '关闭浏览器 · conversation-a' }))
await waitFor(() => expect(screen.queryByRole('tab', { name: '浏览器 · conversation-a' })).not.toBeInTheDocument())
expect(screen.queryByText('Close denied')).not.toBeInTheDocument()
await waitFor(() => {
expect(browserApi.closeTab).toHaveBeenCalledTimes(2)
expect(screen.queryByRole('tab', { name: '浏览器 · conversation-a' })).not.toBeInTheDocument()
expect(screen.queryByText('Close denied')).not.toBeInTheDocument()
})
})
it.each(['create', 'close'] as const)(