fix(e2e): fill api_token in nodes tests so submit button is enabled

The Add Node button requires both api_url AND api_token to be non-empty
before it enables. Both validation tests were only filling api_url,
leaving the button permanently disabled and timing out after 30s.
Add a dummy api_token fill in each test so the button enables and the
form submits — the backend then correctly rejects the invalid URL.
This commit is contained in:
SaelixCode
2026-03-22 01:58:47 -04:00
parent 12bbe51a3a
commit 707a5e81c1
2 changed files with 5 additions and 0 deletions
+4
View File
@@ -40,6 +40,8 @@ test.describe('Node management', () => {
await page.locator('#node-name').fill('bad-node');
await page.locator('#node-api-url').fill('http://localhost:6379');
// api_token is required to enable the submit button; use a dummy value since we're testing URL validation
await page.locator('#node-api-token').fill('dummy-token');
// Use .last() to target the dialog submit button, not the trigger
await page.getByRole('button', { name: /add node/i }).last().click();
@@ -51,6 +53,8 @@ test.describe('Node management', () => {
await page.locator('#node-name').fill('bad-url-node');
await page.locator('#node-api-url').fill('not-a-url-at-all');
// api_token is required to enable the submit button; use a dummy value since we're testing URL validation
await page.locator('#node-api-token').fill('dummy-token');
await page.getByRole('button', { name: /add node/i }).last().click();
await expect(page.getByText(/valid url|invalid url/i)).toBeVisible({ timeout: 5_000 });