Skip to content

Commit 52f9707

Browse files
committed
fix(tests): clean cookie after tests on auth
1 parent 02e96e1 commit 52f9707

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

app/templates/client/services/auth(auth)/auth.spec.js(karma)

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ describe('Service: Auth', function () {
1212
Auth = _Auth_;
1313
$httpBackend = _$httpBackend_;
1414
$cookieStore = _$cookieStore_;
15-
$cookieStore.remove('token');
1615
}));
1716

1817
afterEach(function () {
1918
$httpBackend.verifyNoOutstandingExpectation();
2019
$httpBackend.verifyNoOutstandingRequest();
20+
$cookieStore.remove('token');
2121
});
2222

2323
it('should log user', function () {

app/templates/client/views/login(auth)/login.spec.js(karma)

+5-2
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,20 @@ describe('Controller: LoginCtrl', function () {
66

77
var LoginCtrl,
88
$httpBackend,
9-
$location;
9+
$location,
10+
$cookieStore;
1011

11-
beforeEach(inject(function ($controller, _$httpBackend_, _$location_) {
12+
beforeEach(inject(function ($controller, _$httpBackend_, _$location_, _$cookieStore_) {
1213
LoginCtrl = $controller('LoginCtrl', {});
1314
$httpBackend = _$httpBackend_;
15+
$cookieStore = _$cookieStore_;
1416
$location = _$location_;
1517
}));
1618

1719
afterEach(function () {
1820
$httpBackend.verifyNoOutstandingExpectation();
1921
$httpBackend.verifyNoOutstandingRequest();
22+
$cookieStore.remove('token');
2023
});
2124

2225
it('should redirect to / after successful login', function () {

0 commit comments

Comments
 (0)