@@ -4,7 +4,7 @@ import { TREE_DETAILS_SELECTORS, TREE_LISTING_SELECTORS } from './selectors';
44
55test . describe ( 'Tree Details Page Tests' , ( ) => {
66 const TREE_URL =
7- '/ tree/mainline/master/c072629f05d7bca1148ab17690d7922a31423984 ' ;
7+ 'tree/android/android- mainline/7c5912a7c78d669e825093b8cbb57e6afaa88d11 ' ;
88
99 test . beforeEach ( async ( { page } ) => {
1010 const timeout = 60000 ;
@@ -130,7 +130,9 @@ test.describe('Tree Details Page Tests', () => {
130130
131131 await page . waitForTimeout ( 3000 ) ;
132132
133- const expandedRows = page . locator ( 'tr:has(td[colspan])' ) ;
133+ const expandedRows = page . locator (
134+ TREE_DETAILS_SELECTORS . testsTable . expandedRows ,
135+ ) ;
134136 const hasExpandedRows = ( await expandedRows . count ( ) ) > 0 ;
135137
136138 if ( hasExpandedRows ) {
@@ -220,4 +222,75 @@ test.describe('Tree Details Page Tests', () => {
220222
221223 await expect ( searchInput ) . toHaveValue ( 'defconfig' ) ;
222224 } ) ;
225+
226+ test ( 'navigates back one commit via commit graph' , async ( { page } ) => {
227+ await page . goto ( TREE_URL , { timeout : 30000 } ) ;
228+ await page . waitForLoadState ( 'domcontentloaded' ) ;
229+
230+ const currentUrl = page . url ( ) ;
231+
232+ // Wait for a visible commit graph (there may be multiple, get the last visible one)
233+ const commitGraphContainer = page
234+ . locator ( TREE_DETAILS_SELECTORS . commitGraph . container )
235+ . last ( ) ;
236+ await expect ( commitGraphContainer ) . toBeVisible ( { timeout : 30000 } ) ;
237+
238+ // Wait a bit for the graph to fully render
239+ await page . waitForTimeout ( 2000 ) ;
240+
241+ // Look for clickable marks in the visible graph
242+ const marks = commitGraphContainer . locator ( '[class*="MuiMarkElement"]' ) ;
243+ const markCount = await marks . count ( ) ;
244+
245+ // Ensure we actually have marks to click
246+ expect ( markCount ) . toBeGreaterThan ( 0 ) ;
247+
248+ // Click on the first mark (data point in the commit history)
249+ await marks . first ( ) . click ( { force : true } ) ;
250+
251+ // Wait for navigation to complete
252+ await page . waitForTimeout ( 2000 ) ;
253+
254+ const newUrl = page . url ( ) ;
255+
256+ // Verify URL changed (navigated to a different commit)
257+ expect ( newUrl ) . not . toBe ( currentUrl ) ;
258+ expect ( newUrl ) . toMatch ( / \/ t r e e \/ / ) ;
259+ } ) ;
260+
261+ test ( 'clears all filters' , async ( { page } ) => {
262+ await page . goto ( TREE_URL , { timeout : 30000 } ) ;
263+ await page . waitForLoadState ( 'domcontentloaded' ) ;
264+
265+ // Open the filters drawer
266+ const filterButton = page . locator ( TREE_DETAILS_SELECTORS . filters . button ) ;
267+ await filterButton . waitFor ( { state : 'visible' , timeout : 10000 } ) ;
268+ await filterButton . click ( ) ;
269+
270+ // Wait for the drawer content to be visible (it's in a portal)
271+ const drawerContent = page . locator (
272+ TREE_DETAILS_SELECTORS . filters . drawerContent ,
273+ ) ;
274+ await expect ( drawerContent ) . toBeVisible ( { timeout : 10000 } ) ;
275+
276+ // Check if "Clear all" button exists and click it
277+ const clearAllButton = page . locator (
278+ TREE_DETAILS_SELECTORS . filters . clearAllFilters ,
279+ ) ;
280+ const hasClearAllButton = ( await clearAllButton . count ( ) ) > 0 ;
281+
282+ if ( hasClearAllButton ) {
283+ await clearAllButton . click ( ) ;
284+
285+ await page . waitForTimeout ( 1000 ) ;
286+ }
287+
288+ const cancelButton = page . locator (
289+ TREE_DETAILS_SELECTORS . filters . cancelButton ,
290+ ) ;
291+ await expect ( cancelButton ) . toBeVisible ( ) ;
292+ await cancelButton . click ( ) ;
293+
294+ await expect ( drawerContent ) . not . toBeVisible ( ) ;
295+ } ) ;
223296} ) ;
0 commit comments