flagon-io/g1t

public

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

g1t/apps/web/app/lib/trial.test.ts

19 lines758 bytesCodeBlame

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put1import assert from "node:assert/strict";
2import { test } from "node:test";
3
4import { trialClosed } from "./trial.ts";
5
6const base = { usedMicros: 0, limitMicros: 1_000_000, endsAt: null };
7
8test("an open trial says nothing", () => {
9 assert.equal(trialClosed({ ...base, open: true, reason: null }, "acme"), null);
10 assert.equal(trialClosed(null, "acme"), null);
11});
12
13test("a spent trial and a given-out month say so", () => {
14 assert.equal(trialClosed({ ...base, open: false, reason: "used" }, "acme"), "acme has used its trial credit on g1t.");
15 assert.equal(
16 trialClosed({ ...base, open: false, reason: "pool", waitsUntil: "2026-11-01T00:00:00Z" }, "acme"),
17 "This month's free trials are all given out; new ones start on November 1.",
18 );
19});