Skip to content

Commit f14d8c6

Browse files
committed
Add more stats tests
Signed-off-by: Cintia Sánchez García <cynthiasg@icloud.com>
1 parent c6f24fd commit f14d8c6

1 file changed

Lines changed: 29 additions & 1 deletion

File tree

ui/webapp/tests/e2e/stats.spec.ts

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { expect, test } from '@playwright/test';
22

3-
import { gotoExplore } from './utils/navigation';
3+
import { gotoExplore, gotoStats } from './utils/navigation';
44

55
test.describe('Stats page', () => {
66
test('navigates to stats view from the header', async ({ page }) => {
@@ -22,4 +22,32 @@ test.describe('Stats page', () => {
2222
await expect(page.getByText('Funding rounds', { exact: true })).toBeVisible();
2323
await expect(page.getByText('Acquisitions', { exact: true })).toBeVisible();
2424
});
25+
26+
test('toggles category distribution rows', async ({ page }) => {
27+
await gotoStats(page);
28+
29+
const categoryTable = page.getByRole('treegrid');
30+
const categoryOneRow = categoryTable.locator('tbody tr').filter({ hasText: 'Category 1' }).first();
31+
const categoryTwoRow = categoryTable.locator('tbody tr').filter({ hasText: 'Category 2' }).first();
32+
33+
await expect(categoryTable.getByText('Subcategory 1-1')).toBeVisible();
34+
await expect(categoryTable.getByText('Subcategory 2-1')).not.toBeVisible();
35+
36+
// Collapse and expand category rows
37+
await categoryOneRow.click();
38+
await expect(categoryTable.getByText('Subcategory 1-1')).not.toBeVisible();
39+
await categoryTwoRow.click();
40+
await expect(categoryTable.getByText('Subcategory 2-1')).toBeVisible();
41+
});
42+
43+
test('lists repository licenses with counts and percentages', async ({ page }) => {
44+
await gotoStats(page);
45+
46+
// Verify licenses table and details visibility
47+
const licensesTable = page.locator('table').filter({ hasText: 'License' }).first();
48+
const apacheRow = licensesTable.getByRole('row', { name: /Apache-2\.0/ });
49+
50+
await expect(apacheRow).toContainText('4');
51+
await expect(apacheRow).toContainText('100.00%');
52+
});
2553
});

0 commit comments

Comments
 (0)