fix(html-reporter): show filtered stats when filtering for labels/annots (#36368)

This commit is contained in:
Max Schmitt 2025-06-20 10:22:19 +02:00 committed by GitHub
parent 777d1e54b6
commit 173b455941
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -29,7 +29,10 @@ export class Filter {
annotations: FilterToken[] = [];
empty(): boolean {
return this.project.length + this.status.length + this.text.length === 0;
return (
this.project.length + this.status.length + this.text.length +
this.labels.length + this.annotations.length
) === 0;
}
static parse(expression: string): Filter {

View File

@ -1933,6 +1933,7 @@ for (const useIntermediateMergeReport of [true, false] as const) {
const names = ['one foo', 'two foo', 'three bar', 'four bar', 'five baz'];
for (const name of names) {
test('b-' + name, async ({}) => {
test.info().annotations.push({ type: 'issue', description: 'test issue' });
expect(name).not.toContain('one');
await new Promise(f => setTimeout(f, 1100));
});
@ -1988,6 +1989,9 @@ for (const useIntermediateMergeReport of [true, false] as const) {
await expect(page.locator('.subnav-item:has-text("Failed") .counter')).toHaveText('3');
await expect(page.locator('.subnav-item:has-text("Flaky") .counter')).toHaveText('0');
await expect(page.locator('.subnav-item:has-text("Skipped") .counter')).toHaveText('0');
await searchInput.fill('annot:issue');
await expect(page.getByTestId('filtered-tests-count')).toContainText(`Filtered: 5`);
});
test('labels should be applied together with status filter', async ({ runInlineTest, showReport, page }) => {