fix(tests): remove low-value source snapshots and define test standards

This commit is contained in:
t8y2 committed 2026-09-11 11:51:24 +08:00
1 parent ead906477f
commit 8186c697d5
80 files changed
+14 -2225

No files matched your search

@@ -1,13 +0,0 @@
import { readFileSync } from "node:fs";
import { describe, expect, it } from "vitest";
const settingsDialogSource = readFileSync(new URL("../../../components/editor/EditorSettingsDialog.vue", import.meta.url), "utf8");
describe("openDataTabsNextToActive settings control", () => {
it("binds the navigation switch through apply and both reset paths", () => {
expect(settingsDialogSource).toContain("const editOpenDataTabsNextToActive = ref(settingsStore.editorSettings.openDataTabsNextToActive)");
expect(settingsDialogSource).toContain("openDataTabsNextToActive: editOpenDataTabsNextToActive.value");
expect(settingsDialogSource.match(/editOpenDataTabsNextToActive\.value = DEFAULT_EDITOR_SETTINGS\.openDataTabsNextToActive/g)).toHaveLength(2);
expect(settingsDialogSource).toContain('id="open-data-tabs-next-to-active" v-model="editOpenDataTabsNextToActive"');
});
});
@@ -1,18 +0,0 @@
import { readFileSync } from "node:fs";
import { describe, expect, it } from "vitest";
const appSource = readFileSync(new URL("../../../App.vue", import.meta.url), "utf8");
const settingsDialogSource = readFileSync(new URL("../../../components/editor/EditorSettingsDialog.vue", import.meta.url), "utf8");
const changelogPanelSource = readFileSync(new URL("../../../components/settings/ChangelogPanel.vue", import.meta.url), "utf8");
describe("about page update check", () => {
it("reuses the toolbar update check and pending state", () => {
expect(changelogPanelSource).toContain('"check-updates": []');
expect(changelogPanelSource).toContain("@click=\"emit('check-updates')\"");
expect(changelogPanelSource).toContain(':disabled="checkingUpdates"');
expect(settingsDialogSource).toContain(':checking-updates="props.checkingUpdates"');
expect(settingsDialogSource).toContain("@check-updates=\"emit('check-updates')\"");
expect(appSource).toContain(':checking-updates="checkingUpdates"');
expect(appSource).toContain('@check-updates="checkUpdates()"');
});
});