summaryrefslogtreecommitdiffstats
path: root/js/tests
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-09-12 02:07:01 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-09-12 02:07:01 +0200
commitaee7a83449230f8835c6d98838c565303b633fc1 (patch)
treeb6a32c6d6aeda6c996b7bd75bc07cb4fc94f1dcb /js/tests
parent6f68f42535cb84bc9e28848cfc4f72cd53f2141d (diff)
add styling for error, disable draggable on error
Diffstat (limited to 'js/tests')
-rw-r--r--js/tests/unit/controller/NavigationControllerSpec.js33
1 files changed, 31 insertions, 2 deletions
diff --git a/js/tests/unit/controller/NavigationControllerSpec.js b/js/tests/unit/controller/NavigationControllerSpec.js
index 162e04516..23f1b3522 100644
--- a/js/tests/unit/controller/NavigationControllerSpec.js
+++ b/js/tests/unit/controller/NavigationControllerSpec.js
@@ -441,7 +441,7 @@ describe('NavigationController', function () {
}));
- it('should move a folder', inject(function ($controller, FEED_TYPE,
+ it('should move a feed', inject(function ($controller, FEED_TYPE,
FeedResource) {
FeedResource.move = jasmine.createSpy('move');
@@ -462,13 +462,42 @@ describe('NavigationController', function () {
$route: route
});
+ ctrl.moveFeed(1, 4);
+
+ expect(FeedResource.move).toHaveBeenCalledWith(1, 4);
+ expect(route.reload).not.toHaveBeenCalled();
+ }));
+
+
+ it('should not move a feed if nothing changed', inject(function (
+ $controller, FEED_TYPE, FeedResource) {
+ FeedResource.move = jasmine.createSpy('move');
+
+ var route = {
+ reload: jasmine.createSpy('reload'),
+ current: {
+ $$route: {
+ type: FEED_TYPE.FOLDER
+ },
+ params: {
+ id: 2
+ }
+ }
+ };
+
+ var ctrl = $controller('NavigationController', {
+ FeedResource: FeedResource,
+ $route: route
+ });
+
ctrl.moveFeed(1, 3);
- expect(FeedResource.move).toHaveBeenCalledWith(1, 3);
+ expect(FeedResource.move).not.toHaveBeenCalled();
expect(route.reload).not.toHaveBeenCalled();
}));
+
it('should reload if a feed is moved from active folder', inject(
function ($controller, FEED_TYPE, FeedResource) {
FeedResource.move = jasmine.createSpy('move');