@@ -5,8 +5,6 @@ import { expect, galata, test } from '@jupyterlab/galata';
55
66import { Locator } from '@playwright/test' ;
77
8- import * as path from 'path' ;
9-
108const sidebarIds : galata . SidebarTabId [ ] = [
119 'filebrowser' ,
1210 'jp-property-inspector' ,
@@ -15,20 +13,6 @@ const sidebarIds: galata.SidebarTabId[] = [
1513 'extensionmanager.main-view'
1614] ;
1715
18- test . use ( {
19- mockState : true
20- } ) ;
21-
22- const testFileName = 'simple.md' ;
23- const testNotebook = 'simple_notebook.ipynb' ;
24- const testFolderName = 'test-folder' ;
25-
26- const sidebarWidths = {
27- small : 226 ,
28- medium : 308 ,
29- large : 371
30- } ;
31-
3216/**
3317 * Add provided text as label on first tab in given tabbar.
3418 * By default we only have icons, but we should test for the
@@ -221,46 +205,3 @@ test.describe('Sidebars', () => {
221205 expect ( tableOfContentsElementRole ) . toEqual ( 'region' ) ;
222206 } ) ;
223207} ) ;
224-
225- test . describe ( 'Sidebar filebrowser' , ( ) => {
226- test . beforeEach ( async ( { page, request, tmpPath } ) => {
227- const contents = galata . newContentsHelper ( request ) ;
228- // Make each of these files a day old, so they show as 1 day old in the browser.
229- await galata . Mock . freezeContentLastModified ( page ) ;
230-
231- // Create some dummy content
232- await contents . uploadFile (
233- path . resolve ( __dirname , `./notebooks/${ testNotebook } ` ) ,
234- `${ tmpPath } /${ testNotebook } `
235- ) ;
236- await contents . uploadFile (
237- path . resolve ( __dirname , `./notebooks/${ testFileName } ` ) ,
238- `${ tmpPath } /${ testFileName } `
239- ) ;
240- // Create a dummy folder
241- await contents . createDirectory ( `${ tmpPath } /${ testFolderName } ` ) ;
242- } ) ;
243-
244- test . afterEach ( async ( { request, tmpPath } ) => {
245- // Clean up the test files
246- const contents = galata . newContentsHelper ( request ) ;
247- await contents . deleteDirectory ( tmpPath ) ;
248- } ) ;
249-
250- // Additional test cases for resized widths of the file browser
251- for ( const [ sizeName , size ] of Object . entries ( sidebarWidths ) ) {
252- test ( `size ${ sizeName } ` , async ( { page } ) => {
253- await page . sidebar . openTab ( 'filebrowser' ) ;
254- // Resize the sidebar to the desired width.
255- await page . sidebar . setWidth ( size , 'left' ) ;
256- const imageName = `opened-sidebar-filebrowser-${ sizeName } .png` ;
257- const position = await page . sidebar . getTabPosition ( 'filebrowser' ) ;
258- const sidebar = page . sidebar . getContentPanelLocator (
259- position ?? undefined
260- ) ;
261- expect ( await sidebar . screenshot ( ) ) . toMatchSnapshot (
262- imageName . toLowerCase ( )
263- ) ;
264- } ) ;
265- }
266- } ) ;
0 commit comments