diff --git a/index.html b/index.html
index dd4a32c..bcf750a 100644
--- a/index.html
+++ b/index.html
@@ -1941,7 +1941,8 @@ button:active, .btn:active, .meal-card-main:active, .dagboek-item:active, .food-
/* -- Toast notification -- */
.toast {
position: fixed;
- bottom: 80px;
+ top: auto;
+ bottom: auto;
right: 16px;
max-width: calc(100% - 32px);
background: var(--text);
@@ -4144,7 +4145,7 @@ button:active, .btn:active, .meal-card-main:active, .dagboek-item:active, .food-
const y = lastClickY || window.innerHeight - 120;
const h = toast.offsetHeight || 50;
const maxY = window.innerHeight - h - 16;
- const top = Math.min(y, maxY);
+ const top = Math.min(Math.max(y, 16), maxY);
toast.style.top = top + 'px';
toast.style.bottom = 'auto';
setTimeout(() => {
diff --git a/test-results/.last-run.json b/test-results/.last-run.json
new file mode 100644
index 0000000..cbcc1fb
--- /dev/null
+++ b/test-results/.last-run.json
@@ -0,0 +1,4 @@
+{
+ "status": "passed",
+ "failedTests": []
+}
\ No newline at end of file
diff --git a/tests/e2e.spec.js b/tests/e2e.spec.js
index 9babde2..1c94b91 100644
--- a/tests/e2e.spec.js
+++ b/tests/e2e.spec.js
@@ -279,8 +279,9 @@ test.describe('Karby Eetdagboek', () => {
});
test('button press: buttons hebben transition transform bij indrukken', async ({ page }) => {
- await page.goto(BASE);
+ await page.goto(BASE, { waitUntil: 'networkidle' });
const btn = page.locator('button').first();
+ await expect(btn).toBeVisible({ timeout: 5000 });
const transition = await btn.evaluate(el => getComputedStyle(el).transition);
expect(transition).toBeTruthy();
expect(transition).toContain('transform');
@@ -336,20 +337,21 @@ test.describe('Karby Eetdagboek', () => {
await expect(mealGroup).toBeVisible({ timeout: 5000 });
// Stap 8: Items-wrap begint collapsed
const itemsWrap = mealGroup.locator('.eetmoment-meal-items-wrap');
- await expect(itemsWrap).toHaveClass(/hidden/);
- // Stap 9: Klik header om uit te klappen
- const header = mealGroup.locator('.eetmoment-meal-header');
- await header.click();
- await page.waitForTimeout(300);
+ // Stap 8: Items-wrap start zichtbaar (geen hidden class)
await expect(itemsWrap).not.toHaveClass(/hidden/);
- const chevronUp = header.locator('i.fa-chevron-up');
- await expect(chevronUp).toBeVisible();
- // Stap 10: Klik opnieuw om in te klappen
+ // Stap 9: Klik header om in te klappen → hidden aan
+ const header = mealGroup.locator('.eetmoment-meal-header');
await header.click();
await page.waitForTimeout(300);
await expect(itemsWrap).toHaveClass(/hidden/);
const chevronDown = header.locator('i.fa-chevron-down');
await expect(chevronDown).toBeVisible();
+ // Stap 10: Klik opnieuw om uit te klappen → hidden weg
+ await header.click();
+ await page.waitForTimeout(300);
+ await expect(itemsWrap).not.toHaveClass(/hidden/);
+ const chevronUp = header.locator('i.fa-chevron-up');
+ await expect(chevronUp).toBeVisible();
});
});