# Instructions

- Following Playwright test failed.
- Explain why, be concise, respect Playwright best practices.
- Provide a snippet of code with the fix, if possible.

# Test info

- Name: public.spec.js >> Public website >> no legacy Dim Sum / Sundar branding on active public pages
- Location: tests\e2e\public.spec.js:96:3

# Error details

```
Error: legacy branding on /contact

expect(received).not.toMatch(expected)

Expected pattern: not /dim\s*sum\s*puri|sundar|bagaicha/i
Received string:      "Kathmandu Momo
Home
Menu
About
Gallery
Contact
Call
WhatsApp
Contact & location

Phone

+977 980-8174841

WhatsApp

+977 980-8174841

Email

dimsumpurifastfood@gmail.com

Address

Birendranagar-6, New Road, Surkhet 21700, Nepal

Kathmandu Momo

Momo, Nepali kitchen & café in Birendranagar, Surkhet.

Explore
Home
Menu
About
Gallery
Contact
Contact
+977 984-9216081
Birendranagar, Surkhet, Karnali Province, Nepal
Follow
Facebook
TikTok
WhatsApp
© 2026 Kathmandu Momo. All rights reserved."
```

# Page snapshot

```yaml
- generic [active] [ref=f7e1]:
  - generic [ref=f7e3]:
    - banner [ref=f7e4]:
      - generic [ref=f7e5]:
        - link "Kathmandu Momo logo Kathmandu Momo" [ref=f7e6] [cursor=pointer]:
          - /url: /
          - img "Kathmandu Momo logo" [ref=f7e7]
          - generic [ref=f7e8]: Kathmandu Momo
        - navigation "Primary" [ref=f7e9]:
          - link "Home" [ref=f7e10] [cursor=pointer]:
            - /url: /
          - link "Menu" [ref=f7e11] [cursor=pointer]:
            - /url: /menu
          - link "About" [ref=f7e12] [cursor=pointer]:
            - /url: /about
          - link "Gallery" [ref=f7e13] [cursor=pointer]:
            - /url: /gallery
          - link "Contact" [ref=f7e14] [cursor=pointer]:
            - /url: /contact
        - generic [ref=f7e15]:
          - link "Call" [ref=f7e16] [cursor=pointer]:
            - /url: tel:+9779849216081
          - link "WhatsApp" [ref=f7e20] [cursor=pointer]:
            - /url: https://wa.me/9779849216081?text=Hello%20Kathmandu%20Momo!%20I'd%20like%20to%20place%20an%20order.
    - main [ref=f7e23]:
      - generic [ref=f7e24]:
        - heading "Contact & location" [level=1] [ref=f7e25]
        - generic [ref=f7e26]:
          - generic [ref=f7e27]:
            - link [ref=f7e28] [cursor=pointer]:
              - /url: tel:+9779808174841
              - generic [ref=f7e32]:
                - paragraph [ref=f7e33]: Phone
                - paragraph [ref=f7e34]: +977 980-8174841
            - link [ref=f7e35] [cursor=pointer]:
              - /url: https://wa.me/9779849216081?text=Hello%20Kathmandu%20Momo!%20I'd%20like%20to%20place%20an%20order.
              - generic [ref=f7e39]:
                - paragraph [ref=f7e40]: WhatsApp
                - paragraph [ref=f7e41]: +977 980-8174841
            - link [ref=f7e42] [cursor=pointer]:
              - /url: mailto:dimsumpurifastfood@gmail.com
              - generic [ref=f7e47]:
                - paragraph [ref=f7e48]: Email
                - paragraph [ref=f7e49]: dimsumpurifastfood@gmail.com
            - link [ref=f7e50] [cursor=pointer]:
              - /url: https://www.google.com/maps/search/?api=1&query=Kathmandu%20Momo%2C%20Birendranagar-6%2C%20New%20Road%2C%20Surkhet%2021700%2C%20Nepal
              - generic [ref=f7e55]:
                - paragraph [ref=f7e56]: Address
                - paragraph [ref=f7e57]: Birendranagar-6, New Road, Surkhet 21700, Nepal
          - iframe [ref=f7e59]:
            - generic [ref=f9e6]:
              - region "Map" [ref=f9e7]
              - iframe [ref=f9e31]:
                
    - contentinfo [ref=f7e60]:
      - generic [ref=f7e61]:
        - generic [ref=f7e62]:
          - generic [ref=f7e63]: Kathmandu Momo
          - paragraph [ref=f7e65]: Momo, Nepali kitchen & café in Birendranagar, Surkhet.
        - generic [ref=f7e66]:
          - heading "Explore" [level=3] [ref=f7e67]
          - link "Home" [ref=f7e68] [cursor=pointer]:
            - /url: /
          - link "Menu" [ref=f7e69] [cursor=pointer]:
            - /url: /menu
          - link "About" [ref=f7e70] [cursor=pointer]:
            - /url: /about
          - link "Gallery" [ref=f7e71] [cursor=pointer]:
            - /url: /gallery
          - link "Contact" [ref=f7e72] [cursor=pointer]:
            - /url: /contact
        - generic [ref=f7e73]:
          - heading "Contact" [level=3] [ref=f7e74]
          - link "+977 984-9216081" [ref=f7e75] [cursor=pointer]:
            - /url: tel:+9779849216081
          - link [ref=f7e78] [cursor=pointer]:
            - /url: "mailto:"
          - link "Birendranagar, Surkhet, Karnali Province, Nepal" [ref=f7e82] [cursor=pointer]:
            - /url: https://www.google.com/maps/search/?api=1&query=Kathmandu%20Momo%2C%20Birendranagar%2C%20Surkhet%2C%20Karnali%20Province%2C%20Nepal&center=28.5981066696641,81.61978015808363
        - generic [ref=f7e86]:
          - heading "Follow" [level=3] [ref=f7e87]
          - link "Facebook" [ref=f7e88] [cursor=pointer]:
            - /url: ""
          - link "TikTok" [ref=f7e89] [cursor=pointer]:
            - /url: ""
          - link "WhatsApp" [ref=f7e90] [cursor=pointer]:
            - /url: https://wa.me/9779849216081?text=Hello%20Kathmandu%20Momo!%20I'd%20like%20to%20place%20an%20order.
      - generic [ref=f7e91]: © 2026 Kathmandu Momo. All rights reserved.
  - button "Open Next.js Dev Tools" [ref=f7e98] [cursor=pointer]
  - alert [ref=f7e102]
```

# Test source

```ts
  1   | import { test, expect } from '@playwright/test';
  2   | 
  3   | test.describe('Public website', () => {
  4   |   test('home renders identity, CTAs and contact', async ({ page }) => {
  5   |     const errors = [];
  6   |     page.on('console', (m) => m.type() === 'error' && errors.push(m.text()));
  7   | 
  8   |     await page.goto('/');
  9   |     await expect(page).toHaveTitle(/Kathmandu Momo/i);
  10  |     await expect(page.getByText('Kathmandu Momo').first()).toBeVisible();
  11  | 
  12  |     await expect(page.getByRole('link', { name: /menu/i }).first()).toBeVisible();
  13  | 
  14  |     const wa = page.getByRole('link', { name: /WhatsApp/i }).first();
  15  |     await expect(wa).toHaveAttribute('href', /wa\.me\/9779849216081/);
  16  | 
  17  |     const call = page.locator('a[href^="tel:+9779849216081"]:visible').first();
  18  |     await expect(call).toBeVisible();
  19  | 
  20  |     expect(errors.filter((e) => !/Failed to load resource|404/.test(e)), `console errors: ${errors.join('\n')}`).toEqual([]);
  21  |   });
  22  | 
  23  |   test('menu page shows imported items with prices, search and categories', async ({ page }) => {
  24  |     await page.goto('/menu');
  25  |     await expect(page).toHaveTitle(/Menu \| Kathmandu Momo/i);
  26  |     await expect(page.getByText('Americano').first()).toBeVisible();
  27  |     await expect(page.getByText(/Rs\.?\s?120/).first()).toBeVisible();
  28  |     await expect(page.locator('input[type="search"]')).toBeVisible();
  29  |     await expect(page.locator('[role="tab"]').first()).toBeVisible();
  30  |   });
  31  | 
  32  |   test('menu search filters items', async ({ page }) => {
  33  |     await page.goto('/menu');
  34  |     await page.fill('input[type="search"]', 'sekuwa');
  35  |     await expect(page.getByRole('heading', { name: /Chicken Sekuwa/i })).toBeVisible();
  36  |     await expect(page.getByText('Americano')).toHaveCount(0);
  37  |   });
  38  | 
  39  |   test('menu images with a stored source actually load (real dimensions)', async ({ page }) => {
  40  |     await page.goto('/menu');
  41  |     // Trigger native lazy-loading across the whole page.
  42  |     await page.evaluate(async () => {
  43  |       for (let y = 0; y < document.body.scrollHeight; y += 500) {
  44  |         window.scrollTo(0, y);
  45  |         await new Promise((r) => setTimeout(r, 60));
  46  |       }
  47  |       window.scrollTo(0, 0);
  48  |     });
  49  |     await page.waitForTimeout(2000);
  50  |     const stats = await page.evaluate(() => {
  51  |       const imgs = [...document.querySelectorAll('main img')];
  52  |       return {
  53  |         total: imgs.length,
  54  |         loaded: imgs.filter((i) => i.complete && i.naturalWidth > 0).length,
  55  |         broken: imgs.filter((i) => i.complete && i.naturalWidth === 0).length,
  56  |       };
  57  |     });
  58  |     expect(stats.total).toBeGreaterThan(0);
  59  |     expect(stats.loaded).toBeGreaterThan(0);
  60  |     expect(stats.broken).toBe(0);
  61  |   });
  62  | 
  63  |   test('menu images are unique (no photo used twice)', async ({ page }) => {
  64  |     await page.goto('/menu');
  65  |     await page.evaluate(async () => {
  66  |       for (let y = 0; y < document.body.scrollHeight; y += 500) { window.scrollTo(0, y); await new Promise((r) => setTimeout(r, 50)); }
  67  |     });
  68  |     await page.waitForTimeout(1500);
  69  |     const srcs = await page.evaluate(() => [...document.querySelectorAll('main article img')].map((i) => i.getAttribute('src')));
  70  |     const dupes = srcs.filter((s, i) => srcs.indexOf(s) !== i);
  71  |     expect(dupes, `duplicate images: ${[...new Set(dupes)].join(', ')}`).toEqual([]);
  72  |   });
  73  | 
  74  |   test('ordering: add to cart offers WhatsApp + a place-order form', async ({ page }) => {
  75  |     await page.goto('/menu');
  76  |     await page.getByRole('button', { name: /^Add / }).first().click();
  77  |     await page.getByRole('button', { name: /View cart/i }).click();
  78  |     // WhatsApp is generated only after the canonical order has been saved.
  79  |     await expect(page.getByRole('button', { name: /Send via WhatsApp/i })).toBeVisible();
  80  |     // Form fields present
  81  |     await expect(page.getByPlaceholder('Your name *')).toBeVisible();
  82  |     await expect(page.getByPlaceholder('Phone number *')).toBeVisible();
  83  |     await expect(page.getByRole('button', { name: /Place Order/i })).toBeVisible();
  84  |   });
  85  | 
  86  |   test('ordering: placing an order succeeds', async ({ page }) => {
  87  |     await page.goto('/menu');
  88  |     await page.getByRole('button', { name: /^Add / }).first().click();
  89  |     await page.getByRole('button', { name: /View cart/i }).click();
  90  |     await page.getByPlaceholder('Your name *').fill('Playwright Tester');
  91  |     await page.getByPlaceholder('Phone number *').fill('9800000001');
  92  |     await page.getByRole('button', { name: /Place Order/i }).click();
  93  |     await expect(page.getByText(/Order received/i)).toBeVisible({ timeout: 15_000 });
  94  |   });
  95  | 
  96  |   test('no legacy Dim Sum / Sundar branding on active public pages', async ({ page }) => {
  97  |     for (const path of ['/', '/menu', '/about', '/gallery', '/contact']) {
  98  |       await page.goto(path);
  99  |       const body = await page.evaluate(() => document.body.innerText);
> 100 |       expect(body, `legacy branding on ${path}`).not.toMatch(/dim\s*sum\s*puri|sundar|bagaicha/i);
      |                                                      ^ Error: legacy branding on /contact
  101 |     }
  102 |   });
  103 | 
  104 |   test('no horizontal overflow on mobile home', async ({ page }) => {
  105 |     await page.setViewportSize({ width: 375, height: 812 });
  106 |     await page.goto('/');
  107 |     const overflow = await page.evaluate(
  108 |       () => document.documentElement.scrollWidth > document.documentElement.clientWidth + 1
  109 |     );
  110 |     expect(overflow).toBe(false);
  111 |   });
  112 | 
  113 |   test('staff routes require login when signed out (full-service mode)', async ({ page }) => {
  114 |     for (const route of ['/waiter', '/kitchen', '/cashier']) {
  115 |       await page.goto(route);
  116 |       await expect(page).toHaveURL(/\/login/);
  117 |     }
  118 |   });
  119 | 
  120 |   test('about, gallery and contact pages load', async ({ page }) => {
  121 |     for (const [path, re] of [
  122 |       ['/about', /About \| Kathmandu Momo/i],
  123 |       ['/gallery', /Gallery \| Kathmandu Momo/i],
  124 |       ['/contact', /Contact & location|Contact &amp; location/i],
  125 |     ]) {
  126 |       await page.goto(path);
  127 |       await expect(page.locator('h1').first()).toBeVisible();
  128 |     }
  129 |   });
  130 | });
  131 | 
```