diff --git a/order/indexedDB.js b/order/indexedDB.js index 1e8ab2924..bc4e3d2cd 100644 --- a/order/indexedDB.js +++ b/order/indexedDB.js @@ -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; diff --git a/order/thankyou.html b/order/thankyou.html index 8119bc808..1a203a251 100644 --- a/order/thankyou.html +++ b/order/thankyou.html @@ -19,7 +19,10 @@ - + + diff --git a/tests/online-ordering-ux.test.js b/tests/online-ordering-ux.test.js index 79830a303..686bed16c 100644 --- a/tests/online-ordering-ux.test.js +++ b/tests/online-ordering-ux.test.js @@ -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(//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(//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'));