@@ -8,10 +8,10 @@ import { resolveApiToken } from '../../../packages/vitest/src/node/config/apiTok
88import { assertDownloadAttachment , assertImageAttachment , assertTestCounts , getExplorerItem , openExplorerFileItem , openExplorerItem , startHtmlReportPreview , startVitestUi } from './helper'
99
1010const TEST_COUNTS = {
11- pass : 18 ,
11+ pass : 20 ,
1212 fail : 3 ,
1313 files : {
14- pass : 7 ,
14+ pass : 9 ,
1515 } ,
1616}
1717
@@ -157,6 +157,18 @@ test.describe('ui', () => {
157157 await testFilterInitiallyInvisibleItem ( page )
158158 } )
159159
160+ test ( 'renders explorer items revealed by a viewport resize' , async ( { page } ) => {
161+ await page . setViewportSize ( { width : 1000 , height : 500 } )
162+ await page . goto ( pageUrl )
163+
164+ await expect ( getExplorerItem ( page , 'aa-first-file.test.ts' ) ) . toBeVisible ( )
165+ await expect ( getExplorerItem ( page , 'zz-last-file.test.ts' ) ) . not . toBeVisible ( )
166+
167+ await page . setViewportSize ( { width : 1000 , height : 1300 } )
168+
169+ await expect ( getExplorerItem ( page , 'zz-last-file.test.ts' ) ) . toBeInViewport ( )
170+ } )
171+
160172 test ( 'tags filter' , async ( { page } ) => {
161173 await page . goto ( pageUrl )
162174 await testTagsFilter ( page )
@@ -600,9 +612,9 @@ async function testFilter(page: Page, options: { mode: 'ui' | 'static' }) {
600612}
601613
602614async function testFilterInitiallyInvisibleItem ( page : Page ) {
603- await expect ( getExplorerItem ( page , 'sample .test.ts' ) ) . not . toBeVisible ( )
604- await page . getByPlaceholder ( 'Search...' ) . fill ( 'sample .test.ts' )
605- await expect ( getExplorerItem ( page , 'sample .test.ts' ) ) . toBeVisible ( )
615+ await expect ( getExplorerItem ( page , 'zz-last-file .test.ts' ) ) . not . toBeVisible ( )
616+ await page . getByPlaceholder ( 'Search...' ) . fill ( 'zz-last-file .test.ts' )
617+ await expect ( getExplorerItem ( page , 'zz-last-file .test.ts' ) ) . toBeVisible ( )
606618}
607619
608620async function testCrossOriginAccess ( page : Page , pageUrl : string ) {
0 commit comments