diff --git a/test/run.js b/test/run.js index 90c48c6..bbf213c 100644 --- a/test/run.js +++ b/test/run.js @@ -101,7 +101,7 @@ const spawnLib = require('../lib/spawn'); eq((await hit('/r/nobody')).loc, '/', 'a share link for an unknown player goes to the landing page'); const sh = await hit('/r/runner42'); eq([sh.status, sh.loc, sh.set.some(c => /^dr\.ref=runner42/.test(c))], [302, '/play', true], 'a player share link sets the referrer and opens the game'); let g = jarAdd('', sh.set); - const me401 = await hit('/api/me', {}, g); eq([me401.status, me401.body.guestOk, /join\/runner42\?from=driprunner/.test(me401.body.signin)], [401, true, true], 'a newcomer is offered guest play, sign-in goes through the sharer’s join link'); + const me401 = await hit('/api/me', {}, g); eq([me401.status, me401.body.guestOk, me401.body.signin === '/signin'], [401, true, true], 'a newcomer is offered guest play, sign-in stays in the game (/signin; the kit carries the dr.ref sponsor)'); const gs = await hit('/api/guest', { method: 'POST', body: '{}' }, g); g = jarAdd(g, gs.set); eq(gs.status, 200, 'guest session starts'); const gme = await hit('/api/me', {}, g); eq([gme.status, gme.body.me.guest, gme.body.player.chapter], [200, true, 1], 'guest plays chapter 1'); const gr = (await hit('/api/run/start', { method: 'POST', body: JSON.stringify({ W, H }) }, g)).body;