From dee5c75ea7ab4d2e47fd3d65ca641d669228d2f3 Mon Sep 17 00:00:00 2001 From: Mihail Maxacov <0xf013@gmail.com> Date: Wed, 4 Feb 2015 14:12:46 +0200 Subject: [PATCH] fix dispatcher test --- frontend/app/ui_components/inplace-editor-directive.js | 1 - frontend/tests/integration/work-package-details-spec.js | 2 +- .../work_packages/directives/inplace-editor-directive-test.js | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/frontend/app/ui_components/inplace-editor-directive.js b/frontend/app/ui_components/inplace-editor-directive.js index 9d6f03df02..97bf7d5753 100644 --- a/frontend/app/ui_components/inplace-editor-directive.js +++ b/frontend/app/ui_components/inplace-editor-directive.js @@ -169,7 +169,6 @@ module.exports = function( 'workPackageRefreshRequired', function(workPackage) { OverviewTabInplaceEditorConfig.dispatchChanges(workPackage); - // $scope.acceptChanges(workPackage); } ); } diff --git a/frontend/tests/integration/work-package-details-spec.js b/frontend/tests/integration/work-package-details-spec.js index 0768d4b556..bfd3afad88 100644 --- a/frontend/tests/integration/work-package-details-spec.js +++ b/frontend/tests/integration/work-package-details-spec.js @@ -102,7 +102,7 @@ describe('OpenProject', function() { } describe('subject', function() { - var subjectEditor = $('h2 .inplace-editor'); + var subjectEditor = $('.wp-subject .inplace-editor'); context('work package with updateImmediately link', function() { beforeEach(function() { diff --git a/frontend/tests/unit/tests/work_packages/directives/inplace-editor-directive-test.js b/frontend/tests/unit/tests/work_packages/directives/inplace-editor-directive-test.js index 8e7da8ba3a..37ee935bfa 100644 --- a/frontend/tests/unit/tests/work_packages/directives/inplace-editor-directive-test.js +++ b/frontend/tests/unit/tests/work_packages/directives/inplace-editor-directive-test.js @@ -320,6 +320,7 @@ describe('inplaceEditor Directive', function() { 'deregisterActiveEditorScope' ); elementScope.discardEditing(); + $timeout.flush(); }); it('should register the scope to a list of actives', function() { deregisterActiveEditorScopeSpy.should.have.been.calledWith(elementScope); @@ -345,9 +346,8 @@ describe('inplaceEditor Directive', function() { it('should switch to read view', function() { expect(elementScope.isEditing).to.eq(false); }); - it('should propagate changes to all editor including self', function() { + it('should propagate changes to all editors', function() { dispatchChangesSpy.should.have.been.calledWith(elementScope.entity); - acceptChangesSpy.should.have.been.calledWith(elementScope.entity); }); }); describe('onFail', function() {