Skip to content

Commit

Permalink
fix: Remove hardcoded togglz value and fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielPalafox committed Feb 7, 2024
1 parent cfeadc4 commit 34d74b7
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,39 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { RecordHeaderComponent } from './record-header.component';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { WINDOW_PROVIDERS } from 'src/app/cdk/window';
import { PlatformInfoService } from 'src/app/cdk/platform-info';
import { ErrorHandlerService } from 'src/app/core/error-handler/error-handler.service';
import { SnackbarService } from 'src/app/cdk/snackbar/snackbar.service';
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'
import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'
import { Overlay } from '@angular/cdk/overlay';
import { RouterTestingModule } from '@angular/router/testing';
import { RecordService } from 'src/app/core/record/record.service';

describe('TopBarPublicNamesComponent', () => {
describe('RecordHeaderComponent', () => {
let component: RecordHeaderComponent;
let fixture: ComponentFixture<RecordHeaderComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [HttpClientTestingModule, RouterTestingModule],
declarations: [RecordHeaderComponent],
providers: [
WINDOW_PROVIDERS,
RecordService ,
PlatformInfoService,
ErrorHandlerService,
SnackbarService,
MatSnackBar,
MatDialog,
Overlay,
],
}).compileComponents()
})

beforeEach(() => {
TestBed.configureTestingModule({
declarations: [RecordHeaderComponent]
});
fixture = TestBed.createComponent(RecordHeaderComponent);
component = fixture.componentInstance;
fixture.detectChanges();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,43 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { RecordInfoComponent } from './record-info.component';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { WINDOW_PROVIDERS } from 'src/app/cdk/window';
import { PlatformInfoService } from 'src/app/cdk/platform-info';
import { ErrorHandlerService } from 'src/app/core/error-handler/error-handler.service';
import { SnackbarService } from 'src/app/cdk/snackbar/snackbar.service';
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'
import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'
import { Overlay } from '@angular/cdk/overlay';

describe('InfoComponent', () => {
describe('RecordInfoComponent', () => {
let component: RecordInfoComponent;
let fixture: ComponentFixture<RecordInfoComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [HttpClientTestingModule, RouterTestingModule],
declarations: [RecordInfoComponent],
providers: [
WINDOW_PROVIDERS,
PlatformInfoService,
ErrorHandlerService,
SnackbarService,
MatSnackBar,
MatDialog,
Overlay,
],
}).compileComponents()
})

beforeEach(() => {
TestBed.configureTestingModule({
declarations: [RecordInfoComponent]
});
fixture = TestBed.createComponent(RecordInfoComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});


it('should create', () => {
expect(component).toBeTruthy();
});
Expand Down
3 changes: 1 addition & 2 deletions src/app/record/pages/my-orcid/my-orcid.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ export class MyOrcidComponent implements OnInit, OnDestroy {
regionActivities = $localize`:@@shared.activities:Activities`
readyForIndexing: boolean
fragment: string
// @ todo
newRecordHeaderTogglz = true
newRecordHeaderTogglz = false

constructor(
_userInfoService: UserInfoService,
Expand Down

0 comments on commit 34d74b7

Please sign in to comment.