-
-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
23 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,29 +78,6 @@ define(function (require, exports, module) { | |
$gitIcon = $("#git-toolbar-icon"); | ||
}); | ||
|
||
it("should git username and email be valid", async function () { | ||
const tempUser = "phcodeTestGitUser"; | ||
const tempEmail = "[email protected]"; | ||
// username validate | ||
let currentVal = await testWindow.phoenixGitEvents.Git.getConfig("user.name"); | ||
if(!currentVal) { | ||
await testWindow.phoenixGitEvents.Git.setConfig("user.name", tempUser, true); | ||
currentVal = await testWindow.phoenixGitEvents.Git.getConfig("user.name"); | ||
expect(currentVal).toBe(tempUser); | ||
} else { | ||
expect(currentVal).toBeDefined(); | ||
} | ||
// email validate | ||
currentVal = await testWindow.phoenixGitEvents.Git.getConfig("user.email"); | ||
if(!currentVal) { | ||
await testWindow.phoenixGitEvents.Git.setConfig("user.email", tempEmail, true); | ||
currentVal = await testWindow.phoenixGitEvents.Git.getConfig("user.email"); | ||
expect(currentVal).toBe(tempEmail); | ||
} else { | ||
expect(currentVal).toBeDefined(); | ||
} | ||
}); | ||
|
||
it("should only git settings, init and clone commands be enabled in non-git repos", async function () { | ||
await forCommandEnabled(Commands.CMD_GIT_INIT); | ||
await forCommandEnabled(Commands.CMD_GIT_CLONE); | ||
|
@@ -150,7 +127,6 @@ define(function (require, exports, module) { | |
} | ||
} | ||
|
||
|
||
it("Should clicking on file in git panel should open it", async function () { | ||
await showGitPanel(); | ||
clickOpenFile(0); | ||
|
@@ -163,6 +139,29 @@ define(function (require, exports, module) { | |
}, "first file to open"); | ||
}); | ||
|
||
it("should git username and email be valid", async function () { | ||
const tempUser = "phcodeTestGitUser"; | ||
const tempEmail = "[email protected]"; | ||
// username validate | ||
let currentVal = await testWindow.phoenixGitEvents.Git.getConfig("user.name"); | ||
if(!currentVal) { | ||
await testWindow.phoenixGitEvents.Git.setConfig("user.name", tempUser, true); | ||
currentVal = await testWindow.phoenixGitEvents.Git.getConfig("user.name"); | ||
expect(currentVal).toBe(tempUser); | ||
} else { | ||
expect(currentVal).toBeDefined(); | ||
} | ||
// email validate | ||
currentVal = await testWindow.phoenixGitEvents.Git.getConfig("user.email"); | ||
if(!currentVal) { | ||
await testWindow.phoenixGitEvents.Git.setConfig("user.email", tempEmail, true); | ||
currentVal = await testWindow.phoenixGitEvents.Git.getConfig("user.email"); | ||
expect(currentVal).toBe(tempEmail); | ||
} else { | ||
expect(currentVal).toBeDefined(); | ||
} | ||
}); | ||
|
||
async function commitAllBtnClick() { | ||
await showGitPanel(); | ||
if(!$(".check-all").prop("checked")) { | ||
|