mirror of
https://github.com/mmumshad/ansible-playable.git
synced 2025-03-09 23:38:54 +00:00
Initial Commit
This commit is contained in:
commit
c92f737237
273 changed files with 16964 additions and 0 deletions
37
client/app/main/main.component.spec.js
Normal file
37
client/app/main/main.component.spec.js
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
'use strict';
|
||||
|
||||
import main from './main.component';
|
||||
import {
|
||||
MainController
|
||||
} from './main.component';
|
||||
|
||||
describe('Component: MainComponent', function() {
|
||||
beforeEach(angular.mock.module(main));
|
||||
beforeEach(angular.mock.module('stateMock'));
|
||||
|
||||
var scope;
|
||||
var mainComponent;
|
||||
var state;
|
||||
var $httpBackend;
|
||||
|
||||
// Initialize the controller and a mock scope
|
||||
beforeEach(inject(function(_$httpBackend_, $http, $componentController, $rootScope, $state) {
|
||||
$httpBackend = _$httpBackend_;
|
||||
$httpBackend.expectGET('/api/things')
|
||||
.respond(['HTML5 Boilerplate', 'AngularJS', 'Karma', 'Express']);
|
||||
|
||||
scope = $rootScope.$new();
|
||||
state = $state;
|
||||
mainComponent = $componentController('main', {
|
||||
$http,
|
||||
$scope: scope
|
||||
});
|
||||
}));
|
||||
|
||||
it('should attach a list of things to the controller', function() {
|
||||
mainComponent.$onInit();
|
||||
$httpBackend.flush();
|
||||
expect(mainComponent.awesomeThings.length)
|
||||
.to.equal(4);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue