test(share): align export failure assertions with current copy

This commit is contained in:
a1chzt
2026-10-14 22:14:02 +08:00
parent 5a0ec91e16
commit bab4b978d4
2 changed files with 7 additions and 2 deletions
@@ -378,7 +378,9 @@ describe("Owner P1 real FileViewer export-to-share chain", () => {
else fail(new Error("export failed"));
});
if (outcome === "failed") {
await screen.findByText("export failed");
await screen.findByText("Export failed");
expect(screen.getByText("This export did not complete. Please try again.")).toBeVisible();
expect(screen.queryByText("export failed")).toBeNull();
} else {
await waitFor(() =>
expect(screen.queryByText(/Exporting/i)).toBeNull(),
@@ -56,7 +56,10 @@ describe('FileViewer real HTML export completion seam', () => {
await exportHtml();
await waitFor(() => expect(seam.complete).toHaveBeenCalledWith('failed'));
expect(screen.queryByText('Share the link, invite feedback')).toBeNull();
expect(screen.getAllByText('export test failure').length).toBeGreaterThan(0);
expect(screen.getByText('Export failed')).toBeTruthy();
expect(screen.getByText('This export did not complete. Please try again.')).toBeTruthy();
expect(screen.queryByText('export test failure')).toBeNull();
expect(screen.queryByText('Export complete')).toBeNull();
});
it('reports a synchronous exporter throw as failure', async () => {
seam.exportHtml.mockImplementation(() => { throw new Error('sync export failure'); });