Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tests/strategy_switch_worker_validation.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import { fileURLToPath } from "node:url";
import { dirname, resolve } from "node:path";

import { __test } from "../web/strategy-switch-console/worker.js";

const root = resolve(dirname(fileURLToPath(import.meta.url)), "..");
const indexHtml = readFileSync(resolve(root, "web/strategy-switch-console/index.html"), "utf8");
const renderPlatformsBody = indexHtml.match(/function renderPlatforms\(\) \{([\s\S]*?)\n \}/)?.[1] || "";
assert.ok(!renderPlatformsBody.includes("syncStrategyForAccount("));

const strategyProfiles = __test.normalizeStrategyProfilesPayload(
[
{
Expand Down
1 change: 0 additions & 1 deletion web/strategy-switch-console/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,6 @@ <h2 data-i18n="summary">切换摘要</h2>
strip.innerHTML = "";
for (const platform of Object.keys(platformMeta)) {
ensureAccountSelection(platform);
syncStrategyForAccount(platform);
const meta = platformMeta[platform];
const form = state.forms[platform];
const account = selectedAccount(platform);
Expand Down
2 changes: 1 addition & 1 deletion web/strategy-switch-console/page_asset.js

Large diffs are not rendered by default.