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
2 changes: 1 addition & 1 deletion scripts/ios-fleet.sha256
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# GitHub-hosted macos-latest ships from this copy, not /Users/jay/apps/ios-fleet.
# Refresh with: bash scripts/ios-fleet-pin.sh --update (then land it in a PR)
e38eb93f5e2b35b9884bf280dd56942ade790cbe8e7119d97f4518faf5fd07a6 ship-testflight.sh
b4d957a5c4dbf1c7368fdcf110df54e0107789f48a9493e6f691e7f186f123db asc-api.mjs
d01686f686ce83cca9bfbadb300a99cd67e7cce011a992722250ab2158a1f5c9 asc-api.mjs
b73de468651ab800d0efea38ae3a620e85801e87b5954e195f07fc30435a2644 asc-key.mjs
3de97aa5b28a8f15571eb4ec3c34436d720b99bd43f852c320387d57ea3927ca apps.json
b41b09704f40be9e0a14a66ec302589d763b03ef65baf37437c00fdaa55287d0 AppUpdatePrompt.swift
Expand Down
2 changes: 1 addition & 1 deletion scripts/ios-fleet/asc-api.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ const AGENT_MARKER = new RegExp(`\\[\\s*(?:ag|${AGENT_NAMES})\\s*\\]`, "gi");
// so the final rendered-body assertion tests for that form specifically.
const AGENT_NAME_DENY = new RegExp(`(?:\\b(?:${AGENT_NAMES})\\b|\\[\\s*ag\\s*\\])`, "i");

function centralTimestamp(now = new Date()) {
export function centralTimestamp(now = new Date()) {
// AG***-S**C template: "Wed, Aug 12, 2026 at 1:15am" -- the owner's clock
// (America/Chicago, so DST is automatic), 12-hour, lower-case am or pm, and
// NO timezone abbreviation. Intl yields "1:15 PM" with a space or a narrow
Expand Down
44 changes: 44 additions & 0 deletions scripts/ios-fleet/asc-api.timestamp.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/**
* centralTimestamp() is the "Released:" clock in TestFlight What to Test.
*
* The template is "Wed, Aug 12, 2026 at 1:15am": America/Chicago, 12-hour,
* lowercase am/pm, no space before the meridiem, and no timezone suffix.
* Intl may put a normal space or U+202F before AM/PM. Both fold away.
*
* 2026-08-12 06:15 UTC is 1:15am CDT. Nothing here calls App Store Connect.
*/
import assert from "node:assert/strict";
import test from "node:test";

import { centralTimestamp } from "./asc-api.mjs";

const ONE_FIFTEEN_AM = new Date("2026-08-12T06:15:00.000Z");
const ONE_FIFTEEN_PM = new Date("2026-08-12T18:15:00.000Z");

test("centralTimestamp emits 1:15am with no CT suffix", () => {
const stamp = centralTimestamp(ONE_FIFTEEN_AM);
assert.equal(stamp, "Wed, Aug 12, 2026 at 1:15am");
assert.match(stamp, /1:15am/);
assert.equal(stamp.includes("CT"), false);
assert.equal(stamp.includes(" AM"), false);
assert.equal(stamp.includes("\u202f"), false);
});

test("centralTimestamp emits lowercase pm", () => {
assert.equal(centralTimestamp(ONE_FIFTEEN_PM), "Wed, Aug 12, 2026 at 1:15pm");
});

test("centralTimestamp folds a narrow no-break space before the meridiem", () => {
const Original = Intl.DateTimeFormat;
Intl.DateTimeFormat = class extends Original {
format(value) {
return super.format(value).replace(/ ([AP]M)$/, "\u202f$1");
}
};
try {
assert.equal(centralTimestamp(ONE_FIFTEEN_AM), "Wed, Aug 12, 2026 at 1:15am");
assert.equal(centralTimestamp(ONE_FIFTEEN_PM), "Wed, Aug 12, 2026 at 1:15pm");
} finally {
Intl.DateTimeFormat = Original;
}
});
Loading