Skip to content

Commit

Permalink
[Angular] Upgrade RxJs 7.5.1 (#16887)
Browse files Browse the repository at this point in the history
Co-authored-by: Marcelo Shima <marceloshima@gmail.com>
  • Loading branch information
qmonmert and mshima authored Dec 30, 2021
1 parent 042dd3d commit 011bf9d
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion generators/client/templates/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"ngx-cookie-service": "13.1.2",
"ngx-infinite-scroll": "10.0.1",
"ngx-webstorage": "9.0.0",
"rxjs": "6.6.7",
"rxjs": "7.5.1",
"swagger-ui-dist": "4.1.3",
"tslib": "2.3.1",
"zone.js": "0.11.4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe('Home Component', () => {
<%_ if (!authenticationTypeOauth2) { _%>

mockRouter = TestBed.inject(Router);
jest.spyOn(mockRouter, 'navigate').mockImplementation(() => of(true).toPromise());
jest.spyOn(mockRouter, 'navigate').mockImplementation(() => Promise.resolve(true));

<%_ } else { _%>
mockLoginService = TestBed.inject(LoginService);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('LoginComponent', () => {
fixture = TestBed.createComponent(LoginComponent);
comp = fixture.componentInstance;
mockRouter = TestBed.inject(Router);
jest.spyOn(mockRouter, 'navigate').mockImplementation(() => of(true).toPromise());
jest.spyOn(mockRouter, 'navigate').mockImplementation(() => Promise.resolve(true));
mockLoginService = TestBed.inject(LoginService);
mockAccountService = TestBed.inject(AccountService);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ describe('HasAnyAuthorityDirective tests', () => {
mockAccountService.hasAnyAuthority = jest.fn(() => false);

// WHEN
authenticationState.next();
authenticationState.next(null);
fixture.detectChanges();

// THEN
Expand All @@ -109,7 +109,7 @@ describe('HasAnyAuthorityDirective tests', () => {
mockAccountService.hasAnyAuthority = jest.fn(() => true);

// WHEN
authenticationState.next();
authenticationState.next(null);
fixture.detectChanges();

// THEN
Expand All @@ -133,15 +133,15 @@ describe('HasAnyAuthorityDirective tests', () => {

// WHEN
jest.clearAllMocks();
authenticationState.next();
authenticationState.next(null);

// THEN
expect(mockAccountService.hasAnyAuthority).toHaveBeenCalled();

// WHEN
jest.clearAllMocks();
hasAnyAuthorityDirective.ngOnDestroy();
authenticationState.next();
authenticationState.next(null);

// THEN
expect(mockAccountService.hasAnyAuthority).not.toHaveBeenCalled();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class TranslateDirective implements OnChanges, OnInit, OnDestroy {
@Input() <%= jhiPrefix %>Translate!: string;
@Input() translateValues?: { [key: string]: unknown };

private readonly directiveDestroyed = new Subject<never>();
private readonly directiveDestroyed = new Subject();

constructor(private el: ElementRef, private translateService: TranslateService) {}

Expand All @@ -51,7 +51,7 @@ export class TranslateDirective implements OnChanges, OnInit, OnDestroy {
}

ngOnDestroy(): void {
this.directiveDestroyed.next();
this.directiveDestroyed.next(null);
this.directiveDestroyed.complete();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('<%= entityAngularName %> Management Delete Component', () => {
inject([],
fakeAsync(() => {
// GIVEN
jest.spyOn(service, 'delete').mockReturnValue(of(new HttpResponse({})));
jest.spyOn(service, 'delete').mockReturnValue(of(new HttpResponse({ body: {} })));

// WHEN
comp.confirmDelete(<%- tsKeyId %>);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('<%= entityAngularName %> routing resolve service', () => {
],
});
mockRouter = TestBed.inject(Router);
jest.spyOn(mockRouter, 'navigate').mockImplementation(() => of(true).toPromise());
jest.spyOn(mockRouter, 'navigate').mockImplementation(() => Promise.resolve(true));
mockActivatedRouteSnapshot = TestBed.inject(ActivatedRoute).snapshot;
routingResolveService = TestBed.inject(<%= entityAngularName %>RoutingResolveService);
service = TestBed.inject(<%= entityAngularName %>Service);
Expand Down

0 comments on commit 011bf9d

Please sign in to comment.