Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion frontend/ui-core/src/screens/DatasetScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,9 @@ function ExportDialog({
const lost = failure !== null && needsConsent ? lostClasses(failure.detail) : null;
const running = exportRelease.isPending || (job.data !== undefined && !isSettled(job.data));
const stopped =
job.data !== undefined && job.data.state !== "succeeded" ? job.data : null;
job.data !== undefined && isSettled(job.data) && job.data.state !== "succeeded"
? job.data
: null;

function run(allowLossy: boolean): void {
setSaved(false);
Expand Down
12 changes: 11 additions & 1 deletion frontend/ui-core/src/screens/dataset.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/

import { QueryClient } from "@tanstack/react-query";
import { render, screen, waitFor, within } from "@testing-library/react";
import { cleanup, render, screen, waitFor, within } from "@testing-library/react";
import { userEvent } from "@testing-library/user-event";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import type { JSX, ReactNode } from "react";
Expand Down Expand Up @@ -715,6 +715,16 @@ describe("export, and the third gate word", () => {
expect(badge.className).toContain("text-primary");
});

it("shows no failure while the export is still queued or running", async () => {
// A job that has not settled has nothing to explain yet; the failure
// sentence belongs to a job that stopped, never to one still working.
await exportWith("queued");
expect(screen.queryByTestId("export-job-error")).toBeNull();
cleanup();
await exportWith("running");
expect(screen.queryByTestId("export-job-error")).toBeNull();
});

it("says a finished export is done, in the success token (#391)", async () => {
const badge = await exportWith("succeeded");
expect(badge.textContent).toContain("Done");
Expand Down
Loading