diff --git a/src/app/cdk/interstitials/share-emails-domains/share-emails-domains.component.spec.ts b/src/app/cdk/interstitials/share-emails-domains/share-emails-domains.component.spec.ts index fd7032fe5..cb70bcf5b 100644 --- a/src/app/cdk/interstitials/share-emails-domains/share-emails-domains.component.spec.ts +++ b/src/app/cdk/interstitials/share-emails-domains/share-emails-domains.component.spec.ts @@ -4,6 +4,8 @@ import { ShareEmailsDomainsComponent } from './share-emails-domains.component' import { FormBuilder, FormControl, FormGroup } from '@angular/forms' import { RecordEmailsService } from 'src/app/core/record-emails/record-emails.service' import { PlatformInfoService } from '../../platform-info' +import { WINDOW_PROVIDERS } from '../../window' +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core' describe('ShareEmailsDomainsComponent', () => { let component: ShareEmailsDomainsComponent @@ -28,7 +30,9 @@ describe('ShareEmailsDomainsComponent', () => { provide: RecordEmailsService, useValue: {}, }, + WINDOW_PROVIDERS, ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], }) fixture = TestBed.createComponent(ShareEmailsDomainsComponent) component = fixture.componentInstance diff --git a/src/app/cdk/interstitials/share-emails-domains/share-emails-domains.component.ts b/src/app/cdk/interstitials/share-emails-domains/share-emails-domains.component.ts index 37394b38c..be75d51a8 100644 --- a/src/app/cdk/interstitials/share-emails-domains/share-emails-domains.component.ts +++ b/src/app/cdk/interstitials/share-emails-domains/share-emails-domains.component.ts @@ -1,9 +1,10 @@ -import { Component, EventEmitter, Input, Output } from '@angular/core' +import { Component, EventEmitter, Inject, Input, Output } from '@angular/core' import { PlatformInfoService } from '../../platform-info' import { AssertionVisibilityString, EmailsEndpoint } from 'src/app/types' import { FormBuilder, FormControl, FormGroup } from '@angular/forms' import { RecordEmailsService } from 'src/app/core/record-emails/record-emails.service' import { error } from 'console' +import { WINDOW } from '../../window' @Component({ selector: 'app-share-emails-domains', @@ -23,12 +24,14 @@ export class ShareEmailsDomainsComponent { constructor( public platformInfo: PlatformInfoService, private fb: FormBuilder, - private recordEmailsService: RecordEmailsService + private recordEmailsService: RecordEmailsService, + @Inject(WINDOW) private window: Window ) {} public loadingEmails = true @Output() finish = new EventEmitter() ngOnInit() { + this.window.scrollTo(0, 0) this.userPrivateDomains = this.getTop3MostRecentPrivateDomains( this.userEmailsJson )