mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
add test for _urlParam
This commit is contained in:
parent
fb3bf65d6b
commit
f28099cb8d
1 changed files with 16 additions and 11 deletions
|
@ -21,17 +21,9 @@ define(function (require) {
|
|||
appState = new AppState();
|
||||
});
|
||||
|
||||
it('should have a destroy method', function () {
|
||||
expect(appState).to.have.property('destroy');
|
||||
});
|
||||
|
||||
it('should be destroyed on $routeChangeStart', function () {
|
||||
var destroySpy = sinon.spy(appState, 'destroy');
|
||||
var url = '/test/path';
|
||||
|
||||
$rootScope.$emit('$routeChangeStart');
|
||||
|
||||
expect(destroySpy.callCount).to.be(1);
|
||||
it('should have _urlParam of _a', function () {
|
||||
expect(appState).to.have.property('_urlParam');
|
||||
expect(appState._urlParam).to.equal('_a');
|
||||
});
|
||||
|
||||
it('should use passed in params', function () {
|
||||
|
@ -48,6 +40,19 @@ define(function (require) {
|
|||
expect(appState._defaults[key]).to.equal(params[key]);
|
||||
});
|
||||
});
|
||||
|
||||
it('should have a destroy method', function () {
|
||||
expect(appState).to.have.property('destroy');
|
||||
});
|
||||
|
||||
it('should be destroyed on $routeChangeStart', function () {
|
||||
var destroySpy = sinon.spy(appState, 'destroy');
|
||||
var url = '/test/path';
|
||||
|
||||
$rootScope.$emit('$routeChangeStart');
|
||||
|
||||
expect(destroySpy.callCount).to.be(1);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue