forked from kubernetes/kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Updates travis to run karma - Adds some actual tests Sample build success: https://travis-ci.org/djvirgen/kubernetes/jobs/61567253 Note: My branch is currently up to date with master but all the Go stuff is failing in Travis. Not sure why Go is failing, but the Karma stuff is running OK. I've also verified that when a Jasmine test fails, Travis will fail the build (see [this build](https://travis-ci.org/djvirgen/kubernetes/jobs/61567666) here).
- Loading branch information
Showing
5 changed files
with
83 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,3 +53,6 @@ network_closure.sh | |
|
||
# Web UI | ||
www/master/node_modules/ | ||
|
||
# Karma output | ||
www/test_out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
www/master/components/dashboard/test/controllers/header.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
'use strict'; | ||
|
||
describe('header controller', function() { | ||
beforeEach(module('kubernetesApp.components.dashboard')); | ||
|
||
beforeEach(inject(function($rootScope, $location, $controller) { | ||
this.rootScope = $rootScope; | ||
this.scope = $rootScope.$new(); | ||
|
||
this.location = $location; | ||
spyOn(this.location, 'path'); | ||
|
||
this.controller = $controller; | ||
this.ctrl = this.controller('HeaderCtrl', { | ||
$scope: this.scope | ||
}); | ||
this.scope.$apply(); | ||
})); | ||
|
||
describe('subPages', function() { | ||
it('is defined', function() { | ||
expect(this.scope.subPages).not.toBeUndefined(); | ||
}); | ||
|
||
it('is an array', function() { | ||
expect(Array.isArray(this.scope.subPages)).toBeTruthy(); | ||
}); | ||
|
||
it('is not empty', function() { | ||
expect(this.scope.subPages.length).toBeGreaterThan(0); | ||
}); | ||
|
||
describe('each subPage', function() { | ||
it('has a category', function() { | ||
this.scope.subPages.forEach(function(subPage) { | ||
expect(subPage.category).toBeTruthy(); | ||
}); | ||
}); | ||
|
||
it('has a name', function() { | ||
this.scope.subPages.forEach(function(subPage) { | ||
expect(subPage.name).toBeTruthy(); | ||
}); | ||
}); | ||
|
||
it('has a value', function() { | ||
this.scope.subPages.forEach(function(subPage) { | ||
expect(subPage.value).toBeTruthy(); | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('Pages', function() { | ||
it('does not change location on first detected change', function() { | ||
expect(this.location.path).not.toHaveBeenCalled(); | ||
}); | ||
|
||
it('changes location on second detected change', function() { | ||
var _this = this; | ||
this.scope.$apply(function() { | ||
_this.scope.Pages = 'test_Pages'; | ||
}); | ||
expect(this.location.path).toHaveBeenCalledWith('test_Pages'); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters