From c709ed1d4d00ea05a340edb501db2fa14e17b0d6 Mon Sep 17 00:00:00 2001 From: Geoffrey Kwan Date: Tue, 6 Dec 2022 15:21:19 -0500 Subject: [PATCH] fix(Outside URL): Fix tests that broke from previous commit --- .../wise5/components/outsideURL/OutsideUrlContent.ts | 7 +++++++ .../outside-url-student.component.spec.ts | 8 +++++--- 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 src/assets/wise5/components/outsideURL/OutsideUrlContent.ts diff --git a/src/assets/wise5/components/outsideURL/OutsideUrlContent.ts b/src/assets/wise5/components/outsideURL/OutsideUrlContent.ts new file mode 100644 index 00000000000..199ab447f16 --- /dev/null +++ b/src/assets/wise5/components/outsideURL/OutsideUrlContent.ts @@ -0,0 +1,7 @@ +import { ComponentContent } from '../../common/ComponentContent'; + +export interface OutsideUrlContent extends ComponentContent { + height: number; + url: string; + width: number; +} diff --git a/src/assets/wise5/components/outsideURL/outside-url-student/outside-url-student.component.spec.ts b/src/assets/wise5/components/outsideURL/outside-url-student/outside-url-student.component.spec.ts index 2c74cee6b0e..76e640be82e 100644 --- a/src/assets/wise5/components/outsideURL/outside-url-student/outside-url-student.component.spec.ts +++ b/src/assets/wise5/components/outsideURL/outside-url-student/outside-url-student.component.spec.ts @@ -7,8 +7,10 @@ import { MatIconModule } from '@angular/material/icon'; import { BrowserModule } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { StudentTeacherCommonServicesModule } from '../../../../../app/student-teacher-common-services.module'; +import { Component } from '../../../common/Component'; import { ProjectService } from '../../../services/projectService'; import { OutsideUrlStudent } from './outside-url-student.component'; +import { OutsideUrlContent } from '../OutsideUrlContent'; let component: OutsideUrlStudent; const componentId = 'component1'; @@ -35,13 +37,13 @@ describe('OutsideUrlStudentComponent', () => { spyOn(TestBed.inject(ProjectService), 'isSpaceExists').and.returnValue(false); spyOn(TestBed.inject(ProjectService), 'getThemeSettings').and.returnValue({}); component = fixture.componentInstance; - component.nodeId = nodeId; - component.componentContent = { + const componentContent = { id: componentId, height: 600, width: 800, url: 'https://www.berkeley.edu' - }; + } as OutsideUrlContent; + component.component = new Component(componentContent, nodeId); spyOn(component, 'subscribeToSubscriptions').and.callFake(() => {}); spyOn(component, 'broadcastDoneRenderingComponent').and.callFake(() => {}); spyOn(component, 'isAddToNotebookEnabled').and.callFake(() => {