Add birthday previews and restore checklist taps

This commit is contained in:
Codex 2026-10-05 19:54:15 +01:00
parent d2c7f004ea
commit aaa3013890
11 changed files with 146 additions and 27 deletions

View file

@ -47,5 +47,13 @@ class StoreTests(unittest.TestCase):
self.assertTrue(all(snapshot["checks"].values()))
class StaticInteractionTests(unittest.TestCase):
def test_native_checkboxes_cover_each_tickable_row(self):
styles = (Path(__file__).parent.parent / "static" / "styles.css").read_text()
self.assertIn(".today-card > input, .crop-row input, .bundle-item input", styles)
self.assertIn("inset: 0", styles)
self.assertNotIn(".crop-row input, .bundle-item input { position: absolute; opacity: 0; pointer-events: none; }", styles)
if __name__ == "__main__":
unittest.main()

14
tests/test_calendar.js Normal file
View file

@ -0,0 +1,14 @@
const assert = require("node:assert/strict");
const calendar = require("../static/calendar.js");
const birthdays = {
spring: { 4: ["Kent", 2], 7: ["Lewis"] }
};
assert.equal(calendar.birthdayOn(birthdays, "spring", 4, 1), null);
assert.equal(calendar.birthdayOn(birthdays, "spring", 4, 2), "Kent");
assert.equal(calendar.birthdayOn(birthdays, "spring", 7, 1), "Lewis");
assert.equal(calendar.birthdayOn(birthdays, "spring", 7, 2), "Lewis");
assert.equal(calendar.birthdayOn(birthdays, "spring", 8, 1), null);
console.log("calendar tests passed");

18
tests/test_data.js Normal file
View file

@ -0,0 +1,18 @@
const assert = require("node:assert/strict");
global.window = {};
require("../static/data.js");
const data = global.window.VALLEY_DATA;
const birthdayNames = Object.values(data.birthdays)
.flatMap(days => Object.values(days))
.map(([name]) => name);
for (const name of birthdayNames) {
const profile = data.giftProfiles[name];
assert.ok(profile, `${name} needs a gift profile`);
assert.ok(profile.loves.length > 0, `${name} needs a loved gift`);
assert.ok(profile.avoid.length > 0, `${name} needs a gift to avoid`);
}
console.log("birthday gift data tests passed");