BlueGit

projects-timfalken-com meteors

t1249: fix leaderboard unit test after moving the friends fetch

The friends call now lives in bootstrap.php (leaderboardKnownIdentities).
The JS wiring test looked for it in api.php and failed CI.

timfa Grok Bot · pushed by timfa

Authored 2026-11-16 · 1 day ago

Hash
717f27e44f4b3587858f8df775d524568fe3cfcf
Parent
c2479453
Pipeline
Passed
1 file changed +3 −1
test/leaderboard.test.js +3 −1
@@ -13,6 +13,7 @@ const css = fs.readFileSync(path.join(root, 'build/style.css'), 'utf8');
13 13 const main = fs.readFileSync(path.join(root, 'src/main.js'), 'utf8');
14 14 const online = fs.readFileSync(path.join(root, 'src/online.js'), 'utf8');
15 15 const api = fs.readFileSync(path.join(root, 'server/api.php'), 'utf8');
16 const boot = fs.readFileSync(path.join(root, 'server/lib/bootstrap.php'), 'utf8');
16 17 const buildSh = fs.readFileSync(path.join(root, 'src/build.sh'), 'utf8');
17 18
18 19 describe('Leaderboard wiring (t1247)', () =>
@@ -49,7 +50,8 @@ describe('Leaderboard wiring (t1247)', () =>
49 50 assert.match(main, /Avatar\.piece/);
50 51 assert.match(main, /tab === 'friends' && !loggedIn/);
51 52 assert.match(api, /action === 'leaderboard'/);
52 assert.match(api, /authRequest\('\/api\/friends'/);
53 assert.match(api, /leaderboardKnownIdentities\(/);
54 assert.match(boot, /authRequest\('\/api\/friends'/);
53 55 assert.match(buildSh, /avatar\.js/);
54 56 });
55 57
@@ -13,6 +13,7 @@ const css = fs.readFileSync(path.join(root, 'build/style.css'), 'utf8');
13const main = fs.readFileSync(path.join(root, 'src/main.js'), 'utf8');
13const main = fs.readFileSync(path.join(root, 'src/main.js'), 'utf8');
14const online = fs.readFileSync(path.join(root, 'src/online.js'), 'utf8');
14const online = fs.readFileSync(path.join(root, 'src/online.js'), 'utf8');
15const api = fs.readFileSync(path.join(root, 'server/api.php'), 'utf8');
15const api = fs.readFileSync(path.join(root, 'server/api.php'), 'utf8');
16const boot = fs.readFileSync(path.join(root, 'server/lib/bootstrap.php'), 'utf8');
16const buildSh = fs.readFileSync(path.join(root, 'src/build.sh'), 'utf8');
17const buildSh = fs.readFileSync(path.join(root, 'src/build.sh'), 'utf8');
17
18
18describe('Leaderboard wiring (t1247)', () =>
19describe('Leaderboard wiring (t1247)', () =>
@@ -49,7 +50,8 @@ describe('Leaderboard wiring (t1247)', () =>
49 assert.match(main, /Avatar\.piece/);
50 assert.match(main, /Avatar\.piece/);
50 assert.match(main, /tab === 'friends' && !loggedIn/);
51 assert.match(main, /tab === 'friends' && !loggedIn/);
51 assert.match(api, /action === 'leaderboard'/);
52 assert.match(api, /action === 'leaderboard'/);
52 assert.match(api, /authRequest\('\/api\/friends'/);
53 assert.match(api, /leaderboardKnownIdentities\(/);
54 assert.match(boot, /authRequest\('\/api\/friends'/);
53 assert.match(buildSh, /avatar\.js/);
55 assert.match(buildSh, /avatar\.js/);
54 });
56 });
55
57