Skip to content

Commit

Permalink
Merge pull request #2019 from ORCID/fix/batch-fixes-14-jul-2023
Browse files Browse the repository at this point in the history
Fix testing
  • Loading branch information
leomendoza123 authored Jul 14, 2023
2 parents ee1963a + 6f82890 commit 4214980
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 18 deletions.
7 changes: 1 addition & 6 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,7 @@ const routes: Routes = [
]

@NgModule({
imports: [
RouterModule.forRoot(routes, {
relativeLinkResolution: 'legacy',
anchorScrolling: 'enabled',
}),
],
imports: [RouterModule.forRoot(routes, { relativeLinkResolution: 'legacy' })],
exports: [RouterModule],
})
export class AppRoutingModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { RecordService } from 'src/app/core/record/record.service'
import { ChangeDetectorRef } from '@angular/core'
import { UserInfoService } from 'src/app/core/user-info/user-info.service'
import { of } from 'rxjs'
import { WINDOW_PROVIDERS } from 'src/app/cdk/window'
import { WINDOW, WINDOW_PROVIDERS } from 'src/app/cdk/window'
import { DeveloperToolsComponent } from './developer-tools.component'
import { PlatformInfoService } from 'src/app/cdk/platform-info'

Expand All @@ -19,7 +19,7 @@ describe('DeveloperToolsComponent', () => {
await TestBed.configureTestingModule({
declarations: [DeveloperToolsComponent],
providers: [
WINDOW_PROVIDERS,
{ provide: WINDOW, useValue: {} },
{
provide: PlatformInfoService,
useValue: { get: () => of({}) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ export class DeveloperToolsComponent implements OnInit, OnDestroy {
this.isMobile = platform.columns4 || platform.columns8
})

this.baseURL = this.window.location.origin
if (this.window?.location) {
this.baseURL = this.window.location.origin
}
this.getDeveloperToolsEnableState()
.pipe(
switchMap((developerToolsEnableState) => {
Expand Down Expand Up @@ -144,15 +146,17 @@ export class DeveloperToolsComponent implements OnInit, OnDestroy {
}

private setFocusToTheMainDiv() {
this.window.location.href = '/developer-tools' + '#main'
setTimeout(() => {
this.window.window.scrollTo(0, 0)
this.window.history.replaceState(
{},
this.window.document.title,
'/developer-tools'
)
})
if (this.window?.location) {
this.window.location.href = '/developer-tools' + '#main'
setTimeout(() => {
this.window.window.scrollTo(0, 0)
this.window.history.replaceState(
{},
this.window.document.title,
'/developer-tools'
)
})
}
}

save() {
Expand Down

0 comments on commit 4214980

Please sign in to comment.