Skip to content

Commit 95b3fd8

Browse files
committed
test: git init integ tests staging
1 parent d509b46 commit 95b3fd8

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/spec/Extn-Git-integ-test.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,14 @@ define(function (require, exports, module) {
9797
await __PR.execCommand(Commands.CMD_GIT_TOGGLE_PANEL);
9898
expect($gitPanel.is(":visible")).toBeTrue();
9999
expect($gitIcon.is(":visible")).toBeTrue();
100+
// verify that only the init and clone button is visible
101+
expect($gitPanel.find(".git-init").is(":visible")).toBeTrue();
102+
expect($gitPanel.find(".git-clone").is(":visible")).toBeTrue();
103+
// in non git repos the git buttons are not visible
104+
expect($gitPanel.find(".git-commit").is(":visible")).toBeFalse();
105+
expect($gitPanel.find(".git-prev-gutter").is(":visible")).toBeFalse();
106+
expect($gitPanel.find(".git-file-history").is(":visible")).toBeFalse();
107+
expect($gitPanel.find(".git-right-icons").is(":visible")).toBeFalse();
100108
});
101109

102110
it("Should be able to initialize git repo", async function () {
@@ -105,6 +113,18 @@ define(function (require, exports, module) {
105113
await awaitsFor(()=>{
106114
return $gitPanel.find(".modified-file").length === 4;
107115
}, "4 files to be added in modified files list", 10000);
116+
expect($(".check-all").prop("checked")).toBeFalse();
117+
});
118+
119+
it("Should be able to stage and commit initialized git repo", async function () {
120+
await showGitPanel();
121+
expect($(".check-all").prop("checked")).toBeFalse();
122+
$(".check-all").click();
123+
await awaitsFor(()=>{
124+
const checkboxes = document.querySelectorAll(".check-one");
125+
return Array.from(checkboxes).every(checkbox => checkbox.checked);
126+
}, "All files to be staged for commit", 10000);
127+
$(".git-commit").click();
108128
});
109129
});
110130

0 commit comments

Comments
 (0)