Skip to content

Commit ae591e6

Browse files
committed
Refactoring 'registerState()' into 'stateBuilder'.
- Adding tests - Adding comments
1 parent ff47736 commit ae591e6

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

test/stateSpec.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,4 +383,25 @@ describe('state', function () {
383383
}));
384384
});
385385

386-
});
386+
describe('html5Mode compatibility', function() {
387+
388+
it('should generate non-hashbang URLs in HTML5 mode', inject(function ($state) {
389+
expect($state.href("about.person", { person: "bob" })).toEqual("#/about/bob");
390+
locationProvider.html5Mode(true);
391+
expect($state.href("about.person", { person: "bob" })).toEqual("/about/bob");
392+
}));
393+
});
394+
395+
describe('default properties', function () {
396+
it('should always have a name', inject(function ($state, $q) {
397+
$state.transitionTo(A);
398+
$q.flush();
399+
expect($state.$current.name).toBe('A');
400+
expect($state.$current.toString()).toBe('A');
401+
}));
402+
403+
it('should always have a resolve object', inject(function ($state) {
404+
expect($state.$current.resolve).toEqual({});
405+
}));
406+
});
407+
});

0 commit comments

Comments
 (0)