` for styling
2. **Locator Mismatch**: `getByRole('switch')` targets the hidden input
3. **Click Interception**: The visible `
` intercepts pointer events, causing actionability failures
4. **Sticky Header**: Layout has a sticky header (`h-20` = 80px) that can obscure elements during scroll
### Current Switch Component Structure
```html
```
---
## 2. Affected Files & Line Numbers
### tests/settings/system-settings.spec.ts
| Line | Pattern | Context |
|------|---------|---------|
| 135 | `getByRole('switch', { name: /cerberus.*toggle/i })` | Toggle Cerberus security feature |
| 144 | `getByRole('switch', { name: /cerberus.*toggle/i })` | Same toggle, duplicate locator |
| 167 | `getByRole('switch', { name: /crowdsec.*toggle/i })` | Toggle CrowdSec enrollment |
| 176 | `getByRole('switch', { name: /crowdsec.*toggle/i })` | Same toggle, duplicate locator |
| 197 | `getByRole('switch', { name: /uptime.*toggle/i })` | Toggle Uptime monitoring |
| 206 | `getByRole('switch', { name: /uptime.*toggle/i })` | Same toggle, duplicate locator |
| 226 | `getByRole('switch', { name: /uptime.*toggle/i })` | Uptime toggle verification |
| 264 | `getByRole('switch', { name: /cerberus.*toggle/i })` | Cerberus accessibility check |
| 765 | `page.getByRole('switch')` | Generic switch locator in bulk test |
| 803 | `page.getByRole('switch')` | Generic switch locator in settings test |
### tests/security/security-dashboard.spec.ts
| Line | Pattern | Context |
|------|---------|---------|
| 232 | `toggle.click({ force: true })` | Already uses force:true (partial fix) |
| 248 | `getByTestId('toggle-acl').isChecked()` | Uses test ID (acceptable) |
### tests/settings/user-management.spec.ts
| Line | Pattern | Context |
|------|---------|---------|
| 638 | Switch toggle pattern | User permission toggle |
| 798 | Switch toggle pattern | Admin role toggle |
| 805 | Switch toggle pattern | Role verification |
| 1199 | `page.getByRole('switch')` | Generic switch locator |
### tests/core/proxy-hosts.spec.ts
| Line | Pattern | Context |
|------|---------|---------|
| 556 | `page.locator('tbody').getByRole('switch')` | Status toggle in table row |
| 707 | `page.locator('tbody').getByRole('switch')` | Same pattern, duplicate |
### tests/core/access-lists-crud.spec.ts
| Line | Pattern | Context |
|------|---------|---------|
| 396 | `page.getByLabel(/enabled/i).first()` | Enabled switch (uses getByLabel) |
| 553 | Switch toggle pattern | ACL enabled toggle |
| 1019 | Switch toggle pattern | Default ACL toggle |
| 1038 | Switch toggle pattern | ACL state verification |
---
## 3. Solution Design
### Chosen Approach: Option 3 - Helper Function
Create a `clickSwitch()` helper that:
1. Locates the switch element via `getByRole('switch')` or provided locator
2. Finds the parent `