mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-03 12:02:50 +08:00
merge: sync console self-update and fixes from master into dev
This commit is contained in:
commit
eddc098d29
35 files changed
+5355
-22
No files matched your search
@@ -45,6 +45,7 @@ const defaults = path => ({
|
||||
"/session": { authenticated: true, mustChangePassword: false, csrfToken: "test-csrf" },
|
||||
"/server": settings(), "/overview": overview, "/sessions": { sessions: [] }, "/invites": { invites: [] },
|
||||
"/diagnostics": { gateway: { version: "test", node: "test", platform: "test", arch: "test" }, database: { schemaVersion: 1 }, sessions: { created: 0 } },
|
||||
"/update": { currentVersion: "test", deployment: { mode: "source", platform: "test", architecture: "test", applyAllowed: false, reasonCode: "DEPLOYMENT_SOURCE", upgradePath: "source" }, task: null },
|
||||
"/logs?limit=100": { available: false, entries: [], sessions: [] }, "/audit?limit=50": { events: [] },
|
||||
"/skins": { skins: [], defaultSkinId: "builtin.light" },
|
||||
"/ts-admin/settings": tsSettings(), "/ts-admin/overview": tsOverview(),
|
||||
@@ -453,6 +454,15 @@ test("store install submits the reviewed revision once and reloads the instance
|
||||
});
|
||||
function manifestForStoreTest() { return { id: "store-test", name: "Fixture", version: "1.0.0", author: "Fixture", license: "MIT", minAppVersion: "0.2.8", installedAt: 1 }; }
|
||||
|
||||
test("all update maintenance copy is explicit in each supported language", async () => {
|
||||
const { adminOrganizationCopy } = await vite.ssrLoadModule("/src/i18n/admin-organization.ts");
|
||||
const keys = Object.keys(adminOrganizationCopy.zh).filter(key => key.startsWith("update")).sort();
|
||||
assert.ok(keys.length >= 30);
|
||||
for (const language of ["zh", "en", "de", "ru", "ja"]) {
|
||||
for (const key of keys) assert.ok(adminOrganizationCopy[language][key]?.trim(), `${language}.${key}`);
|
||||
}
|
||||
});
|
||||
|
||||
test("all store translations are explicit in each supported language", async () => {
|
||||
const { skinStoreCopy } = await vite.ssrLoadModule("/src/i18n/skin-store.ts");
|
||||
const keys = Object.keys(skinStoreCopy.zh).sort();
|
||||
@@ -715,6 +725,48 @@ test("settings and operations render explicit localized sections with valid deep
|
||||
}
|
||||
});
|
||||
|
||||
test("check-only deployments retain release checks and notes without install controls", async () => {
|
||||
const { createSSRApp } = await import("vue");
|
||||
const { renderToString } = await import("vue/server-renderer");
|
||||
const { default: Operations } = await vite.ssrLoadModule("/src/components/admin/AdminOperations.vue");
|
||||
await mount("/admin/operations?section=maintenance");
|
||||
const model = reactive(state.adminOperations);
|
||||
for (const [mode, reasonCode] of [["source", "DEPLOYMENT_SOURCE"], ["docker", "DEPLOYMENT_DOCKER"],
|
||||
["release-package", "WINDOWS_APPLY_UNVERIFIED"], ["release-package", "LINUX_ARM64_APPLY_UNVERIFIED"], ["release-package", "DEPLOYMENT_SUPERVISED"]]) {
|
||||
model.operations.update.deployment = { mode, platform: "linux", architecture: "x64", applyAllowed: false, reasonCode, upgradePath: "release-package" };
|
||||
let checked = false;
|
||||
handler = path => {
|
||||
assert.equal(path, "/update/check"); checked = true;
|
||||
return Promise.resolve(json({ currentVersion: "0.3.2", releases: [{ version: "0.4.0", canApply: false, blockedReason: reasonCode,
|
||||
tag: "v0.4.0", assetName: "webspeak-webclient-v0.4.0-linux-x64.tar.gz", assetSize: 100,
|
||||
assetAvailable: true, hasChecksums: true, digest: null,
|
||||
publishedAt: "2026-11-25T00:00:00.000Z", releaseUrl: "https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.4.0" }] }));
|
||||
};
|
||||
await model.checkForUpdates();
|
||||
assert.equal(checked, true);
|
||||
assert.equal(state.errorMessage, "");
|
||||
const html = await renderToString(createSSRApp(Operations, { model: state.adminOperations, i18n: state.i18n, initialSection: "maintenance" }));
|
||||
assert.ok(html.includes(state.i18n.tr("updateCheckAction")), reasonCode);
|
||||
assert.ok(html.includes("/releases/tag/v0.4.0"), reasonCode);
|
||||
assert.ok(html.includes('data-admin-update="check"'), reasonCode);
|
||||
assert.ok(!html.includes('data-admin-update="apply"'), reasonCode);
|
||||
if (reasonCode === "DEPLOYMENT_SUPERVISED") assert.ok(html.includes(state.i18n.tr("updateBlockedSupervised")));
|
||||
}
|
||||
});
|
||||
|
||||
test("update error codes resolve to their dedicated five-language labels", async () => {
|
||||
const { adminOrganizationCopy } = await vite.ssrLoadModule("/src/i18n/admin-organization.ts");
|
||||
await mount("/admin/server");
|
||||
for (const language of ["zh", "en", "de", "ru", "ja"]) {
|
||||
state.language = language;
|
||||
const copy = adminOrganizationCopy[language];
|
||||
assert.equal(state.i18n.errorText("UPDATE_LOCK_FAILED"), copy.updateErrorLockFailed);
|
||||
assert.equal(state.i18n.errorText("UPDATE_UNAVAILABLE"), copy.updateErrorUnavailable);
|
||||
assert.equal(state.i18n.errorText("UPDATE_RESTART_UNAVAILABLE"), copy.updateErrorUnavailable);
|
||||
assert.notEqual(state.i18n.errorText("UPDATE_LOCK_FAILED"), copy.updateErrorGeneric);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
test("loading saved custom Query ports never treats them as unsaved transport defaults", async () => {
|
||||
for (const [transport, queryPort] of [["ssh", 10011], ["tcp", 10022]]) {
|
||||
|
||||
Reference in new issue
Block a user