@bongos/core 1.23.12 → 1.23.14
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.
- package/.bongos-core.json +30 -30
- package/docs/copy-inventory.md +77 -69
- package/docs/copy-registry.json +238 -165
- package/docs/module-api-changelog.md +2 -0
- package/docs/page-inventory.json +3 -2
- package/docs/page-readings.json +29 -29
- package/modules/copy-desk/page-status.js +2 -2
- package/modules/copy-desk/tests/copy_page_status.mjs +1 -1
- package/modules/hall-ui/public/approval-queue-lib.js +1 -1
- package/modules/hall-ui/public/approval-queue.css +26 -12
- package/modules/hall-ui/public/approval-queue.js +40 -16
- package/modules/hall-ui/public/studio-lib.js +5 -3
- package/modules/hall-ui/public/studio.html +8 -8
- package/modules/hall-ui/public/studio.js +25 -5
- package/modules/hall-ui/public/studio.states.json +54 -4
- package/modules/hall-ui/public/tweak-editor-lib.js +7 -6
- package/modules/hall-ui/public/welcome-boot.js +62 -12
- package/modules/hall-ui/records/tweak-editor.md +1 -1
- package/package-lock.json +2 -2
- package/package.json +1 -1
- package/release-notes.json +14 -0
- package/src/module-api.js +1 -1
- package/tests/hall_approval_queue.mjs +33 -9
- package/tests/hall_studio_home.mjs +74 -7
- package/tests/hall_tweak_editor.mjs +8 -11
- package/tests/welcome_boot_browser.mjs +45 -3
|
@@ -43,6 +43,7 @@ async function hall({ art = true, reducedMotion = 'no-preference', time = null }
|
|
|
43
43
|
await ctx.route(ORIGIN + '/**', (route) => {
|
|
44
44
|
const p = new URL(route.request().url()).pathname;
|
|
45
45
|
if (p === '/' || p === '/index.html') return route.fulfill({ contentType: 'text/html', body: PAGE });
|
|
46
|
+
if (p === '/api/bongos/auth/web/start') return route.fulfill({ contentType: 'text/html', body: '<!doctype html><title>github</title><p id="auth">sign in</p>' });
|
|
46
47
|
if (p === '/thinking' || p === '/city') return route.fulfill({ contentType: 'text/html', body: '<!doctype html><title>room</title><p id="room">' + p + '</p>' });
|
|
47
48
|
const ext = path.extname(p);
|
|
48
49
|
if (ext === '.webp' && !art) return route.fulfill({ status: 404, body: '' });
|
|
@@ -123,12 +124,53 @@ test('once a day: the next load the same day gets no welcome (and the picker is
|
|
|
123
124
|
await ctx.close();
|
|
124
125
|
});
|
|
125
126
|
|
|
126
|
-
test('a visitor who is not signed in
|
|
127
|
+
test('a visitor who is not signed in gets the Welcome on Home with a sign-in button, and no day is remembered', { skip }, async () => {
|
|
127
128
|
const ctx = await hall();
|
|
128
129
|
const { page } = await open(ctx);
|
|
129
130
|
await page.evaluate(() => window.OTBShell.applyAccess({ authed: false }));
|
|
130
|
-
|
|
131
|
-
|
|
131
|
+
await page.waitForSelector('#welcome-boot');
|
|
132
|
+
const s = await page.evaluate(() => ({
|
|
133
|
+
hi: document.getElementById('wb-hi').textContent,
|
|
134
|
+
signin: !!document.querySelector('[data-wb-signin]'),
|
|
135
|
+
roles: !!document.querySelector('[data-wb-roles]'),
|
|
136
|
+
keys: Object.keys(localStorage).filter((k) => k.startsWith('hall-welcome-day') || k === 'hall-welcome-signin'),
|
|
137
|
+
picker: !!document.getElementById('craft-picker'),
|
|
138
|
+
}));
|
|
139
|
+
assert.match(s.hi, /^Welcome to /);
|
|
140
|
+
assert.deepEqual([s.signin, s.roles, s.keys, s.picker], [true, false, [], false]);
|
|
141
|
+
await ctx.close();
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
test('every fresh sign-in is welcomed again the same day, whichever sign-in link was clicked', { skip }, async () => {
|
|
145
|
+
for (const link of ['[data-wb-signin]', '#shell-signin']) {
|
|
146
|
+
const ctx = await hall();
|
|
147
|
+
const first = await open(ctx);
|
|
148
|
+
await signIn(first.page);
|
|
149
|
+
await first.page.waitForSelector('#welcome-boot');
|
|
150
|
+
await first.page.close(); // the day is now seen
|
|
151
|
+
const out = await open(ctx);
|
|
152
|
+
await out.page.evaluate(() => window.OTBShell.applyAccess({ authed: false }));
|
|
153
|
+
await out.page.waitForSelector('#welcome-boot');
|
|
154
|
+
// The welcome's own button, or the shell's top-bar link, leaves the flag and heads for GitHub.
|
|
155
|
+
await out.page.evaluate((sel) => document.querySelector(sel).click(), link);
|
|
156
|
+
await out.page.waitForSelector('#auth');
|
|
157
|
+
const { page } = await open(ctx);
|
|
158
|
+
await signIn(page);
|
|
159
|
+
await page.waitForSelector('#welcome-boot');
|
|
160
|
+
assert.equal(await page.evaluate(() => localStorage.getItem('hall-welcome-signin')), null, link + ': the flag is spent');
|
|
161
|
+
await ctx.close();
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
test('a link that only mentions the sign-in path on another site sets no flag', { skip }, async () => {
|
|
166
|
+
const ctx = await hall();
|
|
167
|
+
const { page } = await open(ctx);
|
|
168
|
+
await page.evaluate(() => {
|
|
169
|
+
const a = document.createElement('a');
|
|
170
|
+
a.id = 'far'; a.href = 'https://elsewhere.test/auth/web/start'; a.addEventListener('click', (e) => e.preventDefault());
|
|
171
|
+
document.body.appendChild(a); a.click();
|
|
172
|
+
});
|
|
173
|
+
assert.equal(await page.evaluate(() => localStorage.getItem('hall-welcome-signin')), null);
|
|
132
174
|
await ctx.close();
|
|
133
175
|
});
|
|
134
176
|
|