DevPlace CI / test (push) Failing after 44m45s
Continuous Delivery could never be turned off once a crop was planted. Add a one-shot per-plot "stop after harvest" flag (POST /game/plot/stop, Devii tool game_plot_stop, game_plots.stop_after_harvest), cleared by the next plant, autoreplant claim or Refactor. Autoreplant now also respects crop locks through the shared _crop_lock predicate. Plan and measurements in happyplanting.md. Also includes the pending community sync, node network and related work in the tree; the full suite passed (4999) with all of it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
21 lines
1.1 KiB
JavaScript
21 lines
1.1 KiB
JavaScript
import test from "node:test";
|
|
import assert from "node:assert/strict";
|
|
import { describeState, displayLabel } from "../ui/popup.js";
|
|
|
|
test("a suspended state shows the end time in DD/MM/YYYY and says it retries", () => {
|
|
const text = describeState({ state: "suspended", suspendedUntil: "2026-03-05T10:07:00Z", detail: "x" });
|
|
assert.match(text, /^Suspended until \d{2}\/\d{2}\/2026 \d{2}:\d{2}, retrying automatically$/);
|
|
assert.equal(describeState({ state: "suspended", suspendedUntil: "" }), "Suspended, retrying automatically");
|
|
});
|
|
|
|
test("other states show detail then last error", () => {
|
|
assert.equal(describeState({ state: "online", detail: "ok", lastError: "e" }), "ok");
|
|
assert.equal(describeState({ state: "backoff", detail: "", lastError: "e" }), "e");
|
|
});
|
|
|
|
test("the server label is the authority and the local label is the fallback", () => {
|
|
assert.equal(displayLabel({ deviceLabel: "Server name" }, { label: "typed" }), "Server name");
|
|
assert.equal(displayLabel({ deviceLabel: "" }, { label: "typed" }), "typed");
|
|
assert.equal(displayLabel({}, { label: "typed" }), "typed");
|
|
});
|