Open expansion-faction starts from the normal lobby

This commit is contained in:
Quintine committed 2026-10-17 14:39:09 +11:00
1 parent 5a32c1ac85
commit 5961c75a29
8 files changed
+36 -48

No files matched your search

+1 -14
View File
@@ -11,7 +11,6 @@ import {
newPlayer,
joinGame,
viewGame,
initializeBaseGameForAudit,
type Game,
} from '../game/engine';
import { baseDeck, createAuditorLeader, CHOAM_AUDITOR_ID } from '../game/cards';
@@ -97,7 +96,7 @@ function setupModule() {
return exports.initializeSetup!;
}
void test('real isolated initializer adds the Advanced Auditor before prediction and traitor dealing; public gates stay closed', () => {
void test('real isolated initializer adds the Advanced Auditor before prediction and traitor dealing', () => {
const initialize = setupModule();
for (const advanced of [false, true]) {
let g = createGame(
@@ -107,18 +106,6 @@ void test('real isolated initializer adds the Advanced Auditor before prediction
);
joinGame(g, newPlayer('b', 'Bene Gesserit', 'beneGesserit'));
for (const id of ['c', 'b']) g = applyAction(g, id, { type: 'ready' });
const before = structuredClone(g);
assert.throws(
() => applyAction(g, 'c', { type: 'start' }),
advanced ? /Advanced preview/ : /still being implemented/,
);
if (advanced)
assert.throws(
() => applyAction(g, 'c', { type: 'start', advancedPreview: true }),
/Expansion factions are still being implemented/,
);
assert.throws(() => initializeBaseGameForAudit(g), /base factions/);
assert.deepEqual(g, before);
initialize(g);
assert.equal(g.setupStage, 'prediction');
assert.equal(
+1 -12
View File
@@ -299,18 +299,7 @@ for (const [advanced, seed] of [
);
}));
void test('the Ix prototype keeps public gates and rejects unsupported or nonempty lobbies without mutation', () => {
const publicLobby = lobby(false, [
['a', 'atreides'],
['h', 'harkonnen'],
]);
const publicBefore = structuredClone(publicLobby);
assert.throws(
() => applyAction(publicLobby, publicLobby.host, { type: 'start' }),
/Expansion rules are still being implemented/,
);
assert.deepEqual(publicLobby, publicBefore);
void test('the Ix prototype rejects unsupported or nonempty lobbies without mutation', () => {
const absent = createGame('NOIXPROTO', newPlayer('a', 'a', 'atreides'));
absent.players.push(newPlayer('h', 'h', 'harkonnen'));
absent.players.forEach((p) => (p.ready = true));
+1 -8
View File
@@ -272,7 +272,7 @@ void test('Atreides inspection grants only its entitled view and survives JSON b
assert.equal(viewGame(g, 'e').richeseAuction!.cardId, null);
assert.equal(g.players[0].hand[0].id, card.id);
});
void test('connected cache-cancel restores the ordinary pool while seller self-bid and lobby gates still reject atomically', () => {
void test('connected cache-cancel restores the ordinary pool while seller self-bid rejects atomically', () => {
const before = fixture();
const k = before.deck.find((c) => c.effect === 'karama')!;
before.players[2].hand = [k];
@@ -295,13 +295,6 @@ void test('connected cache-cancel restores the ordinary pool while seller self-b
const exact = structuredClone(g);
assert.throws(() => bid(g, 'r', 1), /self-bid/);
assert.deepEqual(g, exact);
const lobby = createGame('RICHESE1', newPlayer('r', 'Richese', 'richese'));
lobby.players.push(newPlayer('e', 'Emperor', 'emperor'));
lobby.players.forEach((p) => (p.ready = true));
assert.throws(
() => applyAction(lobby, 'r', { type: 'start' }),
/still being implemented/,
);
});
void test('an outbid ally-funded player whose hand fills is automatically skipped without reserving losing credit', () => {