Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion order/indexedDB.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ async function paintShop() {
const apiBaseUrl = String(CONFIG.API_BASE_URL || "").replace(/\/$/, "");
const src = /^(https?:|data:|blob:)/i.test(raw)
? raw
: raw.startsWith("/") ? `${apiBaseUrl}${raw}` : `${apiBaseUrl}/${raw.replace(/^uploads\//, "uploads/")}`;
: raw.startsWith("/") ? `${apiBaseUrl}${raw}` : `${apiBaseUrl}/${raw}`;
logo.addEventListener("error", () => { logo.hidden = true; }, { once: true });
logo.src = getSafeImageUrl(src, "");
logo.hidden = !logo.src;
Expand Down
5 changes: 4 additions & 1 deletion order/thankyou.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
<link href="assets/order.css" rel="stylesheet">
<script src="assets/i18n.js?v=20260912-design"></script>
<script src="assets/jquery-3.7.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.10.3/html2pdf.bundle.min.js"></script>
<!-- Pinned to the bytes reviewed: a changed file on the CDN is refused, not run. -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.10.3/html2pdf.bundle.min.js"
integrity="sha384-1Rq385dzyHeeImKREXc2dTf1lhBKJHL8YR6phOUkikTCsUwGgDyWRoGv8KVG2+qY"
crossorigin="anonymous"></script>
<script src="config.js"></script>
<link href="assets/channel-state.css" rel="stylesheet">
<script src="assets/channel-state.js"></script>
Expand Down
15 changes: 13 additions & 2 deletions tests/online-ordering-ux.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,19 @@ test('the number is grouped the way it is printed', () => {
/* --------------------------------------------------------- the words */

test('the pages speak to a person at a table, not to a shopping website', () => {
/* Comments stripped: the pages explain what the old words were. */
const read = (f) => fs.readFileSync(path.join(BUNDLE, f), 'utf8').replace(/<!--[\s\S]*?-->/g, '');
/* Comments stripped: the pages explain what the old words were. Stripped
until nothing changes, so a comment left behind by the first pass
cannot hide a word from the check. */
const stripComments = (html) => {
let out = html;
let before;
do {
before = out;
out = out.replace(/<!--[\s\S]*?-->/g, '');
} while (out !== before);
return out;
};
const read = (f) => stripComments(fs.readFileSync(path.join(BUNDLE, f), 'utf8'));
assert.ok(!read('products.html').includes('Self-Ordering'), 'the page names the software again');
assert.match(read('products.html'), /id="shop-name"/, 'the shop has nowhere to put its name');
assert.ok(!read('cart.html').includes('Shopping Cart'));
Expand Down
Loading