mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-15 02:20:38 +09:00
24 lines
904 B
TypeScript
24 lines
904 B
TypeScript
|
|
import { describe, expect, it } from "vitest";
|
||
|
|
import {
|
||
|
|
DEFAULT_INSTANCE_SETTINGS_PATH,
|
||
|
|
normalizeRememberedInstanceSettingsPath,
|
||
|
|
} from "./instance-settings";
|
||
|
|
|
||
|
|
describe("normalizeRememberedInstanceSettingsPath", () => {
|
||
|
|
it("keeps known instance settings pages", () => {
|
||
|
|
expect(normalizeRememberedInstanceSettingsPath("/instance/settings/experimental")).toBe(
|
||
|
|
"/instance/settings/experimental",
|
||
|
|
);
|
||
|
|
expect(normalizeRememberedInstanceSettingsPath("/instance/settings/plugins/example?tab=config#logs")).toBe(
|
||
|
|
"/instance/settings/plugins/example?tab=config#logs",
|
||
|
|
);
|
||
|
|
});
|
||
|
|
|
||
|
|
it("falls back to the default page for unknown paths", () => {
|
||
|
|
expect(normalizeRememberedInstanceSettingsPath("/instance/settings/nope")).toBe(
|
||
|
|
DEFAULT_INSTANCE_SETTINGS_PATH,
|
||
|
|
);
|
||
|
|
expect(normalizeRememberedInstanceSettingsPath(null)).toBe(DEFAULT_INSTANCE_SETTINGS_PATH);
|
||
|
|
});
|
||
|
|
});
|