[Copy] Diff between user cancellation and failure

This commit is contained in:
Bogdan 2017-02-25 15:05:29 +02:00
parent 5bc7a701dc
commit eb91cd33be
6 changed files with 14 additions and 8 deletions

View File

@ -141,6 +141,8 @@ define(
currentParent
).then(function (newParentObj) {
return composeService.perform(object, newParentObj);
}, function () {
return Promise.reject({ message: "cancelled" });
});
};

View File

@ -117,6 +117,10 @@ define(
}
function error(errorDetails) {
if (errorDetails && (errorDetails.message === "cancelled")) {
return;
}
var errorDialog,
errorMessage = {
title: "Error copying objects.",

View File

@ -157,9 +157,9 @@ define(
);
});
it("waits for location from user", function () {
it("waits for location and handles cancellation by user", function () {
expect(locationServicePromise.then)
.toHaveBeenCalledWith(jasmine.any(Function));
.toHaveBeenCalledWith(jasmine.any(Function), jasmine.any(Function));
});
it("copies object to selected location", function () {

View File

@ -180,9 +180,9 @@ define(
);
});
it("waits for location from user", function () {
it("waits for location and handles cancellation by user", function () {
expect(locationServicePromise.then)
.toHaveBeenCalledWith(jasmine.any(Function));
.toHaveBeenCalledWith(jasmine.any(Function), jasmine.any(Function));
});
it("copies object to selected location", function () {

View File

@ -133,9 +133,9 @@ define(
);
});
it("waits for location from user", function () {
it("waits for location and handles cancellation by user", function () {
expect(locationServicePromise.then)
.toHaveBeenCalledWith(jasmine.any(Function));
.toHaveBeenCalledWith(jasmine.any(Function), jasmine.any(Function));
});
it("links object to selected location", function () {

View File

@ -133,9 +133,9 @@ define(
);
});
it("waits for location from user", function () {
it("waits for location and handles cancellation by user", function () {
expect(locationServicePromise.then)
.toHaveBeenCalledWith(jasmine.any(Function));
.toHaveBeenCalledWith(jasmine.any(Function), jasmine.any(Function));
});
it("moves object to selected location", function () {