# 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: settings/universities.spec.ts >> Settings: Universities >> comment persistence
- Location: src/tests/settings/universities.spec.ts:104:7

# Error details

```
Error: country autocomplete must suggest a match for "Ger" (static country list)

expect(locator).toBeVisible() failed

Locator: locator('.p-autocomplete-overlay .p-autocomplete-option, .p-autocomplete-list li').first()
Expected: visible
Timeout: 5000ms
Error: element(s) not found

Call log:
  - country autocomplete must suggest a match for "Ger" (static country list) with timeout 5000ms
  - waiting for locator('.p-autocomplete-overlay .p-autocomplete-option, .p-autocomplete-list li').first()

```

```yaml
- link "MasterEV Home":
  - /url: /admin
  - img
- link "MasterEV":
  - /url: /admin
- menubar
- text:  E2E ADMIN settings-universities-spec-ts 
- heading "Einstellungen" [level=1]
- paragraph: Benutzer:innen- und Systemeinstellungen
- tablist:
  - tab "Benutzer:innen"
  - tab "Teams"
  - tab "Universitäten" [selected]
  - tab "Vorlagen"
- heading "Universitäten" [level=2]
- paragraph: Verwalten Sie die Universitäten und deren Kurse
- text: 
- textbox "Suchen"
- button " Erstellen"
- text: Name  Land  Faktor  E2E Active mrw1hcbkwtb6 Algerien 1.00
- button ""
- text: E2E Edited mrw1h5dov7k8 Algerien 1.00
- button ""
- text: E2E Factor mrnq564yyk5o Algerien 1.25
- button ""
- text: E2E Factor mrw1h76qt1mi Algerien 1.00
- button ""
- text: E2E History mrw1hjgapz89 DZ 1.00
- button ""
- text: E2E Row mrw1h0j8p5l5 Algerien 1.00
- button ""
- text: E2E Uni mrw1h3ddkqf9 Algerien 1.00
- button ""
- text: E2E University mrw1gz1r61ye Algerien 1.00
- button ""
- link " E2E Reemit mrw1hgahice4":
  - /url: /pages/sitenotice
- link " E2E Test Title mrw1h9j6rhsi":
  - /url: /pages/privacy
- text: 
- alertdialog
- dialog "Universität anlegen":
  - text: Universität anlegen
  - button "Close":
    - img
  - text: Name
  - textbox: E2E Comment mrw1hhje3ukq
  - text: Land
  - combobox
  - button:
    - img
  - text: Faktor
  - spinbutton
  - text: Kommentar
  - textbox
  - text: Aktiviert
  - switch [checked]
  - button "Abbrechen"
  - button "Speichern" [disabled]
```

# Test source

```ts
  1  | import { expect, type Page } from '../fixtures.js';
  2  | import { openCreateDialog, saveDialog, fillNumberInput } from './settings.js';
  3  | 
  4  | /**
  5  |  * Create a university through the settings dialog. Shared between
  6  |  * universities.spec (its own CRUD coverage) and courses.spec (which
  7  |  * seeds a university so the course dialog's autocomplete has a
  8  |  * deterministic match) so the flake lessons — commit the factor via
  9  |  * keystrokes+blur, hard-assert the country suggestion — live in ONE
  10 |  * place instead of drifting per-spec copies.
  11 |  *
  12 |  * The caller must already be on `/admin/settings/universities`.
  13 |  */
  14 | export async function createUniversityViaUI(
  15 |   page: Page,
  16 |   name: string,
  17 |   factor = '1'
  18 | ): Promise<void> {
  19 |   const dialog = await openCreateDialog(page);
  20 | 
  21 |   // Fill name
  22 |   await dialog.locator('input').first().fill(name);
  23 | 
  24 |   // Fill country autocomplete: type and select the first suggestion.
  25 |   // The list is the static countries reference data, so "Ger" must
  26 |   // always match (e.g. Germany/Algerien) — a missing suggestion is a
  27 |   // product bug and fails the test.
  28 |   const countryInput = dialog.locator('p-autocomplete input').first();
  29 |   await countryInput.fill('Ger');
  30 |   const suggestion = page
  31 |     .locator('.p-autocomplete-overlay .p-autocomplete-option, .p-autocomplete-list li')
  32 |     .first();
  33 |   await expect(
  34 |     suggestion,
  35 |     'country autocomplete must suggest a match for "Ger" (static country list)'
> 36 |   ).toBeVisible({ timeout: 5_000 });
     |     ^ Error: country autocomplete must suggest a match for "Ger" (static country list)
  37 |   await suggestion.click();
  38 | 
  39 |   // Fill factor (commit via keystrokes + blur — see fillNumberInput)
  40 |   const factorInput = dialog.locator('p-inputnumber input').first();
  41 |   await expect(factorInput).toBeVisible({ timeout: 5_000 });
  42 |   await fillNumberInput(dialog, factorInput, factor);
  43 | 
  44 |   await saveDialog(dialog);
  45 | }
  46 | 
```