Skip to content

Commit f4c8989

Browse files
committed
Cleanup specs
1 parent e879aa8 commit f4c8989

2 files changed

Lines changed: 6 additions & 33 deletions

File tree

packages/app/tests/e2e/features/search/search-filters.spec.ts

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -14,48 +14,25 @@ test.describe('Search Filters', { tag: ['@search', '@local-mode'] }, () => {
1414
await severityControl.click();
1515
await page.waitForTimeout(500);
1616

17-
const errorFilterCheckbox = page.locator('[data-testid="filter-checkbox-error"]');
17+
const errorFilterCheckbox = page.locator('[data-testid="filter-checkbox-input-error"]');
1818
await expect(errorFilterCheckbox).toBeVisible();
1919
await errorFilterCheckbox.click();
20-
await page.waitForTimeout(1000);
21-
22-
const errorCheckboxInput = page.locator('[data-testid="filter-checkbox-input-error"]');
23-
await expect(errorCheckboxInput).toBeChecked();
24-
25-
await page.waitForLoadState('networkidle');
26-
await page.waitForTimeout(2000);
27-
20+
await expect(errorFilterCheckbox).toBeChecked();
2821
const searchResults = page.locator('[data-testid="search-results-table"]');
2922
await expect(searchResults).toBeVisible();
23+
//todo: Check counts and accuracy of results
3024
});
3125

3226
await test.step('Exclude error filter', async () => {
3327
const errorFilterCheckbox = page.locator('[data-testid="filter-checkbox-error"]');
3428
await errorFilterCheckbox.hover();
35-
await page.waitForTimeout(500);
3629

37-
const excludeButton = page.locator('[data-testid="filter-exclude-error"]');
30+
const excludeButton = page.locator('[data-testid="filter-exclude-error"]').first();
3831
await expect(excludeButton).toBeVisible();
3932
await excludeButton.click();
40-
await page.waitForTimeout(1000);
41-
42-
// Wait for the filter state to update and verify exclusion
33+
await page.waitForTimeout(500);
4334
const errorCheckboxInput = page.locator('[data-testid="filter-checkbox-input-error"]');
44-
45-
// Wait for the exclude state to be applied - check for indeterminate state
46-
await page.waitForFunction(
47-
(selector) => {
48-
const checkbox = document.querySelector(selector) as HTMLInputElement;
49-
return checkbox && checkbox.indeterminate === true;
50-
},
51-
'[data-testid="filter-checkbox-input-error"]',
52-
{ timeout: 5000 }
53-
);
54-
55-
// Verify the indeterminate state
56-
const isIndeterminate = await errorCheckboxInput.evaluate((el: HTMLInputElement) => el.indeterminate);
57-
expect(isIndeterminate).toBe(true);
58-
35+
await expect(errorCheckboxInput).toHaveAttribute('data-indeterminate', 'true');
5936
await page.waitForLoadState('networkidle');
6037
await page.waitForTimeout(2000);
6138
});
@@ -86,10 +63,7 @@ test.describe('Search Filters', { tag: ['@search', '@local-mode'] }, () => {
8663
const excludeButton = page.locator('[data-testid="filter-exclude-error"]');
8764

8865
await errorFilterCheckbox.hover();
89-
await page.waitForTimeout(500);
9066
await excludeButton.click();
91-
await page.waitForTimeout(500);
92-
9367
await errorFilterCheckbox.hover();
9468
await page.waitForTimeout(500);
9569

packages/app/tests/e2e/features/sessions.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ test.describe('Client Sessions Functionality', { tag: ['@sessions', '@local-mode
1919
'[data-testid="sessions-search-form"]',
2020
'input[placeholder="Data Source"]',
2121
'.mantine-Select-input',
22-
'text=Data Source'
2322
];
2423

2524
for (const selector of selectors) {

0 commit comments

Comments
 (0)