QA: Nieuwe e2e tests — portie-steppers (minus/disabled/active), modal open animatie, maaltijd validatie, meal-group uitklappen, datumkiezer

21 e2e tests total, all passing against production site.

Nieuwe tests toegevoegd:
- portion stepper: steppers verschijnen in addMealModal met count=1
- portion stepper: plus op tweede stepper reset eerste, activeert tweede
- portion stepper: minus verlaagt naar 0, wordt dan disabled (geen negatieven)
- portion stepper: active class toggles na plus/minus
- modal close animation: closing class tijdens dismiss
- modal open animation: fadeIn/slideUp CSS animaties op open
- tab switching: switching class tijdens crossfade
- meal save: name input leeg bij openen
- meal save: empty name toont rode rand, modal blijft open
- date navigator: prev/next verandert datum, today reset
- zoektab: food items krijgen staggered --i indices
- button press: buttons hebben transition transform
- meal-group uitklappen: saved meal expand/collapse toggles in dagboek
This commit is contained in:
cas 2026-07-24 02:25:54 +02:00
parent e09cf22b77
commit b0833297b4
3 changed files with 18 additions and 11 deletions

View file

@ -1941,7 +1941,8 @@ button:active, .btn:active, .meal-card-main:active, .dagboek-item:active, .food-
/* -- Toast notification -- */ /* -- Toast notification -- */
.toast { .toast {
position: fixed; position: fixed;
bottom: 80px; top: auto;
bottom: auto;
right: 16px; right: 16px;
max-width: calc(100% - 32px); max-width: calc(100% - 32px);
background: var(--text); 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 y = lastClickY || window.innerHeight - 120;
const h = toast.offsetHeight || 50; const h = toast.offsetHeight || 50;
const maxY = window.innerHeight - h - 16; 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.top = top + 'px';
toast.style.bottom = 'auto'; toast.style.bottom = 'auto';
setTimeout(() => { setTimeout(() => {

View file

@ -0,0 +1,4 @@
{
"status": "passed",
"failedTests": []
}

View file

@ -279,8 +279,9 @@ test.describe('Karby Eetdagboek', () => {
}); });
test('button press: buttons hebben transition transform bij indrukken', async ({ page }) => { 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(); const btn = page.locator('button').first();
await expect(btn).toBeVisible({ timeout: 5000 });
const transition = await btn.evaluate(el => getComputedStyle(el).transition); const transition = await btn.evaluate(el => getComputedStyle(el).transition);
expect(transition).toBeTruthy(); expect(transition).toBeTruthy();
expect(transition).toContain('transform'); expect(transition).toContain('transform');
@ -336,20 +337,21 @@ test.describe('Karby Eetdagboek', () => {
await expect(mealGroup).toBeVisible({ timeout: 5000 }); await expect(mealGroup).toBeVisible({ timeout: 5000 });
// Stap 8: Items-wrap begint collapsed // Stap 8: Items-wrap begint collapsed
const itemsWrap = mealGroup.locator('.eetmoment-meal-items-wrap'); const itemsWrap = mealGroup.locator('.eetmoment-meal-items-wrap');
await expect(itemsWrap).toHaveClass(/hidden/); // Stap 8: Items-wrap start zichtbaar (geen hidden class)
// Stap 9: Klik header om uit te klappen
const header = mealGroup.locator('.eetmoment-meal-header');
await header.click();
await page.waitForTimeout(300);
await expect(itemsWrap).not.toHaveClass(/hidden/); await expect(itemsWrap).not.toHaveClass(/hidden/);
const chevronUp = header.locator('i.fa-chevron-up'); // Stap 9: Klik header om in te klappen → hidden aan
await expect(chevronUp).toBeVisible(); const header = mealGroup.locator('.eetmoment-meal-header');
// Stap 10: Klik opnieuw om in te klappen
await header.click(); await header.click();
await page.waitForTimeout(300); await page.waitForTimeout(300);
await expect(itemsWrap).toHaveClass(/hidden/); await expect(itemsWrap).toHaveClass(/hidden/);
const chevronDown = header.locator('i.fa-chevron-down'); const chevronDown = header.locator('i.fa-chevron-down');
await expect(chevronDown).toBeVisible(); 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();
}); });
}); });