fix: skip restore confirmation during onboarding
This commit is contained in:
2 files changed
+6
-9
No files matched your search
@@ -2,11 +2,7 @@
|
|||||||
|
|
||||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
|
|
||||||
import { getStepAfterRestorePreview, waitForServerReadinessAsync } from "./database-restore-flow";
|
import { waitForServerReadinessAsync } from "./database-restore-flow";
|
||||||
|
|
||||||
it("requires confirmation after every restore preview", () => {
|
|
||||||
expect(getStepAfterRestorePreview()).toBe("confirm");
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("waitForServerReadinessAsync", () => {
|
describe("waitForServerReadinessAsync", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -29,8 +29,6 @@ const RESTART_REQUEST_TIMEOUT_MS = 5_000;
|
|||||||
|
|
||||||
export type ServerReadinessResult = "ready" | "timedOut" | "aborted";
|
export type ServerReadinessResult = "ready" | "timedOut" | "aborted";
|
||||||
|
|
||||||
export const getStepAfterRestorePreview = (): RestoreStep => "confirm";
|
|
||||||
|
|
||||||
interface WaitForServerReadinessOptions {
|
interface WaitForServerReadinessOptions {
|
||||||
restartAfterMs: number;
|
restartAfterMs: number;
|
||||||
signal: AbortSignal;
|
signal: AbortSignal;
|
||||||
@@ -291,8 +289,11 @@ export const DatabaseRestoreFlow = ({ variant = "card", onRestoreComplete }: Dat
|
|||||||
<>
|
<>
|
||||||
<BackupPreviewPanel analysis={analysis} />
|
<BackupPreviewPanel analysis={analysis} />
|
||||||
<Group justify="flex-end">
|
<Group justify="flex-end">
|
||||||
<Button rightSection={<IconArrowRight size={16} />} onClick={() => setStep(getStepAfterRestorePreview())}>
|
<Button
|
||||||
{t("continueToRestore")}
|
rightSection={<IconArrowRight size={16} />}
|
||||||
|
onClick={() => (variant === "standalone" ? void handleConfirm() : setStep("confirm"))}
|
||||||
|
>
|
||||||
|
{variant === "standalone" ? t("confirm.submit") : t("continueToRestore")}
|
||||||
</Button>
|
</Button>
|
||||||
</Group>
|
</Group>
|
||||||
</>
|
</>
|
||||||
|
|||||||
Reference in new issue
Block a user