Files
QOffice/src/appRouting.test.ts
T
2026-06-01 23:15:20 +03:00

20 lines
774 B
TypeScript

import { describe, expect, it } from "vitest";
import { activeAppFromLocation } from "./appRouting";
describe("activeAppFromLocation", () => {
it.each([
["/", "", "", "word"],
["/qword", "", "", "word"],
["/qexcell", "", "", "sheets"],
["/qpowerpoint", "", "", "slides"],
["/qoutlook", "", "", "mail"],
["/index.html", "#/qexcell", "", "sheets"],
["/index.html", "#qpowerpoint", "", "slides"],
["/index.html", "", "?app=qoutlook", "mail"],
["/index.html", "", "?module=pptx", "slides"],
["/unknown", "", "", "word"]
])("определяет приложение для pathname=%s hash=%s search=%s", (pathname, hash, search, expected) => {
expect(activeAppFromLocation({ pathname, hash, search })).toBe(expected);
});
});