Skip to content

Commit 7f6ef65

Browse files
committed
test: git username test fix
1 parent 0f20441 commit 7f6ef65

File tree

1 file changed

+23
-24
lines changed

1 file changed

+23
-24
lines changed

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

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -78,29 +78,6 @@ define(function (require, exports, module) {
7878
$gitIcon = $("#git-toolbar-icon");
7979
});
8080

81-
it("should git username and email be valid", async function () {
82-
const tempUser = "phcodeTestGitUser";
83-
const tempEmail = "[email protected]";
84-
// username validate
85-
let currentVal = await testWindow.phoenixGitEvents.Git.getConfig("user.name");
86-
if(!currentVal) {
87-
await testWindow.phoenixGitEvents.Git.setConfig("user.name", tempUser, true);
88-
currentVal = await testWindow.phoenixGitEvents.Git.getConfig("user.name");
89-
expect(currentVal).toBe(tempUser);
90-
} else {
91-
expect(currentVal).toBeDefined();
92-
}
93-
// email validate
94-
currentVal = await testWindow.phoenixGitEvents.Git.getConfig("user.email");
95-
if(!currentVal) {
96-
await testWindow.phoenixGitEvents.Git.setConfig("user.email", tempEmail, true);
97-
currentVal = await testWindow.phoenixGitEvents.Git.getConfig("user.email");
98-
expect(currentVal).toBe(tempEmail);
99-
} else {
100-
expect(currentVal).toBeDefined();
101-
}
102-
});
103-
10481
it("should only git settings, init and clone commands be enabled in non-git repos", async function () {
10582
await forCommandEnabled(Commands.CMD_GIT_INIT);
10683
await forCommandEnabled(Commands.CMD_GIT_CLONE);
@@ -150,7 +127,6 @@ define(function (require, exports, module) {
150127
}
151128
}
152129

153-
154130
it("Should clicking on file in git panel should open it", async function () {
155131
await showGitPanel();
156132
clickOpenFile(0);
@@ -163,6 +139,29 @@ define(function (require, exports, module) {
163139
}, "first file to open");
164140
});
165141

142+
it("should git username and email be valid", async function () {
143+
const tempUser = "phcodeTestGitUser";
144+
const tempEmail = "[email protected]";
145+
// username validate
146+
let currentVal = await testWindow.phoenixGitEvents.Git.getConfig("user.name");
147+
if(!currentVal) {
148+
await testWindow.phoenixGitEvents.Git.setConfig("user.name", tempUser, true);
149+
currentVal = await testWindow.phoenixGitEvents.Git.getConfig("user.name");
150+
expect(currentVal).toBe(tempUser);
151+
} else {
152+
expect(currentVal).toBeDefined();
153+
}
154+
// email validate
155+
currentVal = await testWindow.phoenixGitEvents.Git.getConfig("user.email");
156+
if(!currentVal) {
157+
await testWindow.phoenixGitEvents.Git.setConfig("user.email", tempEmail, true);
158+
currentVal = await testWindow.phoenixGitEvents.Git.getConfig("user.email");
159+
expect(currentVal).toBe(tempEmail);
160+
} else {
161+
expect(currentVal).toBeDefined();
162+
}
163+
});
164+
166165
async function commitAllBtnClick() {
167166
await showGitPanel();
168167
if(!$(".check-all").prop("checked")) {

0 commit comments

Comments
 (0)