-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathedit-component-advanced.component.spec.ts
More file actions
60 lines (56 loc) · 2.34 KB
/
Copy pathedit-component-advanced.component.spec.ts
File metadata and controls
60 lines (56 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { MockComponent, MockProviders } from 'ng-mocks';
import { ComponentContent } from '../../../assets/wise5/common/ComponentContent';
import { EditShowMyWorkAdvancedComponent } from '../../../assets/wise5/components/showMyWork/edit-show-my-work-advanced/edit-show-my-work-advanced.component';
import { NotebookService } from '../../../assets/wise5/services/notebookService';
import { NotificationService } from '../../../assets/wise5/services/notificationService';
import { TeacherNodeService } from '../../../assets/wise5/services/teacherNodeService';
import { TeacherProjectService } from '../../../assets/wise5/services/teacherProjectService';
import { EditComponentAdvancedComponent } from './edit-component-advanced.component';
import { ComponentServiceLookupService } from '../../../assets/wise5/services/componentServiceLookupService';
let component: EditComponentAdvancedComponent;
let fixture: ComponentFixture<EditComponentAdvancedComponent>;
describe('EditComponentAdvancedComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [MockComponent(EditShowMyWorkAdvancedComponent), EditComponentAdvancedComponent],
providers: [
{
provide: MAT_DIALOG_DATA,
useValue: {
component: {
content: { type: 'ShowMyWork' },
id: 'component1',
nodeId: 'node1'
},
tab: 'general'
}
},
{
provide: MatDialogRef,
useValue: {
close: () => {}
}
},
MockProviders(
ComponentServiceLookupService,
TeacherNodeService,
NotebookService,
NotificationService,
TeacherProjectService
)
]
}).compileComponents();
fixture = TestBed.createComponent(EditComponentAdvancedComponent);
component = fixture.componentInstance;
spyOn(TestBed.inject(TeacherProjectService), 'getComponent').and.returnValue({
type: 'ShowMyWork'
} as ComponentContent);
spyOn(TestBed.inject(TeacherProjectService), 'getProject').and.returnValue({});
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});