Extend Basic Emperor auction gifts to Nexus and Richese
Verify and publish checkpoint container / container (push) Canceled after 0s
Verify and publish checkpoint container / container (push) Canceled after 0s
This commit is contained in:
1 parent
b258c6867f
commit
dac1b432db
11 files changed
+509
-14
No files matched your search
@@ -0,0 +1,32 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import { createElement } from 'react';
|
||||
import { renderToStaticMarkup } from 'react-dom/server';
|
||||
import type { GameView } from '../game/engine';
|
||||
import { EmperorAuctionGift } from '../components/emperor-auction-gift';
|
||||
|
||||
/** Synthetic owner projection: this verifies the rendered distinction, not
|
||||
* a claim that a real cache-sale journey has already reached this control. */
|
||||
const view = (source?: 'richese') => ({
|
||||
players: [{id:'ally', name:'Ally'}],
|
||||
emperorAuctionGift: {event:'gift-event', recipient:'ally', maximum:5, ...(source ? {source} : {})},
|
||||
}) as unknown as GameView;
|
||||
const render = (game: GameView, busy = false) => renderToStaticMarkup(
|
||||
createElement(EmperorAuctionGift, {game, busy, act() {}}),
|
||||
);
|
||||
|
||||
void test('Richese sale describes the committed payment and retains gift and Continue controls', () => {
|
||||
const html = render(view('richese'));
|
||||
assert.match(html, /Share spice with Ally/);
|
||||
assert.match(html, /Continue settles the Richese sale with that payment after any gift response/);
|
||||
assert.doesNotMatch(html, /Your ally chooses how to pay/);
|
||||
assert.match(html, /<button\b(?![^>]*disabled)[^>]*>Share spice<\/button>/);
|
||||
assert.match(html, /<button\b(?![^>]*disabled)[^>]*>Continue to payment<\/button>/);
|
||||
assert.match(render(view('richese'), true), /<button\b[^>]*disabled=""[^>]*>Continue to payment<\/button>/);
|
||||
});
|
||||
|
||||
void test('ordinary auction keeps its original buyer-payment guidance', () => {
|
||||
const html = render(view());
|
||||
assert.match(html, /Your ally chooses how to pay after the gift’s Karama response/);
|
||||
assert.doesNotMatch(html, /Continue settles the Richese sale/);
|
||||
});
|
||||
Reference in new issue
Block a user