@@ -682,18 +682,31 @@ describe("KdbNewConnectionView", () => {
682682 } ) ;
683683
684684 it ( "should set isBundledQ to true and return correct HTML when connType is 0" , ( ) => {
685- view . connectionData = { connType : 0 , serverName : "testServer " } ;
685+ view . connectionData = { connType : 0 , serverName : "local " } ;
686686
687687 const result = view . renderEditConnectionForm ( ) ;
688688 assert . strictEqual ( view . isBundledQ , true ) ;
689- assert . strictEqual ( view . oldAlias , "testServer " ) ;
689+ assert . strictEqual ( view . oldAlias , "local " ) ;
690690 assert . strictEqual ( view . serverType , ServerType . KDB ) ;
691691 assert . strictEqual ( result . values [ 1 ] . includes ( "Bundled q" ) , true ) ;
692692 } ) ;
693693
694- it ( "should set isBundledQ to false and return correct HTML when connType is 1" , ( ) => {
694+ it ( "should set MyQ to false and return correct HTML when connType is 1 and render is filled " , ( ) => {
695695 view . connectionData = { connType : 1 , serverName : "testServer" } ;
696+ view . oldAlias = "testServer" ;
697+ view . render = "test" ;
698+ const result = view . renderEditConnectionForm ( ) ;
696699
700+ assert . strictEqual ( view . isBundledQ , false ) ;
701+ assert . strictEqual ( view . oldAlias , "testServer" ) ;
702+ assert . strictEqual ( view . serverType , ServerType . KDB ) ;
703+ assert . strictEqual ( result . values [ 1 ] . includes ( "My q" ) , true ) ;
704+ } ) ;
705+
706+ it ( "should set MyQ to false and return correct HTML when connType is 1" , ( ) => {
707+ view . connectionData = { connType : 1 , serverName : "testServer" } ;
708+ view . oldAlias = "" ;
709+ view . render = "" ;
697710 const result = view . renderEditConnectionForm ( ) ;
698711
699712 assert . strictEqual ( view . isBundledQ , false ) ;
@@ -702,9 +715,23 @@ describe("KdbNewConnectionView", () => {
702715 assert . strictEqual ( result . values [ 1 ] . includes ( "My q" ) , true ) ;
703716 } ) ;
704717
705- it ( "should set serverType to INSIGHTS and return correct HTML when connType is 2" , ( ) => {
718+ it ( "should set serverType to INSIGHTS and return correct HTML when connType is 2 and render is filled " , ( ) => {
706719 view . connectionData = { connType : 2 , serverName : "testServer" } ;
707720 view . oldAlias = "testServer" ;
721+ view . render = "test" ;
722+
723+ const result = view . renderEditConnectionForm ( ) ;
724+
725+ assert . strictEqual ( view . isBundledQ , false ) ;
726+ assert . strictEqual ( view . oldAlias , "testServer" ) ;
727+ assert . strictEqual ( view . serverType , ServerType . INSIGHTS ) ;
728+ assert . strictEqual ( result . values [ 1 ] . includes ( "Insights" ) , true ) ;
729+ } ) ;
730+
731+ it ( "should set serverType to INSIGHTS and return correct HTML when connType is 2" , ( ) => {
732+ view . connectionData = { connType : 2 , serverName : "testServer" } ;
733+ view . oldAlias = "" ;
734+ view . render = "" ;
708735
709736 const result = view . renderEditConnectionForm ( ) ;
710737
0 commit comments