Files
Dune/tests/truthtrance-hand-inventory-controls.test.tsx
T
Quintine 6eb417ff32
Verify and publish checkpoint container / container (push) Failing after 11m16s
Add Truthtrance weapon and defense types
2026-10-29 03:46:42 +11:00

18 lines
1.0 KiB
TypeScript

import test from 'node:test';
import assert from 'node:assert/strict';
import { createElement } from 'react';
import { renderToStaticMarkup } from 'react-dom/server';
import { CardCountFields } from '../components/truthtrance-card-count';
import type { HandInventoryFact } from '../game/truthtrance-hand-inventory';
void test('inventory controls offer precise printed primary attack and defense types', () => {
const value: HandInventoryFact = { kind: 'handInventory', category: 'poisonWeapon', compare: 'gte', value: 1 };
const html = renderToStaticMarkup(createElement(CardCountFields, { value, onChange() {} }));
for (const category of ['projectileWeapon', 'poisonWeapon', 'projectileDefense', 'poisonDefense'])
assert.match(html, new RegExp(`value="${category}"`));
assert.match(html, /Poison Blade and Shield Snooper match both/);
assert.match(html, /Mirror Weapon has no fixed poison or/);
assert.match(html, /Alternate uses and faction powers do not change/);
assert.match(html, /Number of cards/);
});