mirror of
https://github.com/Sea-Haven-Industries/meal-order-manager.git
synced 2026-10-07 16:18:54 +00:00
Compare commits
4 commits
8c7d8d4723
...
149cc9a0be
| Author | SHA1 | Date | |
|---|---|---|---|
| 149cc9a0be | |||
| 2638e6f589 | |||
| e2afa70395 | |||
| d99d7cebfb |
3 changed files with 3 additions and 21 deletions
|
|
@ -454,15 +454,13 @@ function downloadSummaryPdf() {
|
|||
|
||||
function adminStartEdit(email) {
|
||||
window.FormUtils.clearStatus('admin');
|
||||
const requestedWeek = currentAdminWeek;
|
||||
setAdminActionDisabled('start-edit', true);
|
||||
adminFetch(ADMIN_URL + '?week=' + encodeURIComponent(requestedWeek), { headers: adminHeaders() })
|
||||
adminFetch(ADMIN_URL + '?week=' + encodeURIComponent(currentAdminWeek), { headers: adminHeaders() })
|
||||
.then(r => {
|
||||
if (!r.ok) throw new Error('HTTP ' + r.status);
|
||||
return r.json();
|
||||
})
|
||||
.then(data => {
|
||||
if (currentAdminWeek !== requestedWeek) return;
|
||||
lastAdminData = data;
|
||||
const order = data.orders.find(o => o.employee_email === email);
|
||||
if (!order) return;
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@
|
|||
<div id="form-status-info" class="form-status-msg form-status-info" role="status"></div>
|
||||
</div>
|
||||
<div class="inner">
|
||||
<div aria-live="polite" aria-atomic="true">
|
||||
<div aria-live="polite">
|
||||
<span class="total" id="total-display">$0.00</span>
|
||||
<span class="count-display" id="count-display">0 meals</span>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -101,14 +101,6 @@ def _mock_form_routes(page):
|
|||
),
|
||||
),
|
||||
)
|
||||
page.route(
|
||||
"**/api/admin/orders",
|
||||
lambda route: route.fulfill(
|
||||
status=403,
|
||||
content_type="application/json",
|
||||
body='{"error":"Forbidden"}',
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
class TestGenerateFormStructural:
|
||||
|
|
@ -399,15 +391,10 @@ class TestGenerateFormPlaywright:
|
|||
bottom: box.bottom,
|
||||
};
|
||||
};
|
||||
const footer = document.querySelector('#sticky-footer');
|
||||
return {
|
||||
clientWidth: document.documentElement.clientWidth,
|
||||
scrollWidth: document.documentElement.scrollWidth,
|
||||
viewportHeight: window.innerHeight,
|
||||
footer: {
|
||||
...rect('#sticky-footer'),
|
||||
position: getComputedStyle(footer).position,
|
||||
},
|
||||
footer: rect('#sticky-footer'),
|
||||
total: rect('#total-display'),
|
||||
count: rect('#count-display'),
|
||||
submit: rect('#submit-btn'),
|
||||
|
|
@ -420,9 +407,6 @@ class TestGenerateFormPlaywright:
|
|||
for selector in ("footer", "total", "count", "submit"):
|
||||
assert layout[selector]["left"] >= 0
|
||||
assert layout[selector]["right"] <= layout["clientWidth"]
|
||||
assert layout["footer"]["position"] == "fixed"
|
||||
assert layout["footer"]["top"] >= 0
|
||||
assert layout["footer"]["bottom"] <= layout["viewportHeight"]
|
||||
assert layout["lastCard"]["bottom"] <= layout["footer"]["top"]
|
||||
finally:
|
||||
browser.close()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue