game: tech research action + ship-action gating by researched techs (build gate, raised caps)

This commit is contained in:
2026-09-29 00:24:25 +00:00
parent 4ef924edd6
commit 8818f0928d
4 changed files with 249 additions and 7 deletions
+4
View File
@@ -129,6 +129,10 @@ describe('buildSystem', () => {
const { db } = await freshFile()
await getShipState(db)
// WEAPONS is gated behind the WEAPONS SYSTEMS tech (issue #9) — research it directly so this
// test keeps covering the cost path; the gate itself is covered in research.test.ts.
await db.db.update(schema.tech).set({ researched: true }).where(eq(schema.tech.slug, 'WEAPONS_SYSTEMS'))
await expect(buildSystem(db, 'WEAPONS')).rejects.toMatchObject({ status: 422 }) // no parts in the hold yet
await addItem(db, 'part', 'SERVO ACTUATOR', BUILD_PART_COST)