@@ -43,6 +43,12 @@ define(function (require, exports, module) {
4343 } , `Git ${ commandID } to be ${ enabled ? "enabled" : "disabled" } ` ) ;
4444 }
4545
46+ async function showGitPanel ( ) {
47+ if ( ! $ ( "#git-panel" ) . is ( ":visible" ) ) {
48+ await __PR . execCommand ( Commands . CMD_GIT_TOGGLE_PANEL ) ;
49+ }
50+ }
51+
4652 describe ( "LegacyInteg:Git Workflows test" , function ( ) {
4753
4854 beforeAll ( async function ( ) {
@@ -63,7 +69,13 @@ define(function (require, exports, module) {
6369 } , "Git menus to be present" , 10000 ) ;
6470 } , 30000 ) ;
6571
66- describe ( "Init repo" , function ( ) {
72+ describe ( "Init repo and do all tests" , function ( ) {
73+ let $gitPanel , $gitIcon ;
74+ beforeAll ( async function ( ) {
75+ $gitPanel = $ ( "#git-panel" ) ;
76+ $gitIcon = $ ( "#git-toolbar-icon" ) ;
77+ } ) ;
78+
6779 it ( "should only git settings, init and clone commands be enabled in non-git repos" , async function ( ) {
6880 await forCommandEnabled ( Commands . CMD_GIT_INIT ) ;
6981 await forCommandEnabled ( Commands . CMD_GIT_CLONE ) ;
@@ -76,6 +88,24 @@ define(function (require, exports, module) {
7688 await forCommandEnabled ( Commands . CMD_GIT_PULL , false ) ;
7789 await forCommandEnabled ( Commands . CMD_GIT_PUSH , false ) ;
7890 } ) ;
91+
92+ it ( "Should Git icon be hidden in non-git repo" , async function ( ) {
93+ expect ( $gitIcon . is ( ":visible" ) ) . toBeFalse ( ) ;
94+ } ) ;
95+
96+ it ( "Should be able to show git panel in non-git repo, and icon will come up" , async function ( ) {
97+ await __PR . execCommand ( Commands . CMD_GIT_TOGGLE_PANEL ) ;
98+ expect ( $gitPanel . is ( ":visible" ) ) . toBeTrue ( ) ;
99+ expect ( $gitIcon . is ( ":visible" ) ) . toBeTrue ( ) ;
100+ } ) ;
101+
102+ it ( "Should be able to initialize git repo" , async function ( ) {
103+ await showGitPanel ( ) ;
104+ $gitPanel . find ( ".git-init" ) . click ( ) ;
105+ await awaitsFor ( ( ) => {
106+ return $gitPanel . find ( ".modified-file" ) . length === 4 ;
107+ } , "4 files to be added in modified files list" , 10000 ) ;
108+ } ) ;
79109 } ) ;
80110
81111 } ) ;
0 commit comments