Fix restricted map controls and release verification
All checks were successful
Deploy MineGeo to Dokploy / deploy (push) Successful in 5m17s

This commit is contained in:
2026-10-20 16:46:36 +05:00
parent de0e891b62
commit 690fe12c2c
8 changed files with 222 additions and 47 deletions

View File

@@ -134,3 +134,20 @@ test("release Markdown renders emphasis and safe links, escaping executable HTML
assert.match(html, /href="https:\/\/minegeo.site\/docs"/);
assert.doesNotMatch(html, /href="javascript:/);
});
test("release lists directly after a paragraph and wrapped bullet text remain lists", () => {
const html = renderToStaticMarkup(
createElement(ReleaseNotes, {
body: "This release improves:\n- **Controls:** Keyboard access\n and fixed map gestures.\n- Changelog lists.\nMore updates soon.",
}),
);
assert.match(html, /<p>This release improves:<\/p><ul>/);
assert.match(
html,
/<li><strong>Controls:<\/strong> Keyboard access and fixed map gestures\.<\/li>/,
);
assert.match(
html,
/<li>Changelog lists\.<\/li><\/ul><p>More updates soon\.<\/p>/,
);
});

View File

@@ -0,0 +1,54 @@
import assert from "node:assert/strict";
import test from "node:test";
import {
deploymentState,
knownDeploymentIds,
retryableStatusPoll,
} from "../scripts/dokploy-deployment-state.mjs";
test("deployment monitoring cannot mistake any older successful build for the new upload", () => {
const baseline = [
{ id: "previous", status: "done" },
{ deploymentId: "older", status: "done" },
];
const ids = knownDeploymentIds({ deployments: baseline });
assert.equal(deploymentState(baseline, ids), "waiting");
assert.equal(deploymentState({ data: [baseline[1]] }, ids), "waiting");
assert.equal(
deploymentState([{ id: "new", status: "running" }, ...baseline], ids),
"running",
);
assert.equal(
deploymentState([{ id: "new", status: "done" }, ...baseline], ids),
"done",
);
assert.equal(
deploymentState([{ id: "new", status: "error" }, ...baseline], ids),
"error",
);
assert.equal(
deploymentState([{ id: "new", status: "cancelled" }], ids),
"cancelled",
);
});
test("deployment monitoring rejects malformed responses and baselines", () => {
assert.throws(() => knownDeploymentIds({ error: "Unauthorized" }));
assert.throws(() => deploymentState([null], []));
assert.throws(() => deploymentState([], "previous"));
assert.equal(
deploymentState([{ id: "first", status: "new-status" }], []),
"unknown",
);
});
test("only bounded transient read-only status failures retry; auth and TLS verification errors stop", () => {
for (const exit of [7, 28, 52, 55, 56])
assert.equal(retryableStatusPoll(exit, 0, 1), true);
for (const code of [408, 429, 500, 502, 503, 504])
assert.equal(retryableStatusPoll(0, code, 6), true);
for (const code of [400, 401, 403, 404])
assert.equal(retryableStatusPoll(0, code, 1), false);
assert.equal(retryableStatusPoll(60, 0, 1), false);
assert.equal(retryableStatusPoll(28, 0, 7), false);
});