Add optional short alliance victory
Verify and publish checkpoint container / container (push) Successful in 11m2s
Verify and publish checkpoint container / container (push) Successful in 11m2s
This commit is contained in:
1 parent
8fb9f59106
commit
e896570f07
25 files changed
+632
-27
No files matched your search
@@ -191,11 +191,12 @@ void test('lobby migration is additive and preserves existing game/seat/admin/cr
|
||||
}
|
||||
});
|
||||
|
||||
void test('admin lobby input permits only seven exact bounded commands with valid base factions and public parameters', () => {
|
||||
void test('admin lobby input permits only exact bounded commands with valid base factions and public parameters', () => {
|
||||
const valid: AdminLobbyAction[] = [
|
||||
{ type: 'rules', advanced: true },
|
||||
{ type: 'techTokens', enabled: true },
|
||||
{ type: 'strongholdCards', enabled: false },
|
||||
{ type: 'shortAllianceVictory', enabled: true },
|
||||
{ type: 'addBot', faction: 'guild', difficulty: 'Hard' },
|
||||
{ type: 'removeBot', target: 'bot' },
|
||||
{
|
||||
@@ -217,6 +218,8 @@ void test('admin lobby input permits only seven exact bounded commands with vali
|
||||
{ type: 'addBot', faction: 'ixians', difficulty: 'Hard' },
|
||||
{ type: 'addBot', faction: 'guild', difficulty: 'Impossible' },
|
||||
{ type: 'rules', advanced: 'true' },
|
||||
{ type: 'shortAllianceVictory', enabled: 'true' },
|
||||
{ type: 'shortAllianceVictory', enabled: true, extra: true },
|
||||
{ type: 'assignHost', target: '' },
|
||||
{ type: 'assignHost', target: 'guest', token: secret() },
|
||||
{
|
||||
@@ -264,6 +267,7 @@ void test('viewer receives only public lobby configuration and active-human host
|
||||
'editable',
|
||||
'host',
|
||||
'players',
|
||||
'shortAllianceVictory',
|
||||
'status',
|
||||
'strongholdCards',
|
||||
'techTokens',
|
||||
@@ -298,6 +302,37 @@ void test('viewer receives only public lobby configuration and active-human host
|
||||
}
|
||||
});
|
||||
|
||||
void test('audited admin short-alliance selection preserves seats, resets readiness and replays exactly once', async () => {
|
||||
const f = await fixture();
|
||||
try {
|
||||
assert.equal((await f.read()).shortAllianceVictory, false);
|
||||
for (const auth of [f.auth, f.guestAuth])
|
||||
await f.rooms.act(f.code, auth, f.version(), { type: 'ready' });
|
||||
const secure = f.secureRows();
|
||||
const input = operation(f.version(), { type: 'shortAllianceVictory', enabled: true });
|
||||
const changed = await f.configure(input);
|
||||
assert.equal(changed.lobby.shortAllianceVictory, true);
|
||||
assert.ok(changed.lobby.players.every(player => !player.ready));
|
||||
assert.equal((await f.rooms.readRoom(f.code)).shortAllianceVictory, true);
|
||||
assert.deepEqual(f.secureRows(), secure);
|
||||
assert.equal(audits(f).length, 1);
|
||||
const audit = audits(f)[0];
|
||||
assert.equal(JSON.parse(String(audit.before_configuration)).shortAllianceVictory, false);
|
||||
assert.equal(JSON.parse(String(audit.after_configuration)).shortAllianceVictory, true);
|
||||
const replay = await f.configure(input);
|
||||
assert.equal(replay.replayed, true);
|
||||
assert.equal(replay.appliedVersion, changed.appliedVersion);
|
||||
assert.equal(replay.lobby.shortAllianceVictory, true);
|
||||
assert.equal(audits(f).length, 1);
|
||||
const disabled = await f.configure(operation(f.version(), { type: 'shortAllianceVictory', enabled: false }));
|
||||
assert.equal(disabled.lobby.shortAllianceVictory, false);
|
||||
assert.equal((await f.rooms.readRoom(f.code)).shortAllianceVictory, undefined);
|
||||
assert.deepEqual(f.secureRows(), secure);
|
||||
} finally {
|
||||
f.sqlite.close();
|
||||
}
|
||||
});
|
||||
|
||||
void test('neutral admin changes reuse ordinary rule/AI actions, preserve host sessions and clear human readiness', async () => {
|
||||
const f = await fixture();
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user