57 lines
3.0 KiB
TypeScript
57 lines
3.0 KiB
TypeScript
import assert from 'node:assert/strict';
|
|
import test from 'node:test';
|
|
import { alliancePromiseModeSupported } from '../game/alliance-promises';
|
|
import { bidPromiseModeSupported, currentBidPromiseModeSupported } from '../game/bid-promises';
|
|
import { bribeExpressionPromiseModeSupported } from '../game/bribe-expression-promises';
|
|
import { bribePromiseModeSupported } from '../game/bribe-promises';
|
|
import { revivalPromiseModeSupported } from '../game/revival-promises';
|
|
import { viewGame } from '../game/engine';
|
|
import { createKullRicheseSemutaFixture } from './fixture-kull-richese-semuta';
|
|
|
|
const profile = {
|
|
advanced: false, expansions: ['choam','ix'], kullPreview: true, semutaPreview: true,
|
|
players: [{faction:'choam'}, {faction:'richese'}, {faction:'emperor'}, {faction:'harkonnen'}],
|
|
};
|
|
|
|
void test('Basic Kull and Semuta expose the bribe family only in the supported native profile', () => {
|
|
for (const quote of [bribePromiseModeSupported, bribeExpressionPromiseModeSupported]) {
|
|
assert.equal(quote(profile), true);
|
|
assert.equal(quote({...profile, expansions:['ix','choam']}), true);
|
|
assert.equal(quote({...profile, expansions:['choam','ix','ecaz'],
|
|
players:[...profile.players, {faction:'moritani'}, {faction:'ecaz'}]}), true);
|
|
for (const unsupported of [
|
|
{...profile, advanced:true},
|
|
{...profile, expansions:['choam']},
|
|
{...profile, expansions:['choam','ix','ix']},
|
|
{...profile, players:profile.players.filter(player => player.faction !== 'choam')},
|
|
{...profile, players:profile.players.filter(player => player.faction !== 'richese')},
|
|
{...profile, players:[...profile.players, {faction:'ecaz'}]},
|
|
{...profile, players:[...profile.players, {faction:'richese'}]},
|
|
]) assert.equal(quote(unsupported), false);
|
|
for (const key of ['homeworlds','nexusCards','leaderSkills','techTokens','strongholdCards',
|
|
'discoveryEnabled','nexusKullPreview','richeseBetrayalPreview','guildBetrayalPreview',
|
|
'nexusIxianReplacementPreview','nexusIxianBetrayalPreview','nexusHarkonnenBetrayalPreview',
|
|
'moritaniAssassinatePreview'] as const)
|
|
assert.equal(quote({...profile,[key]:true}),false,key);
|
|
}
|
|
});
|
|
|
|
void test('Basic Semuta retains separate bid boundaries', () => {
|
|
assert.equal(alliancePromiseModeSupported(profile),true);
|
|
assert.equal(revivalPromiseModeSupported(profile),true);
|
|
assert.equal(bidPromiseModeSupported(profile),false);
|
|
assert.equal(currentBidPromiseModeSupported(profile),true);
|
|
});
|
|
|
|
void test('a genuine public Basic Kull and Richese start projects the ordinary bribe controls', () => {
|
|
const {game} = createKullRicheseSemutaFixture();
|
|
assert.equal(game.kullPreview,true);
|
|
assert.equal(game.semutaPreview,true);
|
|
const view = viewGame(game,'emperor');
|
|
assert.ok(view.truthBribeTargets.includes('harkonnen'));
|
|
assert.ok(view.truthBribeExpressionTargets.includes('harkonnen'));
|
|
assert.ok(view.truthMixedBribeTargets.includes('harkonnen'));
|
|
assert.deepEqual(view.truthAllianceTargets,[]);
|
|
assert.deepEqual(view.truthRevivalTargets,[]);
|
|
});
|