redash/rd_ui/test/unit/test_query_view.js
2014-08-03 11:15:00 +03:00

35 lines
743 B
JavaScript

'use strict';
describe('QueryViewCtrl', function() {
var scope;
var mockData;
beforeEach(module('redash', 'redashMocks'));
beforeEach(inject(function($injector, $controller, $rootScope, Query, _mockData_) {
mockData = _mockData_;
scope = $rootScope.$new();
var route = {
current: {
locals: {
query: new Query(mockData.query)
}
}
};
$controller('QueryViewCtrl', {$scope: scope, $route: route});
}));
it('should have a query', function() {
expect(scope.query).toBeDefined();
});
it('should update the executing state', function() {
expect(scope.queryExecuting).toBe(false);
scope.executeQuery();
expect(scope.queryExecuting).toBe(true);
});
});