@@ -711,16 +711,36 @@ describe("databases", () => {
711711 } ) ;
712712
713713 describe ( "when codeQL.codespacesTemplate is set to true" , ( ) => {
714- it ( "should create a skeleton QL pack" , async ( ) => {
715- jest . spyOn ( Setting . prototype , "getValue" ) . mockReturnValue ( true ) ;
714+ describe ( "when we add the tutorial database to the codespace" , ( ) => {
715+ it ( "should not offer to create a skeleton QL pack" , async ( ) => {
716+ jest . spyOn ( Setting . prototype , "getValue" ) . mockReturnValue ( true ) ;
716717
717- await databaseManager . openDatabase (
718- { } as ProgressCallback ,
719- { } as CancellationToken ,
720- mockDbItem . databaseUri ,
721- ) ;
718+ const isTutorialDatabase = true ;
719+
720+ await databaseManager . openDatabase (
721+ { } as ProgressCallback ,
722+ { } as CancellationToken ,
723+ mockDbItem . databaseUri ,
724+ "CodeQL Tutorial Database" ,
725+ isTutorialDatabase ,
726+ ) ;
722727
723- expect ( createSkeletonPacksSpy ) . toBeCalledTimes ( 1 ) ;
728+ expect ( createSkeletonPacksSpy ) . toBeCalledTimes ( 0 ) ;
729+ } ) ;
730+ } ) ;
731+
732+ describe ( "when we add a new database that isn't the tutorial one" , ( ) => {
733+ it ( "should create a skeleton QL pack" , async ( ) => {
734+ jest . spyOn ( Setting . prototype , "getValue" ) . mockReturnValue ( true ) ;
735+
736+ await databaseManager . openDatabase (
737+ { } as ProgressCallback ,
738+ { } as CancellationToken ,
739+ mockDbItem . databaseUri ,
740+ ) ;
741+
742+ expect ( createSkeletonPacksSpy ) . toBeCalledTimes ( 1 ) ;
743+ } ) ;
724744 } ) ;
725745 } ) ;
726746
0 commit comments