mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-26 02:06:49 +00:00
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:
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user