Skip to content

Commit d76a3ca

Browse files
committed
fix(unit-tests): fixed tests
1 parent b6e8eac commit d76a3ca

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

src/app/features/metadata/components/cedar-template-form/cedar-template-form.component.spec.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
import { MockComponent } from 'ng-mocks';
2-
3-
import { PLATFORM_ID } from '@angular/core';
41
import { ComponentFixture, TestBed } from '@angular/core/testing';
52

63
import { CedarMetadataHelper } from '@osf/features/metadata/helpers';
74
import { CedarMetadataDataTemplateJsonApi } from '@osf/features/metadata/models';
8-
import { LoadingSpinnerComponent } from '@osf/shared/components/loading-spinner/loading-spinner.component';
95

106
import { CedarTemplateFormComponent } from './cedar-template-form.component';
117

@@ -20,8 +16,7 @@ describe('CedarTemplateFormComponent', () => {
2016

2117
beforeEach(async () => {
2218
await TestBed.configureTestingModule({
23-
imports: [CedarTemplateFormComponent, OSFTestingModule, MockComponent(LoadingSpinnerComponent)],
24-
providers: [{ provide: PLATFORM_ID, useValue: 'browser' }],
19+
imports: [CedarTemplateFormComponent, OSFTestingModule],
2520
}).compileComponents();
2621

2722
fixture = TestBed.createComponent(CedarTemplateFormComponent);
@@ -80,14 +75,10 @@ describe('CedarTemplateFormComponent', () => {
8075
expect(emitSpy).toHaveBeenCalled();
8176
});
8277

83-
it('should initialize form data with empty metadata when no existing record', async () => {
78+
it('should initialize form data with empty metadata when no existing record', () => {
8479
fixture.componentRef.setInput('existingRecord', null);
8580
fixture.detectChanges();
8681

87-
await (component as any).loadCedarLibraries();
88-
(component as any).initializeCedar();
89-
fixture.detectChanges();
90-
9182
const expectedEmptyMetadata = CedarMetadataHelper.buildEmptyMetadata();
9283
expect(component.formData()).toEqual(expectedEmptyMetadata);
9384
});

0 commit comments

Comments
 (0)