mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 02:54:31 +00:00
follow-up: align ingress, atomic paths, and channel tests with credential semantics (#33733)
Merged via squash.
Prepared head SHA: c290c2ab6a
Co-authored-by: joshavant <830519+joshavant@users.noreply.github.com>
Co-authored-by: joshavant <830519+joshavant@users.noreply.github.com>
Reviewed-by: @joshavant
This commit is contained in:
@@ -9,6 +9,8 @@ describe("buildAuthHealthSummary", () => {
|
||||
const now = 1_700_000_000_000;
|
||||
const profileStatuses = (summary: ReturnType<typeof buildAuthHealthSummary>) =>
|
||||
Object.fromEntries(summary.profiles.map((profile) => [profile.profileId, profile.status]));
|
||||
const profileReasonCodes = (summary: ReturnType<typeof buildAuthHealthSummary>) =>
|
||||
Object.fromEntries(summary.profiles.map((profile) => [profile.profileId, profile.reasonCode]));
|
||||
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
@@ -89,6 +91,31 @@ describe("buildAuthHealthSummary", () => {
|
||||
|
||||
expect(statuses["google:no-refresh"]).toBe("expired");
|
||||
});
|
||||
|
||||
it("marks token profiles with invalid expires as missing with reason code", () => {
|
||||
vi.spyOn(Date, "now").mockReturnValue(now);
|
||||
const store = {
|
||||
version: 1,
|
||||
profiles: {
|
||||
"github-copilot:invalid-expires": {
|
||||
type: "token" as const,
|
||||
provider: "github-copilot",
|
||||
token: "gh-token",
|
||||
expires: 0,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const summary = buildAuthHealthSummary({
|
||||
store,
|
||||
warnAfterMs: DEFAULT_OAUTH_WARN_MS,
|
||||
});
|
||||
const statuses = profileStatuses(summary);
|
||||
const reasonCodes = profileReasonCodes(summary);
|
||||
|
||||
expect(statuses["github-copilot:invalid-expires"]).toBe("missing");
|
||||
expect(reasonCodes["github-copilot:invalid-expires"]).toBe("invalid_expires");
|
||||
});
|
||||
});
|
||||
|
||||
describe("formatRemainingShort", () => {
|
||||
|
||||
Reference in New Issue
Block a user