New claims get camp names from their seed, renameable from the Claims tab; add t30 (t3)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+19
-3
@@ -850,11 +850,27 @@ with sync_playwright() as p:
|
||||
ev('GAME.paused = true')
|
||||
check('new claim carries money, bag, upgrades and knowledge', ev("money === 5000 && earned === 12345 && JSON.stringify(Array.from(bag)) === JSON.stringify(claimTest.bag) && player.bitTier === 2 && seen[GOLD] === 1 && ledger.dig === 42 && stats.dug === 321"))
|
||||
check('claim 2 has doubled debt, a new seed and the same dimensions', ev('debt === 40000 && worldSeed !== claimTest.seed && W === 512 && H === 384'))
|
||||
check('claim 2 is stored with its career and name', ev("async () => { const c = await DB.get('career:' + GAME.careerId); const w = (await listWorlds()).find(w => w.id === GAME.worldId); return c.claims.length === 2 && c.claimNo === 2 && w.name === 'Claim 2' && w.career === c.id && w.claimNo === 2; }"))
|
||||
check('new claim shows its arrival card', ev("$('cards').textContent.includes('New claim') && $('cards').textContent.includes('$40,000')"))
|
||||
check('claim 2 is stored with its career and name', ev("async () => { const c = await DB.get('career:' + GAME.careerId); const w = (await listWorlds()).find(w => w.id === GAME.worldId); return c.claims.length === 2 && c.claimNo === 2 && w.name !== 'Claim 2' && /^[A-Z][a-z]+ [A-Z][a-z]+$/.test(w.name) && w.name === GAME.worldName && w.career === c.id && w.claimNo === 2; }"))
|
||||
check('new claim shows its arrival card', ev("$('cards').textContent.includes(GAME.worldName) && $('cards').textContent.includes('Claim 2.') && $('cards').textContent.includes('$40,000')"))
|
||||
ev("openNotebook('Claims')")
|
||||
cp.wait_for_function("$('nb-body').querySelectorAll('[data-travel]').length === 1")
|
||||
check('Claims lists both claims with here, size and paid off', ev("$('nb-body').textContent.includes('Claim 2 · here') && $('nb-body').textContent.includes('512×384') && $('nb-body').textContent.includes('paid off ✓')"))
|
||||
check('Claims lists both claims with here, size and paid off', ev("$('nb-body').textContent.includes(GAME.worldName + ' · here') && $('nb-body').textContent.includes('Claim 2') && $('nb-body').textContent.includes('512×384') && $('nb-body').textContent.includes('paid off ✓')"))
|
||||
check('camp names are stable and varied', ev("claimName(424242) === claimName(424242) && new Set(Array.from({length: 20}, (_, i) => claimName(i))).size >= 16"))
|
||||
check('camp names skip taken names and repeated words', ev("""() => {
|
||||
const names = Array.from({length: 1000}, (_, i) => claimName(i));
|
||||
return names.every(n => n.split(' ')[0] !== n.split(' ')[1]) && claimName(42, [claimName(42)]) !== claimName(42);
|
||||
}"""))
|
||||
check('every claim has a rename button', cp.locator('[data-rename]').count() == 2)
|
||||
cp.locator('[data-rename="' + ev('GAME.worldId') + '"]').click()
|
||||
check('rename is prefilled with the current name', cp.locator('#claim-name').input_value() == ev('GAME.worldName'))
|
||||
cp.fill('#claim-name', 'Silver Camp')
|
||||
cp.locator('#dlg-foot').get_by_role('button', name='Cancel', exact=True).click()
|
||||
check('cancel keeps the claim name', ev("GAME.worldName !== 'Silver Camp'"))
|
||||
cp.locator('[data-rename="' + ev('GAME.worldId') + '"]').click()
|
||||
cp.fill('#claim-name', ' Silver Camp ')
|
||||
cp.locator('#dlg-foot').get_by_role('button', name='Save', exact=True).click()
|
||||
cp.wait_for_function("$('nb-body').textContent.includes('Silver Camp · here')")
|
||||
check('renaming the current claim updates storage and game', ev("async () => GAME.worldName === 'Silver Camp' && (await listWorlds()).find(w => w.id === GAME.worldId).name === 'Silver Camp'"))
|
||||
cp.screenshot(path=str(out / '09-claims.png'))
|
||||
cp.click('[data-travel]'); cp.locator('#dlg-foot').get_by_role('button', name='Cancel', exact=True).click()
|
||||
check('travelling asks for confirmation', ev('GAME.worldId !== claimTest.id'))
|
||||
|
||||
Reference in New Issue
Block a user