v1.2.0: planes.owner_id + ownership checks + per-player onboarding (ISS-108, ISS-109)
CI / build + unit + e2e (pull_request) Successful in 13m46s
CI / build + unit + e2e (pull_request) Successful in 13m46s
This commit is contained in:
@@ -56,6 +56,11 @@ describe('POST /api/register', () => {
|
||||
expect(Number(playerRow[2])).toBe(STARTING_CASH);
|
||||
expect(Number(playerRow[3])).toBe(STARTING_REPUTATION);
|
||||
|
||||
// v1.2.0 (ISS-108): onboarding — exactly one starter plane at EDDF, owned by the new player.
|
||||
const planes = inst.raw.exec('SELECT id, owner_id, location_icao FROM planes WHERE owner_id = ?', [String(userRow[0])])[0].values;
|
||||
expect(planes).toHaveLength(1);
|
||||
expect(String(planes[0][2])).toBe('EDDF');
|
||||
|
||||
// The minted session resolves to the new user.
|
||||
const sess = inst.raw.exec('SELECT user_id FROM sessions WHERE id = ?', [body.sessionId])[0].values[0];
|
||||
expect(String(sess[0])).toBe(String(userRow[0]));
|
||||
|
||||
Reference in New Issue
Block a user