test: drop source-text assertion tests and merge locale checks

This commit is contained in:
t8y2 committed 2026-09-23 22:10:06 +08:00
1 parent 349d77d180
commit 8897e12714
257 files changed
+166 -12815

No files matched your search

@@ -3,7 +3,6 @@
import { createApp, nextTick, ref, type App } from "vue";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import type { InstalledPlugin, PluginWorkbenchContribution } from "@/types/database";
import pluginHostSource from "./PluginWorkbenchHost.vue?raw";
const mocks = vi.hoisted(() => ({
readPluginUiEntry: vi.fn(),
@@ -198,17 +197,3 @@ describe("PluginWorkbenchHost initialization", () => {
elementFromPoint.mockRestore();
});
});
describe("PluginWorkbenchHost file-save handle tracking", () => {
const hostSource = pluginHostSource;
const beginSaveSource = hostSource.slice(hostSource.indexOf("async function beginPluginFileSave"), hostSource.indexOf("async function writePluginFileChunkById"));
it("opens the save target through openTauriPluginFile so the write handle joins openTauriHandles", () => {
// A beginSave the plugin abandons (no finish/cancel) must still be
// reclaimed by unmount's disposeLocalFileHandles; a direct
// openPluginLocalFile call would leak the handle in the shared
// 64-slot registry for the lifetime of the workbench host.
expect(beginSaveSource).toContain("await openTauriPluginFile(pluginId, path, true)");
expect(beginSaveSource).not.toContain("openPluginLocalFile");
});
});
@@ -1,7 +1,6 @@
// @vitest-environment happy-dom
import { createApp, nextTick, type App, type ComponentPublicInstance } from "vue";
import { readFileSync } from "node:fs";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import type { InstalledPlugin, PluginRepositoryCatalogResult } from "@/types/database";
import type { MarketplacePluginListing } from "@/lib/plugins/pluginMarketplace";
@@ -494,11 +493,6 @@ function singleApi(single: Single) {
const replacements = ["marketplace", "rollback", "package", "url"] as const;
describe("PluginContributionsPanel workbench refresh", () => {
it("connects the panel event to the App workbench refresh entry", () => {
const source = readFileSync("apps/desktop/src/App.vue", "utf8");
expect(source).toMatch(/<PluginCenterPage\b[^>]*@plugin-runtime-replaced="refreshPluginWorkbenches"/);
});
it.each(replacements)("refreshes once with the returned plugin ID after Web %s succeeds", async (single) => {
singleApi(single).mockResolvedValueOnce({ plugin: installed("replaced", "2.0.0") });
await startSingle(single);