Leemoonsoo commented on a change in pull request #3302: [ZEPPELIN-3988] 
Paragraph Text output includes \r\n is not displayed correctly.
URL: https://github.com/apache/zeppelin/pull/3302#discussion_r253344467
 
 

 ##########
 File path: 
zeppelin-web/src/app/notebook/paragraph/result/result.controller.test.js
 ##########
 @@ -0,0 +1,41 @@
+describe('Controller: ResultCtrl', function() {
+  beforeEach(angular.mock.module('zeppelinWebApp'));
+
+  let scope;
+  let controller;
+  let resultMock = {
+  };
+  let configMock = {
+  };
+  let paragraphMock = {
+    id: 'p1',
+    results: {
+      msg: [],
+    },
+  };
+  let route = {
+    current: {
+      pathParams: {
+        noteId: 'noteId',
+      },
+    },
+  };
+
+  beforeEach(inject(function($controller, $rootScope) {
+    scope = $rootScope.$new();
+    scope.$parent = $rootScope.$new(true, $rootScope);
+    scope.$parent.paragraph = paragraphMock;
+
+    controller = $controller('ResultCtrl', {
+      $scope: scope,
+      $route: route,
+    });
+
+    scope.init(resultMock, configMock, paragraphMock, 1);
+  }));
+
+  it('scope should be initialized', function() {
+    expect(scope).toBeDefined();
+    expect(controller).toBeDefined();
 
 Review comment:
   Does not have meaningful test now. But later, test for 
`result.controller.js` can be easily added when necessary.
   Note that `controller` method, such as `const checkAndReplaceCarriageReturn 
= ...` is not accessible here. Unlike `scope` is accessible and testable here.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to