zeppelin/zeppelin-web/test/spec/controllers/main.js
Damien CORNEAU 911b4175e4 [Zeppelin-1089] Replace JsHint with Eslint
### What is this PR for?
This PR replace JsHint with Eslint, the original configuration was ported from jsHint using [Polyjuice](https://www.npmjs.com/package/polyjuice), then the settings were tuned to match exactly.
For this PR, the goal is not to add new rules, but only to replace the system with the same rules.

### What type of PR is it?
Improvement

### Todos
* [x] - Remove .jshintrc

### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-1089

### How should this be tested?
You can simply build the code.
You can try to add an unused variable in the js code to see an error.

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No

Author: Damien CORNEAU <[email protected]>

Closes #1204 from corneadoug/ZEPPELIN-1089 and squashes the following commits:

6cf1e2a [Damien CORNEAU] fix $ is missing error
e71389d [Damien CORNEAU] remove jshint remnants
e1b389f [Damien CORNEAU] remove .jsintrc
0364ad4 [Damien CORNEAU] Fix eslint for tests
7b1da05 [Damien CORNEAU] Replace JsHint by Eslint
2016-07-21 18:34:39 +09:00

31 lines
834 B
JavaScript

'use strict';
describe('Controller: MainCtrl', function() {
beforeEach(module('zeppelinWebApp'));
var scope;
var rootScope;
beforeEach(inject(function($controller, $rootScope) {
rootScope = $rootScope;
scope = $rootScope.$new();
$controller('MainCtrl', {
$scope: scope
});
}));
it('should attach "asIframe" to the scope and the default value should be false', function() {
expect(scope.asIframe).toBeDefined();
expect(scope.asIframe).toEqual(false);
});
it('should set the default value of "looknfeel to "default"', function() {
expect(scope.looknfeel).toEqual('default');
});
it('should set "asIframe" flag to true when a controller broadcasts setIframe event', function() {
rootScope.$broadcast('setIframe', true);
expect(scope.asIframe).toEqual(true);
});
});