@@ -3,6 +3,8 @@ jest.mock("child_process", () => ({
33 ...jest . requireActual ( "child_process" ) ,
44} ) )
55
6+ import { DiagnosticSeverity } from "vscode"
7+
68import { COMMAND_INSTALL , COMMAND_INSTALL_REQUEST } from "./Command"
79import { vscodeSimulator } from "./TestUtils"
810import { Icons } from "./Theme"
@@ -34,13 +36,17 @@ describe("package diagnostics", () => {
3436 } )
3537
3638 it ( "valid dependency, pending installation" , async ( ) => {
37- const { decorations, diagnostics } = await vscodeSimulator ( {
39+ const { actions , decorations, diagnostics } = await vscodeSimulator ( {
3840 packageJson : { dependencies : { "npm-outdated" : "^1.0.0" } } ,
3941 packagesRepository : { "npm-outdated" : [ "1.0.0" ] } ,
42+ selectFirsts : 1 ,
4043 } )
4144
4245 expect ( diagnostics [ 0 ] ?. message ) . toContain ( "pending installation" )
46+ expect ( diagnostics [ 0 ] ?. severity ) . toBe ( DiagnosticSeverity . Information )
4347 expect ( decorations [ 0 ] ) . toContain ( "Install pending" )
48+ expect ( actions [ 0 ] ?. title ) . toBe ( "Install package" )
49+ expect ( actions ) . toHaveLength ( 1 )
4450 } )
4551
4652 it ( "valid dependency, already installed, just formalization" , async ( ) => {
0 commit comments