Skip to content

Commit

Permalink
Bug 1907907 - correctly set the folder path for button to filter task…
Browse files Browse the repository at this point in the history
…s by test manifest
  • Loading branch information
Archaeopteryx committed Jul 17, 2024
1 parent 4dbe838 commit 45eb294
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
12 changes: 12 additions & 0 deletions tests/ui/mock/bug_suggestions.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,17 @@
"search_terms": ["Got 1 unexpected statuses"],
"path_end": null,
"bugs": { "open_recent": [], "all_others": [] }
},
{
"search": "TEST-UNEXPECTED-CRASH | /trusted-types/WorkerGlobalScope-eval.html | expected OK",
"search_terms": ["WorkerGlobalScope-eval.html"],
"path_end": "/trusted-types/WorkerGlobalScope-eval.html",
"bugs": { "open_recent": [], "all_others": [] }
},
{
"search": "TEST-UNEXPECTED-CRASH | /css/css-break/hit-test-inline-fragmentation-with-border-radius.html | expected OK",
"search_terms": ["hit-test-inline-fragmentation-with-border-radius.html"],
"path_end": "/css/css-break/hit-test-inline-fragmentation-with-border-radius.html",
"bugs": { "open_recent": [], "all_others": [] }
}
]
34 changes: 34 additions & 0 deletions tests/ui/shared/FailureSummaryTab_test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,38 @@ describe('FailureSummaryTab', () => {
'1725749',
);
});

test('filter by test path contains folder path (one level depth)', async () => {
/* For web platform tests, the test manifest does not necessarily only
contain one test folder but can contain subfolders.
Support for this has not been implemented and the whole test path is
supposed to be set as filter. */
render(testFailureSummaryTab(), {
legacyRoot: true,
});

await waitFor(() =>
screen.getByTitle('Filter by test path: trusted-types/'),
);
expect(
screen.getByTitle('Filter by test path: trusted-types/'),
).toBeInTheDocument();
});

test('filter by test path contains folder path (multiple level depth)', async () => {
/* For web platform tests, the test manifest does not necessarily only
contain one test folder but can contain subfolders.
Support for this has not been implemented and the whole test path is
supposed to be set as filter. */
render(testFailureSummaryTab(), {
legacyRoot: true,
});

await waitFor(() =>
screen.getByTitle('Filter by test path: css/css-break/'),
);
expect(
screen.getByTitle('Filter by test path: css/css-break/'),
).toBeInTheDocument();
});
});
2 changes: 1 addition & 1 deletion ui/shared/tabs/failureSummary/SuggestionsListItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export default class SuggestionsListItem extends React.Component {
</mark>,
);
}
const filterTestPath = suggestion.search.match(/([a-z_\\-s0-9.]+[/])+/gi);
const filterTestPath = suggestion.search.match(/([a-z_\-0-9]+[/])+/gi);

return (
<li>
Expand Down

0 comments on commit 45eb294

Please sign in to comment.