mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 14:45:24 +00:00
fix: load plugin strings on guest pages, plugin wording and drop unused keys
This commit is contained in:
1 parent
f803bfc140
commit
406766eddd
19 files changed
+81
-292
No files matched your search
@@ -24,6 +24,7 @@ import {
|
||||
visibleRailItems,
|
||||
} from "@/sidebar/rail-items";
|
||||
import { getTabType, resetTabTypes } from "@/shell/tab-registry";
|
||||
import i18n from "@/i18n/i18n";
|
||||
|
||||
function summary(
|
||||
id: string,
|
||||
@@ -263,6 +264,21 @@ describe("plugin loader", () => {
|
||||
expect(isPluginFrontendActive("alpha")).toBe(true);
|
||||
});
|
||||
|
||||
it("loads plugin strings on guest pages", async () => {
|
||||
modules.guest = railPlugin("guest");
|
||||
plugins = [summary("guest", { locales: ["en"] })];
|
||||
configurePluginLoader({
|
||||
fetchPlugins: async () => plugins,
|
||||
importFrontend: async (entry) => modules[entry.id],
|
||||
loadLocale: async () => ({ hello: "Hello guest" }),
|
||||
injectCss: () => null,
|
||||
});
|
||||
|
||||
await startPluginRuntime({ guest: true });
|
||||
await i18n.loadNamespaces("guest");
|
||||
expect(i18n.t("hello", { ns: "guest" })).toBe("Hello guest");
|
||||
});
|
||||
|
||||
it("settles even when the plugin list cannot be fetched", async () => {
|
||||
vi.spyOn(console, "error").mockImplementation(() => {});
|
||||
configurePluginLoader({
|
||||
|
||||
Reference in new issue
Block a user