From e0d2a491b7930218f6295763d989291466a88305 Mon Sep 17 00:00:00 2001 From: abose Date: Fri, 17 Jan 2025 00:19:15 +0530 Subject: [PATCH] test: git username test fix --- test/spec/Extn-Git-integ-test.js | 47 ++++++++++++++++---------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/test/spec/Extn-Git-integ-test.js b/test/spec/Extn-Git-integ-test.js index ab04bb953..2d40c4b03 100644 --- a/test/spec/Extn-Git-integ-test.js +++ b/test/spec/Extn-Git-integ-test.js @@ -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 = "phcodeTestGitUser@gmail.com"; - // 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 = "phcodeTestGitUser@gmail.com"; + // 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")) {