@@ -278,6 +278,25 @@ layer("AzureDevOpsPullRequestCli.layer", (it) => {
278278 } ) ,
279279 ) ;
280280
281+ it . effect ( "retains the extension viewer fallback when connection data is unavailable" , ( ) =>
282+ Effect . gen ( function * ( ) {
283+ mockedExecute . mockReturnValueOnce ( Effect . succeed ( output ( "{}" ) ) ) . mockReturnValueOnce (
284+ Effect . succeed (
285+ output (
286+ JSON . stringify ( [
287+ {
288+ ...pullRequestRow ,
289+ createdBy :
{ id :
"fallback-id" , uniqueName :
"[email protected] " } , 290+ } ,
291+ ] ) ,
292+ ) ,
293+ ) ,
294+ ) ;
295+ const cli = yield * AzureDevOpsPullRequestCli . AzureDevOpsPullRequestCli ;
296+ assert . strictEqual ( yield * cli . getViewer ( { cwd :
"/w" } ) , "[email protected] " ) ; 297+ } ) ,
298+ ) ;
299+
281300 it . effect ( "does not substitute an identity id for a missing account login" , ( ) =>
282301 Effect . gen ( function * ( ) {
283302 mockedExecute . mockReturnValueOnce (
@@ -289,6 +308,7 @@ layer("AzureDevOpsPullRequestCli.layer", (it) => {
289308 ) ,
290309 ) ,
291310 ) ;
311+ mockedExecute . mockReturnValueOnce ( Effect . succeed ( output ( "[]" ) ) ) ;
292312 const cli = yield * AzureDevOpsPullRequestCli . AzureDevOpsPullRequestCli ;
293313 const error = yield * Effect . flip ( cli . getViewer ( { cwd : "/w" } ) ) ;
294314 assert . strictEqual ( error . _tag , "AzureDevOpsViewerUnavailableError" ) ;
@@ -306,6 +326,7 @@ layer("AzureDevOpsPullRequestCli.layer", (it) => {
306326 ) ,
307327 ) ,
308328 ) ;
329+ mockedExecute . mockReturnValueOnce ( Effect . succeed ( output ( "[]" ) ) ) ;
309330 const cli = yield * AzureDevOpsPullRequestCli . AzureDevOpsPullRequestCli ;
310331 const error = yield * Effect . flip ( cli . getViewer ( { cwd : "/w" } ) ) ;
311332 assert . strictEqual ( error . _tag , "AzureDevOpsViewerUnavailableError" ) ;
0 commit comments