GitHub(nextgroup2706/ken_nogi)は今後使わず自社Gitea運用に切替え。 NodeSrvは旧リポジトリの履歴を破棄しファイルのみ統合(Dokploy用サービスアカウントは 別途mygit-admin/NodeSrv.gitに履歴あり)。notepmエクスポート(12GB)とPleasanter インストーラzip(208MB)はサイズが大きいため.gitignoreで除外。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
27 lines
1.2 KiB
JavaScript
27 lines
1.2 KiB
JavaScript
const { test } = require("node:test");
|
|
const assert = require("node:assert");
|
|
const { computeStatus } = require("../src/lib/tokenStatus");
|
|
|
|
test("returns 有効 when refreshedAt is within the last 90 days", () => {
|
|
const now = new Date("2026-08-24T08:00:17.000Z");
|
|
const refreshedAt = "2026-08-24T08:00:17.000Z";
|
|
assert.strictEqual(computeStatus({ refreshedAt, now }), "有効");
|
|
});
|
|
|
|
test("returns 有効 even after the access token's own 24h expiry, as long as within 90 days (自動リフレッシュされるため)", () => {
|
|
const now = new Date("2026-08-25T09:00:00.000Z");
|
|
const refreshedAt = "2026-08-24T08:00:17.000Z";
|
|
assert.strictEqual(computeStatus({ refreshedAt, now }), "有効");
|
|
});
|
|
|
|
test("returns 要再認可 once 90 days have elapsed since refreshedAt (refresh tokenの有効期限)", () => {
|
|
const now = new Date("2026-11-23T00:00:00.000Z");
|
|
const refreshedAt = "2026-08-24T08:00:17.000Z";
|
|
assert.strictEqual(computeStatus({ refreshedAt, now }), "要再認可");
|
|
});
|
|
|
|
test("returns 要再認可 when refreshedAt is missing (未登録・異常データ)", () => {
|
|
const now = new Date("2026-08-24T08:00:17.000Z");
|
|
assert.strictEqual(computeStatus({ refreshedAt: null, now }), "要再認可");
|
|
});
|