Skip to content

Commit 58d6e2b

Browse files
authored
[Angular] Sonar: Add at least one assertion to this test case (#31753)
1 parent e3cc216 commit 58d6e2b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

generators/angular/templates/src/main/webapp/app/core/auth/account.service.spec.ts.ejs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ describe('Account Service', () => {
154154
// Once more
155155
service.identity().subscribe();
156156
// Then there is only request
157-
httpMock.expectOne({ method: 'GET' });
157+
const requests = httpMock.match({ method: 'GET' });
158+
expect(requests.length).toBe(1);
158159
});
159160

160161
it('should call /account only once if not logged out after first authentication and should call /account again if user has logged out', () => {
@@ -174,7 +175,8 @@ describe('Account Service', () => {
174175
service.identity().subscribe();
175176

176177
// Then there is a new request
177-
httpMock.expectOne({ method: 'GET' });
178+
const requests = httpMock.match({ method: 'GET' });
179+
expect(requests.length).toBe(1);
178180
});
179181

180182
<%_ if (enableTranslation) { _%>

0 commit comments

Comments
 (0)