Check Advanced victory after Mentat actions
Verify and publish checkpoint container / container (push) Successful in 10m42s
Verify and publish checkpoint container / container (push) Successful in 10m42s
This commit is contained in:
1 parent
c608d6fea6
commit
64706cc7e0
12 files changed
+339
-27
No files matched your search
@@ -39,6 +39,12 @@ function originalMentat(game: Game) {
|
||||
assert.equal(game.phase, 8);
|
||||
return game;
|
||||
}
|
||||
function finishMentat(game: Game) {
|
||||
assert.equal(game.phase, 8);
|
||||
for (const player of game.players) if (!game.ready.includes(player.id))
|
||||
game = applyAction(JSON.parse(JSON.stringify(game)), player.id, { type: 'ready' });
|
||||
return game;
|
||||
}
|
||||
|
||||
void test('actual original Mentat awards the high Ecaz two-native-world alliance win with one joint stronghold and no ordinary point inflation', () => {
|
||||
const fixture = ecazHomeworldFixture(true);
|
||||
@@ -59,11 +65,19 @@ void test('actual original Mentat awards the high Ecaz two-native-world alliance
|
||||
const ready = botActions(view).find(action => action.type === 'ready') ?? { type: 'ready' as const };
|
||||
result = applyAction(result, player.id, ready);
|
||||
}
|
||||
assert.equal(result.phase, 8); assert.equal(result.status, 'playing');
|
||||
for (const player of result.players) {
|
||||
const view = viewGame(result, player.id); view.players.find(seat => seat.id === player.id)!.bot = difficulty;
|
||||
const ready = botActions(view).find(action => action.type === 'ready') ?? { type: 'ready' as const };
|
||||
result = applyAction(result, player.id, ready);
|
||||
}
|
||||
assert.equal(result.status, 'finished');
|
||||
assert.deepEqual(new Set(result.winner), new Set(['ec', 'al']));
|
||||
assert.deepEqual(biddingPhysicalIds(result), cards);
|
||||
}
|
||||
game = originalMentat(game);
|
||||
assert.equal(game.status, 'playing'); assert.deepEqual(game.winner, []);
|
||||
game = finishMentat(game);
|
||||
assert.equal(game.status, 'finished'); assert.deepEqual(new Set(game.winner), new Set(['ec', 'al']));
|
||||
assert.deepEqual(biddingPhysicalIds(game), cards);
|
||||
assert.deepEqual(game.players.map(player => ({ id: player.id, forces: player.forces, reserves: player.reserves, tanks: player.tanks })), forces);
|
||||
@@ -77,6 +91,8 @@ void test('native population6 does not award this win despite the same actual jo
|
||||
assert.equal(viewGame(game, 'ec').ecazHomeworldVictory!.high, false);
|
||||
game = originalMentat(game);
|
||||
assert.equal(game.status, 'playing'); assert.deepEqual(game.winner, []);
|
||||
game = finishMentat(game);
|
||||
assert.equal(game.status, 'playing'); assert.deepEqual(game.winner, []);
|
||||
});
|
||||
|
||||
for (const predicted of ['ecaz', 'guild'] as const) void test(`actual BG prediction of ${predicted} replaces the printed Ecaz alliance win without changing public progress`, () => {
|
||||
@@ -85,6 +101,8 @@ for (const predicted of ['ecaz', 'guild'] as const) void test(`actual BG predict
|
||||
ecazSeat(game, 'observer').prediction = { faction: predicted, turn: game.turn };
|
||||
assert.equal(viewGame(game, 'al').ecazHomeworldVictory!.qualifies, progress.qualifies);
|
||||
game = originalMentat(game);
|
||||
assert.equal(game.status, 'playing'); assert.deepEqual(game.winner, []);
|
||||
game = finishMentat(game);
|
||||
assert.deepEqual(game.winner, ['observer']); assert.equal(game.status, 'finished');
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user