Skip to content

Commit a046f56

Browse files
pkt-zer0christopherthielen
authored andcommitted
cherry-pick 2aeb0c4 from 0.2.17
1 parent 1e5bfd1 commit a046f56

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/stateSpec.js

+15
Original file line numberDiff line numberDiff line change
@@ -1900,3 +1900,18 @@ describe('.onInvalid()', function() {
19001900
expect($state.current.name).toBe("second")
19011901
}));
19021902
});
1903+
1904+
describe('$stateParams', function () {
1905+
beforeEach(module('ui.router.state'));
1906+
1907+
it('should start empty', inject(function ($stateParams) {
1908+
expect($stateParams.foo).toBeUndefined();
1909+
}));
1910+
it('should allow setting values on it', inject(function ($stateParams) {
1911+
$stateParams.foo = 'bar';
1912+
expect($stateParams.foo).toBeDefined();
1913+
}));
1914+
it('should be cleared between tests', inject(function ($stateParams) {
1915+
expect($stateParams.foo).toBeUndefined();
1916+
}));
1917+
});

0 commit comments

Comments
 (0)