# 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: finance.spec.js >> Finance — HTML Structure >> hub navigation button present
- Location: tests/finance.spec.js:43:3

# Error details

```
Error: expect(received).toContain(expected) // indexOf

Expected substring: "window.location.href='/hub/'"
Received string:    "404 page not found
"
```

# Test source

```ts
  1  | // finance.spec.js — 360° Finance PWA (Petty Cash · Factory Module)
  2  | const { test, expect, devices, request } = require('@playwright/test');
  3  | 
  4  | const PWA_NAME = 'Finance';
  5  | const BASE_URL = 'https://srv1111289.hstgr.cloud/finance/';
  6  | 
  7  | test.use({ ...devices['Pixel 6'] });
  8  | 
  9  | test.describe(`${PWA_NAME} — Smoke`, () => {
  10 |   test('page loads', async ({ page }) => {
  11 |     const resp = await page.goto(BASE_URL);
  12 |     expect([200, 302]).toContain(resp?.status());
  13 |     await expect(page.locator('body')).not.toBeEmpty();
  14 |   });
  15 | 
  16 |   test('manifest.json returns 200', async ({ page }) => {
  17 |     const resp = await page.goto(BASE_URL + 'manifest.json');
  18 |     expect(resp?.status()).toBe(200);
  19 |   });
  20 | 
  21 |   test('sw.js is versioned', async ({ page }) => {
  22 |     const resp = await page.goto(BASE_URL + 'sw.js');
  23 |     const text = await resp?.text() || '';
  24 |     expect(text).toMatch(/360f2-v\d+/);
  25 |   });
  26 | });
  27 | 
  28 | test.describe(`${PWA_NAME} — HTML Structure`, () => {
  29 |   let html = '';
  30 | 
  31 |   test.beforeAll(async () => {
  32 |     const ctx = await request.newContext();
  33 |     const resp = await ctx.get(BASE_URL);
  34 |     html = await resp.text();
  35 |     await ctx.dispose();
  36 |   });
  37 | 
  38 |   test('main topbar and header present', () => {
  39 |     expect(html).toContain('360° Finance');
  40 |     expect(html).toContain('class="topbar"');
  41 |   });
  42 | 
  43 |   test('hub navigation button present', () => {
> 44 |     expect(html).toContain("window.location.href='/hub/'");
     |                  ^ Error: expect(received).toContain(expected) // indexOf
  45 |     expect(html).toContain('🏡');
  46 |   });
  47 | 
  48 |   test('balance cards present', () => {
  49 |     expect(html).toContain('id="bCash"');
  50 |     expect(html).toContain('id="bBank"');
  51 |     expect(html).toContain('id="bAdv"');
  52 |   });
  53 | });
  54 | 
```