Skip to content

Commit

Permalink
Add unit test for doNotRedirect flag
Browse files Browse the repository at this point in the history
Validate doNotRedirect set to true works to disable location routing
logic in logoutConfirmed.
  • Loading branch information
justinsa committed Oct 24, 2017
1 parent afffea0 commit b9cb59f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,16 @@ describe('$authentication', function () {
$location.url().should.match('/home');
})
);

it('should not navigate to any location when the doNotRedirect flag is true',
inject(function ($authentication, $location) {
$authentication.profile({ roles: ['a', 'b', 'c'] });
$location.url('/dashboard/?a=b#anchor');
$location.url().should.match('/dashboard/?a=b#anchor');
$authentication.logoutConfirmed(true);
$location.url().should.match('/dashboard/?a=b#anchor');
})
);
});

describe('profile()', function () {
Expand Down

0 comments on commit b9cb59f

Please sign in to comment.