@bongos/core 1.21.6 → 1.21.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -48,9 +48,12 @@ function boot() {
48
48
  const liveProgress = { innerHTML: '' };
49
49
  // the done panel's heading (task 1004504): "Setting up <name>" until the project answers
50
50
  const doneH = { textContent: 'Setting up Lantern' };
51
+ // the invite step's gate (task 1004503): renderProgress opens it only on a verified answer
52
+ const gates = [];
51
53
  const sandbox = {
52
54
  $: (id) => (id === 'liveProgress' ? liveProgress : id === 'done-h' ? doneH : null),
53
55
  state: { name: 'Lantern', slug: 'lantern' },
56
+ paintInviteGate: (live) => gates.push(live),
54
57
  esc: (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => (
55
58
  { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c])),
56
59
  projectPageLink: (label) => '<a href="?view=manage&id=1">' + label + '</a>',
@@ -64,7 +67,7 @@ function boot() {
64
67
  };
65
68
  vm.createContext(sandbox);
66
69
  vm.runInContext(PROGRESS + '\n' + OVERLAY + '\n' + ADDRESS + '\n' + ORB, sandbox);
67
- return { sandbox, progress: () => liveProgress.innerHTML, heading: () => doneH.textContent };
70
+ return { sandbox, progress: () => liveProgress.innerHTML, heading: () => doneH.textContent, gates };
68
71
  }
69
72
 
70
73
  const NOW = () => new Date().toISOString();
@@ -93,13 +96,16 @@ test('once the lookup answers, the done panel links the address', () => {
93
96
  assert.equal(terminal, false, 'resolving is not yet answering — the panel still waits for the probe');
94
97
  assert.match(h.progress(), ADDRESS_LINK);
95
98
  assert.equal(h.heading(), 'Setting up Lantern', 'and the heading claims nothing yet (task 1004504)');
99
+ assert.deepEqual(h.gates, [], 'and the invite box stays shut: the hall has not answered (task 1004503)');
96
100
  const live = boot();
97
101
  assert.equal(live.sandbox.renderProgress({ ...base, dns_resolves: true, last_verified_up: true, last_verified_at: NOW() }), true);
98
102
  assert.match(live.progress(), ADDRESS_LINK);
99
103
  assert.equal(live.heading(), 'Lantern is alive.', 'the alive moment, only on a verified answer');
104
+ assert.deepEqual(live.gates, [true], 'and the invite box opens with it (task 1004503)');
100
105
  const down = boot();
101
106
  down.sandbox.renderProgress({ ...base, dns_resolves: true, last_verified_up: false, last_verified_at: NOW() });
102
107
  assert.equal(down.heading(), 'Setting up Lantern', 'a down probe is never "alive"');
108
+ assert.deepEqual(down.gates, [], 'nor opens the invite box');
103
109
  });
104
110
 
105
111
  test('the card and the manage page: no link and no name before the lookup answers, in every pre-live state', () => {
@@ -34,7 +34,7 @@ test('the platform floors are a pinned list — a floor cannot vanish quietly',
34
34
  });
35
35
 
36
36
  test('the shipped states files validate and sit beside the page they name', () => {
37
- for (const rel of ['modules/public-landing/public/projects.states.json', 'modules/public-landing/public/projects-empty.states.json', 'modules/public-landing/public/projects-dns-pending.states.json','modules/public-landing/public/index.states.json', 'modules/public-landing/public/account.states.json', 'modules/public-landing/public/account-private.states.json', 'modules/hall-ui/public/ranks.states.json']) {
37
+ for (const rel of ['modules/public-landing/public/projects.states.json', 'modules/public-landing/public/projects-empty.states.json', 'modules/public-landing/public/projects-dns-pending.states.json', 'modules/public-landing/public/projects-hall-live.states.json','modules/public-landing/public/index.states.json', 'modules/public-landing/public/account.states.json', 'modules/public-landing/public/account-private.states.json', 'modules/hall-ui/public/ranks.states.json']) {
38
38
  const json = readJson(rel);
39
39
  const v = lib.validateStatesFile(json);
40
40
  assert.deepEqual(v.errors, [], `${rel}: ${v.errors.join('; ')}`);