openvibers/openvibe.help Commits
Help: a site not serving yet says 'What it will do', and has no What shipped link (#42)
Changes
@@@ -162,10 +162,10 @@ ${site.description ? textBlock(site.description) : ''}<p class="site-links">${site.state === 'live'? html`<a class="sc-btn sc-primary" href="${site.url}" rel="noopener nofollow">Open ${site.domain}</a>`: html`<span class="muted">Not serving yet — ${site.url} is its address.</span>`}--<a class="sc-btn" href="${site.updatesUrl}" rel="noopener nofollow">What shipped on ${site.name}</a></p>++${site.state === 'live' ? html`<a class="sc-btn" href="${site.updatesUrl}" rel="noopener nofollow">What shipped on ${site.name}</a>` : ''}</p>${provenance(site.provenance)}--${site.pillars.length ? html`<section class="sc-sec" aria-labelledby="h-pillars"><h2 id="h-pillars">What you can do</h2>++${site.pillars.length ? html`<section class="sc-sec" aria-labelledby="h-pillars"><h2 id="h-pillars">${site.state === 'live' ? 'What you can do' : 'What it will do'}</h2><ul class="pillars">${site.pillars.map((p) => html`<li><b>${p.title}</b>${p.text ? html` <span class="muted">${p.text}</span>` : ''}</li>`)}</ul></section>` : ''}<section class="sc-sec" aria-labelledby="h-faq"><h2 id="h-faq">Questions</h2>@@@ -62,6 +62,10 @@ const WITH_FAQ = [assert.ok(r.text.includes(site.name), `${site.id}: the name is not on the page`);if (site.oneLine) assert.ok(r.text.includes(esc(site.oneLine.slice(0, 40))), `${site.id}: the one line is not on the page`);assert.ok(r.text.includes('OpenVibe.Contracts'), `${site.id}: no provenance`);++ // A site not serving yet promises nothing as working: its pillars are what it will do, and there is no++ // "What shipped" link to an address that does not serve.++ if (site.pillars.length) assert.ok(r.text.includes(site.state === 'live' ? 'What you can do' : 'What it will do'), `${site.id}: pillars heading`);++ assert.strictEqual(r.text.includes(`What shipped on ${esc(site.name)}`), site.state === 'live', `${site.id}: What shipped link only when live`);}});
@@ -162,10 +162,10 @@ ${site.description ? textBlock(site.description) : ''}
@@ -162,10 +162,10 @@ ${site.description ? textBlock(site.description) : ''}
<p class="site-links">${site.state === 'live'
<p class="site-links">${site.state === 'live'
? html`<a class="sc-btn sc-primary" href="${site.url}" rel="noopener nofollow">Open ${site.domain}</a>`
? html`<a class="sc-btn sc-primary" href="${site.url}" rel="noopener nofollow">Open ${site.domain}</a>`
: html`<span class="muted">Not serving yet — ${site.url} is its address.</span>`}
: html`<span class="muted">Not serving yet — ${site.url} is its address.</span>`}
-<a class="sc-btn" href="${site.updatesUrl}" rel="noopener nofollow">What shipped on ${site.name}</a></p>
+${site.state === 'live' ? html`<a class="sc-btn" href="${site.updatesUrl}" rel="noopener nofollow">What shipped on ${site.name}</a>` : ''}</p>
${provenance(site.provenance)}
${provenance(site.provenance)}
-${site.pillars.length ? html`<section class="sc-sec" aria-labelledby="h-pillars"><h2 id="h-pillars">What you can do</h2>
+${site.pillars.length ? html`<section class="sc-sec" aria-labelledby="h-pillars"><h2 id="h-pillars">${site.state === 'live' ? 'What you can do' : 'What it will do'}</h2>
<ul class="pillars">${site.pillars.map((p) => html`<li><b>${p.title}</b>${p.text ? html` <span class="muted">${p.text}</span>` : ''}</li>`)}</ul></section>` : ''}
<ul class="pillars">${site.pillars.map((p) => html`<li><b>${p.title}</b>${p.text ? html` <span class="muted">${p.text}</span>` : ''}</li>`)}</ul></section>` : ''}
<section class="sc-sec" aria-labelledby="h-faq"><h2 id="h-faq">Questions</h2>
<section class="sc-sec" aria-labelledby="h-faq"><h2 id="h-faq">Questions</h2>
@@ -62,6 +62,10 @@ const WITH_FAQ = [
@@ -62,6 +62,10 @@ const WITH_FAQ = [
assert.ok(r.text.includes(site.name), `${site.id}: the name is not on the page`);
assert.ok(r.text.includes(site.name), `${site.id}: the name is not on the page`);
if (site.oneLine) assert.ok(r.text.includes(esc(site.oneLine.slice(0, 40))), `${site.id}: the one line is not on the page`);
if (site.oneLine) assert.ok(r.text.includes(esc(site.oneLine.slice(0, 40))), `${site.id}: the one line is not on the page`);
assert.ok(r.text.includes('OpenVibe.Contracts'), `${site.id}: no provenance`);
assert.ok(r.text.includes('OpenVibe.Contracts'), `${site.id}: no provenance`);
+ // A site not serving yet promises nothing as working: its pillars are what it will do, and there is no
+ // "What shipped" link to an address that does not serve.
+ if (site.pillars.length) assert.ok(r.text.includes(site.state === 'live' ? 'What you can do' : 'What it will do'), `${site.id}: pillars heading`);
+ assert.strictEqual(r.text.includes(`What shipped on ${esc(site.name)}`), site.state === 'live', `${site.id}: What shipped link only when live`);
}
}
});
});