mirror of
https://github.com/Sea-Haven-Industries/meal-order-manager.git
synced 2026-10-07 16:18:54 +00:00
Compare commits
3 commits
009ce7b6f8
...
502e15792e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
502e15792e | ||
| 2f88a4a315 | |||
|
|
a9dcf28d09 |
3 changed files with 12 additions and 2 deletions
|
|
@ -38,8 +38,13 @@ def latest_menu() -> dict:
|
|||
|
||||
|
||||
def _json_for_script(value) -> str:
|
||||
"""Serialize for embedding in a <script> tag; escape </ to avoid early close."""
|
||||
return json.dumps(value, separators=(",", ":")).replace("</", "<\\/")
|
||||
"""Serialize for embedding in a <script> tag; escape < and JS line separators."""
|
||||
return (
|
||||
json.dumps(value, separators=(",", ":"))
|
||||
.replace("<", "\\u003c")
|
||||
.replace("\u2028", "\\u2028")
|
||||
.replace("\u2029", "\\u2029")
|
||||
)
|
||||
|
||||
|
||||
def generate_form(
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
/* ADMIN_JS_MARKER */
|
||||
(() => {
|
||||
const ADMIN_URL = window.ADMIN_URL;
|
||||
const ADMIN_PDF_URL = window.ADMIN_PDF_URL;
|
||||
const MEALS = window.MEALS;
|
||||
|
|
@ -444,3 +445,4 @@ function adminInit() {
|
|||
}
|
||||
|
||||
adminInit();
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -259,6 +259,9 @@ class TestGenerateFormPlaywright:
|
|||
yield page
|
||||
browser.close()
|
||||
|
||||
def test_admin_bundle_loads(self, browser_page):
|
||||
assert browser_page.evaluate("typeof window.loadWeekOrders") == "function"
|
||||
|
||||
def test_qty_plus_updates_total_without_list_teardown(self, browser_page):
|
||||
page = browser_page
|
||||
card = page.locator('[data-meal-index="0"]')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue