mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-17 04:50:52 +00:00
* fix(#2466): automated Cursor CLI fix * fix: address Codex review on PR #2469 --------- Co-authored-by: netcatty-bot <308658023+netcatty-bot@users.noreply.github.com>
26 lines
1.3 KiB
TypeScript
26 lines
1.3 KiB
TypeScript
import test from "node:test";
|
|
import assert from "node:assert/strict";
|
|
import { readFileSync } from "node:fs";
|
|
|
|
test("USE_LOCAL conflict resolution forces upload-local without decrypting remote", () => {
|
|
const source = readFileSync(new URL("./CloudSyncSettings.tsx", import.meta.url), "utf8");
|
|
const useLocalIndex = source.indexOf("} else if (resolution === 'USE_LOCAL') {");
|
|
const syncNowIndex = source.indexOf("results = await sync.syncNow(localPayload, {", useLocalIndex);
|
|
const overrideShrinkIndex = source.indexOf("overrideShrink: true,", syncNowIndex);
|
|
const uploadLocalIndex = source.indexOf("conflictActionOverride: 'upload-local',", syncNowIndex);
|
|
const nextBranchIndex = source.indexOf("toast.success(t('cloudSync.resolve.uploaded'));", syncNowIndex);
|
|
|
|
assert.notEqual(useLocalIndex, -1);
|
|
assert.notEqual(syncNowIndex, -1);
|
|
assert.notEqual(overrideShrinkIndex, -1);
|
|
assert.notEqual(uploadLocalIndex, -1);
|
|
assert.notEqual(nextBranchIndex, -1);
|
|
assert.ok(
|
|
useLocalIndex < syncNowIndex
|
|
&& syncNowIndex < overrideShrinkIndex
|
|
&& overrideShrinkIndex < uploadLocalIndex
|
|
&& uploadLocalIndex < nextBranchIndex,
|
|
"keep-local must re-sync with conflictActionOverride upload-local so a new master password can overwrite an undecryptable cloud backup",
|
|
);
|
|
});
|