mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
Add simple test for spinner
This commit is contained in:
parent
d197f5eac9
commit
05e65b3d2d
2 changed files with 57 additions and 0 deletions
|
@ -55,6 +55,7 @@
|
|||
'specs/directives/timepicker',
|
||||
'specs/directives/truncate',
|
||||
'specs/directives/css_truncate',
|
||||
'specs/directives/spinner',
|
||||
'specs/filters/field_type',
|
||||
'specs/filters/uriescape',
|
||||
'specs/filters/moment',
|
||||
|
|
56
test/unit/specs/directives/spinner.js
Normal file
56
test/unit/specs/directives/spinner.js
Normal file
|
@ -0,0 +1,56 @@
|
|||
define(function (require) {
|
||||
var angular = require('angular');
|
||||
var mocks = require('angular-mocks');
|
||||
var $ = require('jquery');
|
||||
|
||||
// Load the kibana app dependencies.
|
||||
require('angular-route');
|
||||
|
||||
// Load kibana and its applications
|
||||
require('index');
|
||||
|
||||
require('apps/discover/index');
|
||||
|
||||
var $parentScope, $scope, $elem;
|
||||
|
||||
var init = function () {
|
||||
// Load the application
|
||||
module('kibana');
|
||||
|
||||
// Create the scope
|
||||
inject(function ($rootScope, $compile) {
|
||||
|
||||
// Give us a scope
|
||||
$parentScope = $rootScope;
|
||||
|
||||
// Create the element
|
||||
$elem = angular.element(
|
||||
'<span class="spinner"></span>'
|
||||
);
|
||||
|
||||
// And compile it
|
||||
$compile($elem)($parentScope);
|
||||
|
||||
// Fire a digest cycle
|
||||
$elem.scope().$digest();
|
||||
|
||||
// Grab the isolate scope so we can test it
|
||||
$scope = $elem.isolateScope();
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
describe('spinner directive', function () {
|
||||
|
||||
beforeEach(function () {
|
||||
init();
|
||||
});
|
||||
|
||||
it('should contain 3 divs', function (done) {
|
||||
expect($elem.children('div').length).to.be(3);
|
||||
done();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue