Add standalone desktop launch modes

This commit is contained in:
Курнат Андрей
2026-06-01 23:15:20 +03:00
parent 91e8a6e9fd
commit c8c1be7a30
6 changed files with 169 additions and 26 deletions
+19
View File
@@ -0,0 +1,19 @@
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);
});
});