Skip to content

Commit

Permalink
Working Unit Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bob-fornal committed Jul 11, 2024
1 parent 2ba2d3f commit d8bce32
Show file tree
Hide file tree
Showing 19 changed files with 142 additions and 57 deletions.
4 changes: 4 additions & 0 deletions src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ describe('AppComponent', () => {
fixture.detectChanges();
});

beforeAll(() => {
window.onbeforeunload = jasmine.createSpy();
});

it('should create the app', () => {
expect(component).toBeTruthy();
});
Expand Down
4 changes: 4 additions & 0 deletions src/app/pages/control-panel/control-panel.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ describe('ControlPanelComponent', () => {
fixture.detectChanges();
});

beforeAll(() => {
window.onbeforeunload = jasmine.createSpy();
});

it('should create', () => {
expect(component).toBeTruthy();
});
Expand Down
19 changes: 12 additions & 7 deletions src/app/pages/courses/courses.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,23 @@ describe('CoursesComponent', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [
CoursesComponent,
],
providers: [
{ provide: CodeService, useValue: MockCodeService },
]
});
imports: [
CoursesComponent,
],
providers: [
{ provide: CodeService, useValue: MockCodeService },
]
});

fixture = TestBed.createComponent(CoursesComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

beforeAll(() => {
window.onbeforeunload = jasmine.createSpy();
});

it('should create', () => {
expect(component).toBeTruthy();
});
Expand Down
17 changes: 11 additions & 6 deletions src/app/pages/edit/edit.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,22 @@ describe('EditComponent', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [EditComponent],
providers: [
{ provide: ActivatedRoute, useValue: MockActivatedRoute },
{ provide: CodeService, useValue: MockCodeService },
]
});
imports: [EditComponent],
providers: [
{ provide: ActivatedRoute, useValue: MockActivatedRoute },
{ provide: CodeService, useValue: MockCodeService },
]
});

fixture = TestBed.createComponent(EditComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

beforeAll(() => {
window.onbeforeunload = jasmine.createSpy();
});

it('should create', () => {
expect(component).toBeTruthy();
});
Expand Down
17 changes: 11 additions & 6 deletions src/app/pages/talk/talk.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,22 @@ describe('TalkComponent', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [TalkComponent],
providers: [
{ provide: ActivatedRoute, useValue: MockActivatedRoute },
{ provide: CodeService, useValue: MockCodeService },
]
});
imports: [TalkComponent],
providers: [
{ provide: ActivatedRoute, useValue: MockActivatedRoute },
{ provide: CodeService, useValue: MockCodeService },
]
});

fixture = TestBed.createComponent(TalkComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

beforeAll(() => {
window.onbeforeunload = jasmine.createSpy();
});

it('should create', () => {
expect(component).toBeTruthy();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ describe('AddSlideModalComponent', () => {
fixture.detectChanges();
});

beforeAll(() => {
window.onbeforeunload = jasmine.createSpy();
});

it('should create', () => {
expect(component).toBeTruthy();
});
Expand Down
4 changes: 4 additions & 0 deletions src/app/shared/add-slide/add-slide.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ describe('AddSlideComponent', () => {
fixture.detectChanges();
});

beforeAll(() => {
window.onbeforeunload = jasmine.createSpy();
});

it('should create', () => {
expect(component).toBeTruthy();
});
Expand Down
4 changes: 4 additions & 0 deletions src/app/shared/edit-buttons/edit-buttons.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ describe('EditButtonsComponent', () => {
fixture.detectChanges();
});

beforeAll(() => {
window.onbeforeunload = jasmine.createSpy();
});

it('should create', () => {
expect(component).toBeTruthy();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ describe('EditNotesDialogComponent', () => {
fixture.detectChanges();
});

beforeAll(() => {
window.onbeforeunload = jasmine.createSpy();
});

it('should create', () => {
expect(component).toBeTruthy();
});
Expand Down
4 changes: 4 additions & 0 deletions src/app/shared/row-buttons/row-buttons.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ describe('RowButtonsComponent', () => {
fixture.detectChanges();
});

beforeAll(() => {
window.onbeforeunload = jasmine.createSpy();
});

it('should create', () => {
expect(component).toBeTruthy();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ describe('CeDisplayComponent', () => {
fixture.detectChanges();
});

beforeAll(() => {
window.onbeforeunload = jasmine.createSpy();
});

it('should create', () => {
expect(component).toBeTruthy();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ describe('CeEditorComponent', () => {
fixture.detectChanges();
});

beforeAll(() => {
window.onbeforeunload = jasmine.createSpy();
});

it('should create', () => {
expect(component).toBeTruthy();
});
Expand Down
31 changes: 18 additions & 13 deletions src/app/slides/code-editor/code-editor.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,29 @@ describe('CodeEditorComponent', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [
CodeEditorComponent,
MockCeDisplayComponent,
MockCeEditorComponent,

MatDialogModule,
],
providers: [
{ provide: ActivatedRoute, useValue: MockActivatedRoute },
{ provide: CodeService, useValue: MockCodeService },
{ provide: NU_MONACO_EDITOR_CONFIG, useValue: {} },
]
});
imports: [
CodeEditorComponent,
MockCeDisplayComponent,
MockCeEditorComponent,

MatDialogModule,
],
providers: [
{ provide: ActivatedRoute, useValue: MockActivatedRoute },
{ provide: CodeService, useValue: MockCodeService },
{ provide: NU_MONACO_EDITOR_CONFIG, useValue: {} },
]
});

fixture = TestBed.createComponent(CodeEditorComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

beforeAll(() => {
window.onbeforeunload = jasmine.createSpy();
});

it('should create', () => {
expect(component).toBeTruthy();
});
Expand Down
15 changes: 10 additions & 5 deletions src/app/slides/cover-01/cover.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,21 @@ describe('Cover01Component', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [Cover01Component],
providers: [
{ provide: ActivatedRoute, useValue: MockActivatedRoute },
]
});
imports: [Cover01Component],
providers: [
{ provide: ActivatedRoute, useValue: MockActivatedRoute },
]
});

fixture = TestBed.createComponent(Cover01Component);
component = fixture.componentInstance;
fixture.detectChanges();
});

beforeAll(() => {
window.onbeforeunload = jasmine.createSpy();
});

it('should create', () => {
expect(component).toBeTruthy();
});
Expand Down
15 changes: 10 additions & 5 deletions src/app/slides/image-only/image-only.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,21 @@ describe('ImageOnlyComponent', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [ImageOnlyComponent],
providers: [
{ provide: ActivatedRoute, useValue: MockActivatedRoute },
]
});
imports: [ImageOnlyComponent],
providers: [
{ provide: ActivatedRoute, useValue: MockActivatedRoute },
]
});

fixture = TestBed.createComponent(ImageOnlyComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

beforeAll(() => {
window.onbeforeunload = jasmine.createSpy();
});

it('should create', () => {
expect(component).toBeTruthy();
});
Expand Down
15 changes: 10 additions & 5 deletions src/app/slides/image-text/image-text.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,21 @@ describe('ImageTextComponent', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [ImageTextComponent],
providers: [
{ provide: ActivatedRoute, useValue: MockActivatedRoute },
]
});
imports: [ImageTextComponent],
providers: [
{ provide: ActivatedRoute, useValue: MockActivatedRoute },
]
});

fixture = TestBed.createComponent(ImageTextComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

beforeAll(() => {
window.onbeforeunload = jasmine.createSpy();
});

it('should create', () => {
expect(component).toBeTruthy();
});
Expand Down
15 changes: 10 additions & 5 deletions src/app/slides/panel-double/panel-double.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,21 @@ describe('PanelDoubleComponent', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [PanelDoubleComponent],
providers: [
{ provide: ActivatedRoute, useValue: MockActivatedRoute },
]
});
imports: [PanelDoubleComponent],
providers: [
{ provide: ActivatedRoute, useValue: MockActivatedRoute },
]
});

fixture = TestBed.createComponent(PanelDoubleComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

beforeAll(() => {
window.onbeforeunload = jasmine.createSpy();
});

it('should create', () => {
expect(component).toBeTruthy();
});
Expand Down
15 changes: 10 additions & 5 deletions src/app/slides/panel-single/panel-single.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,21 @@ describe('PanelSingleComponent', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [PanelSingleComponent],
providers: [
{ provide: ActivatedRoute, useValue: MockActivatedRoute },
]
});
imports: [PanelSingleComponent],
providers: [
{ provide: ActivatedRoute, useValue: MockActivatedRoute },
]
});

fixture = TestBed.createComponent(PanelSingleComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

beforeAll(() => {
window.onbeforeunload = jasmine.createSpy();
});

it('should create', () => {
expect(component).toBeTruthy();
});
Expand Down
4 changes: 4 additions & 0 deletions src/app/slides/panel-triple/panel-triple.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ describe('PanelTripleComponent', () => {
fixture.detectChanges();
});

beforeAll(() => {
window.onbeforeunload = jasmine.createSpy();
});

it('should create', () => {
expect(component).toBeTruthy();
});
Expand Down

0 comments on commit d8bce32

Please sign in to comment.