// How the think-clock reads. const test = require("node:test"); const assert = require("node:assert"); const path = require("path"); const ActionBar = require(path.join( __dirname, "..", "..", "JoshHeaps.Net", "wwwroot", "js", "casino", "holdem", "actionBar.js")); test("seconds under a minute", () => { assert.equal(ActionBar.formatTank(0), "0:00"); assert.equal(ActionBar.formatTank(7), "0:07"); assert.equal(ActionBar.formatTank(59), "0:59"); }); test("minutes and seconds", () => { assert.equal(ActionBar.formatTank(60), "1:00"); assert.equal(ActionBar.formatTank(241), "4:01"); assert.equal(ActionBar.formatTank(3599), "59:59"); }); test("past the hour it says the hour", () => { // A table left open on a hand reaches this, and "65:03" is a number the eye reads // as minutes and seconds when it isn't. assert.equal(ActionBar.formatTank(3600), "1:00:00"); assert.equal(ActionBar.formatTank(3903), "1:05:03"); assert.equal(ActionBar.formatTank(45296), "12:34:56"); }); test("the minutes are padded once there are hours, and not before", () => { // "1:5:03" would be wrong; "05:03" on its own would be odd. assert.equal(ActionBar.formatTank(3903), "1:05:03"); assert.equal(ActionBar.formatTank(303), "5:03"); }); test("a day is still a readable number rather than a wrapped one", () => { assert.equal(ActionBar.formatTank(90000), "25:00:00"); });