Skip to content

Commit 0555b89

Browse files
committed
test: git discard all local changes integ test
1 parent d6ace3e commit 0555b89

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,27 @@ define(function (require, exports, module) {
435435

436436
});
437437

438+
it("should discard all changes since last commit", async () => {
439+
await SpecRunnerUtils.loadProjectInTestWindow(testPathGit);
440+
__PR.typeAtCursor("discardTest");
441+
await __PR.saveActiveFile();
442+
await __PR.openFile("test.js");
443+
__PR.typeAtCursor("discardJSTest");
444+
await __PR.saveActiveFile();
445+
await awaitsFor(()=>{
446+
return $gitPanel.find(".modified-file").length === 2;
447+
}, "2 files to be added in modified files list", 10000);
448+
449+
// now discard all changes
450+
__PR.execCommand(Commands.CMD_GIT_DISCARD_ALL_CHANGES); // dont await here as
451+
// it tracks full complete after dialog closed
452+
await __PR.waitForModalDialog("#git-question-dialog");
453+
__PR.clickDialogButtonID(__PR.Dialogs.DIALOG_BTN_OK);
454+
await awaitsFor(()=>{
455+
return $gitPanel.find(".modified-file").length === 0;
456+
}, "no files in modified files list", 10000);
457+
});
458+
438459
});
439460

440461
});

0 commit comments

Comments
 (0)