@@ -31,6 +31,7 @@ const DEFAULT_DATA = {
3131 } ,
3232 hasData : false ,
3333 isAboveLatestTestedVersion : false ,
34+ isPythonEnvironmentGlobal : false ,
3435 isPythonExtensionUsed : false ,
3536 isStudioConnected : false ,
3637 needsGitCommit : false ,
@@ -161,7 +162,7 @@ describe('App', () => {
161162 } )
162163
163164 const sentenceReg = new RegExp (
164- `DVC & DVCLive can be auto-installed with ${ defaultInterpreter } . `
165+ `Auto-install \\(pip\\) DVC & DVCLive with ${ defaultInterpreter } `
165166 )
166167
167168 expect ( screen . getByText ( sentenceReg ) ) . toBeInTheDocument ( )
@@ -178,7 +179,7 @@ describe('App', () => {
178179 pythonBinPath : 'python'
179180 } )
180181
181- const button = screen . getByText ( 'Configure ' )
182+ const button = screen . getByText ( 'Locate DVC ' )
182183 fireEvent . click ( button )
183184
184185 expect ( mockPostMessage ) . toHaveBeenCalledWith ( {
@@ -197,7 +198,7 @@ describe('App', () => {
197198 pythonBinPath : 'python'
198199 } )
199200
200- const button = screen . getByText ( 'Update Env' )
201+ const button = screen . getByText ( 'Set Env' )
201202 fireEvent . click ( button )
202203
203204 expect ( mockPostMessage ) . toHaveBeenCalledWith ( {
@@ -223,6 +224,25 @@ describe('App', () => {
223224 } )
224225 } )
225226
227+ it ( 'should let the user auto-install DVC but warn the user that their selected env is global when the Python extension is installed' , ( ) => {
228+ const defaultInterpreter = 'python'
229+ renderApp ( {
230+ cliCompatible : undefined ,
231+ dvcCliDetails : {
232+ command : 'python -m dvc' ,
233+ version : undefined
234+ } ,
235+ isPythonEnvironmentGlobal : true ,
236+ isPythonExtensionUsed : true ,
237+ pythonBinPath : defaultInterpreter
238+ } )
239+
240+ const button = screen . getByText ( 'Set Env' )
241+
242+ expect ( button ) . toBeInTheDocument ( )
243+ expect ( screen . getByText ( 'Not a virtual environment)' ) ) . toBeInTheDocument ( )
244+ } )
245+
226246 it ( 'should not show a screen saying that DVC is not installed if the cli is available' , ( ) => {
227247 renderApp ( )
228248
@@ -354,14 +374,14 @@ describe('App', () => {
354374 expect ( within ( envDetails ) . getByText ( command ) ) . toBeInTheDocument ( )
355375 } )
356376
357- it ( 'should show the user the command used to run DVC with a "Configure " button if dvc is installed without the python extension' , ( ) => {
377+ it ( 'should show the user the command used to run DVC with a "Locate DVC " button if dvc is installed without the python extension' , ( ) => {
358378 renderApp ( )
359379
360380 const envDetails = screen . getByTestId ( 'dvc-env-details' )
361381
362382 expect ( within ( envDetails ) . getByText ( 'Command:' ) ) . toBeInTheDocument ( )
363383
364- const configureButton = within ( envDetails ) . getByText ( 'Configure ' )
384+ const configureButton = within ( envDetails ) . getByText ( 'Locate DVC ' )
365385 const selectButton = within ( envDetails ) . queryByText (
366386 'Select Python Interpreter'
367387 )
@@ -376,7 +396,7 @@ describe('App', () => {
376396 } )
377397 } )
378398
379- it ( 'should show the user the command used to run DVC with "Configure " and "Update Env" buttons if dvc is installed with the python extension' , ( ) => {
399+ it ( 'should show the user the command used to run DVC with "Locate DVC " and "Set Env" buttons if dvc is installed with the python extension' , ( ) => {
380400 renderApp ( {
381401 isPythonExtensionUsed : true
382402 } )
@@ -385,8 +405,8 @@ describe('App', () => {
385405
386406 expect ( within ( envDetails ) . getByText ( 'Command:' ) ) . toBeInTheDocument ( )
387407
388- const configureButton = within ( envDetails ) . getByText ( 'Configure ' )
389- const selectButton = within ( envDetails ) . getByText ( 'Update Env' )
408+ const configureButton = within ( envDetails ) . getByText ( 'Locate DVC ' )
409+ const selectButton = within ( envDetails ) . getByText ( 'Set Env' )
390410
391411 expect ( configureButton ) . toBeInTheDocument ( )
392412 expect ( selectButton ) . toBeInTheDocument ( )
0 commit comments