File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,8 @@ import {
2121 buildDependencies ,
2222 closeAllEditors ,
2323 getActiveTextEditorFilename ,
24- stubPrivatePrototypeMethod
24+ stubPrivatePrototypeMethod ,
25+ waitForEditorText
2526} from '../../util'
2627import { dvcDemoPath } from '../../../util'
2728import {
@@ -70,6 +71,7 @@ suite('Repositories Tree Test Suite', () => {
7071
7172 await commands . executeCommand ( 'workbench.action.files.newUntitledFile' )
7273 await commands . executeCommand ( 'editor.action.clipboardPasteAction' )
74+ await waitForEditorText ( )
7375
7476 expect (
7577 Uri . file ( window . activeTextEditor ?. document . getText ( ) as string ) . fsPath
@@ -85,6 +87,7 @@ suite('Repositories Tree Test Suite', () => {
8587
8688 await commands . executeCommand ( 'workbench.action.files.newUntitledFile' )
8789 await commands . executeCommand ( 'editor.action.clipboardPasteAction' )
90+ await waitForEditorText ( )
8891
8992 expect ( window . activeTextEditor ?. document . getText ( ) ) . to . equal ( relPath )
9093 } )
Original file line number Diff line number Diff line change @@ -303,3 +303,12 @@ export const getTimeSafeDisposer = (): Disposer & {
303303
304304export const bypassProgressCloseDelay = ( ) =>
305305 stub ( Toast , 'delayProgressClosing' ) . resolves ( undefined )
306+
307+ export const waitForEditorText = async ( ) : Promise < unknown > => {
308+ await Time . delay ( 500 )
309+ const text = window . activeTextEditor ?. document . getText ( )
310+ if ( text ) {
311+ return
312+ }
313+ return waitForEditorText ( )
314+ }
You can’t perform that action at this time.
0 commit comments