Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Comment out intermittently failing unit test #7754

Merged
merged 2 commits into from
May 5, 2014
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 36 additions & 36 deletions test/spec/DocumentCommandHandlers-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,42 +236,42 @@ define(function (require, exports, module) {
});
});

it("should swap out untitled document from working set even when not current", function () {
runs(function () {
promise = CommandManager.execute(Commands.FILE_NEW_UNTITLED);

waitsForDone(promise, "FILE_NEW_UNTITLED");
});

runs(function () {
// Select test.js in the project tree (so nothing is selected in the working set)
promise = FileViewController.openAndSelectDocument(testPath + "/test.js", FileViewController.PROJECT_MANAGER);

waitsForDone(promise, "openAndSelectDocument");
});

runs(function () {
spyOn(FileSystem, 'showSaveDialog').andCallFake(function (dialogTitle, initialPath, proposedNewName, callback) {
callback(undefined, newFilePath);
});

var promise = CommandManager.execute(Commands.FILE_SAVE_ALL);
waitsForDone(promise, "FILE_SAVE_ALL");
});

runs(function () {
var noLongerUntitledDocument = DocumentManager.getCurrentDocument();

expect(noLongerUntitledDocument.isDirty).toBe(false);
expect(noLongerUntitledDocument.isUntitled()).toBe(false);
expect(noLongerUntitledDocument.file.fullPath).toEqual(newFilePath);
expect(DocumentManager.findInWorkingSet(newFilePath)).toBeGreaterThan(-1);
expect(DocumentManager.getWorkingSet().length).toEqual(1); // no remnant of untitled doc left

// Verify file exists, & clean up
expectAndDelete(newFilePath);
});
});
// it("should swap out untitled document from working set even when not current", function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't you comment it out with xit?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I love using the brackets comment out all selected lines command :)

// runs(function () {
// promise = CommandManager.execute(Commands.FILE_NEW_UNTITLED);
//
// waitsForDone(promise, "FILE_NEW_UNTITLED");
// });
//
// runs(function () {
// // Select test.js in the project tree (so nothing is selected in the working set)
// promise = FileViewController.openAndSelectDocument(testPath + "/test.js", FileViewController.PROJECT_MANAGER);
//
// waitsForDone(promise, "openAndSelectDocument");
// });
//
// runs(function () {
// spyOn(FileSystem, 'showSaveDialog').andCallFake(function (dialogTitle, initialPath, proposedNewName, callback) {
// callback(undefined, newFilePath);
// });
//
// var promise = CommandManager.execute(Commands.FILE_SAVE_ALL);
// waitsForDone(promise, "FILE_SAVE_ALL");
// });
//
// runs(function () {
// var noLongerUntitledDocument = DocumentManager.getCurrentDocument();
//
// expect(noLongerUntitledDocument.isDirty).toBe(false);
// expect(noLongerUntitledDocument.isUntitled()).toBe(false);
// expect(noLongerUntitledDocument.file.fullPath).toEqual(newFilePath);
// expect(DocumentManager.findInWorkingSet(newFilePath)).toBeGreaterThan(-1);
// expect(DocumentManager.getWorkingSet().length).toEqual(1); // no remnant of untitled doc left
//
// // Verify file exists, & clean up
// expectAndDelete(newFilePath);
// });
// });

it("should ask to save untitled document upon closing", function () {
newFilename = "testname2.js";
Expand Down