From 866bfc61ba1e2949a55a1ea829956a064de6e5ed Mon Sep 17 00:00:00 2001 From: Cory Rivera Date: Thu, 12 Dec 2019 14:59:56 -0800 Subject: [PATCH] Add more unit tests for NotebookInput (#8654) --- .../contrib/notebook/test/browser/common.ts | 60 ---- .../test/browser/notebookActions.test.ts | 2 +- .../test/browser/notebookInput.test.ts | 174 ++++++++++++ .../test/electron-browser/cell.test.ts | 2 +- .../electron-browser/clientSession.test.ts | 2 +- .../electron-browser/notebookModel.test.ts | 2 +- .../electron-browser/notebookUtils.test.ts | 2 +- .../{electron-browser/common.ts => stubs.ts} | 265 ++++++++++++++++-- 8 files changed, 419 insertions(+), 90 deletions(-) delete mode 100644 src/sql/workbench/contrib/notebook/test/browser/common.ts create mode 100644 src/sql/workbench/contrib/notebook/test/browser/notebookInput.test.ts rename src/sql/workbench/contrib/notebook/test/{electron-browser/common.ts => stubs.ts} (58%) diff --git a/src/sql/workbench/contrib/notebook/test/browser/common.ts b/src/sql/workbench/contrib/notebook/test/browser/common.ts deleted file mode 100644 index 194f535e91..0000000000 --- a/src/sql/workbench/contrib/notebook/test/browser/common.ts +++ /dev/null @@ -1,60 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the Source EULA. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import { INotebookEditor, INotebookSection, INotebookParams } from 'sql/workbench/services/notebook/browser/notebookService'; -import { ICellModel, INotebookModel } from 'sql/workbench/contrib/notebook/browser/models/modelInterfaces'; -import { ISingleNotebookEditOperation } from 'sql/workbench/api/common/sqlExtHostTypes'; -import { CellType } from 'sql/workbench/contrib/notebook/common/models/contracts'; - -export class NotebookComponentStub implements INotebookEditor { - get notebookParams(): INotebookParams { - throw new Error('Method not implemented.'); - } - get id(): string { - throw new Error('Method not implemented.'); - } - get cells(): ICellModel[] { - throw new Error('Method not implemented.'); - } - get modelReady(): Promise { - throw new Error('Method not implemented.'); - } - get model(): INotebookModel { - throw new Error('Method not implemented.'); - } - isDirty(): boolean { - throw new Error('Method not implemented.'); - } - isActive(): boolean { - throw new Error('Method not implemented.'); - } - isVisible(): boolean { - throw new Error('Method not implemented.'); - } - executeEdits(edits: ISingleNotebookEditOperation[]): boolean { - throw new Error('Method not implemented.'); - } - runCell(cell: ICellModel): Promise { - throw new Error('Method not implemented.'); - } - runAllCells(startCell?: ICellModel, endCell?: ICellModel): Promise { - throw new Error('Method not implemented.'); - } - clearOutput(cell: ICellModel): Promise { - throw new Error('Method not implemented.'); - } - clearAllOutputs(): Promise { - throw new Error('Method not implemented.'); - } - getSections(): INotebookSection[] { - throw new Error('Method not implemented.'); - } - navigateToSection(sectionId: string): void { - throw new Error('Method not implemented.'); - } - addCell(cellType: CellType, index?: number, event?: Event) { - throw new Error('Method not implemented.'); - } -} diff --git a/src/sql/workbench/contrib/notebook/test/browser/notebookActions.test.ts b/src/sql/workbench/contrib/notebook/test/browser/notebookActions.test.ts index 0769fbd68d..10b0b787bb 100644 --- a/src/sql/workbench/contrib/notebook/test/browser/notebookActions.test.ts +++ b/src/sql/workbench/contrib/notebook/test/browser/notebookActions.test.ts @@ -9,12 +9,12 @@ import * as assert from 'assert'; import { AddCellAction, ClearAllOutputsAction, CollapseCellsAction, TrustedAction, RunAllCellsAction, NewNotebookAction } from 'sql/workbench/contrib/notebook/browser/notebookActions'; import { CellType } from 'sql/workbench/contrib/notebook/common/models/contracts'; import { INotebookEditor } from 'sql/workbench/services/notebook/browser/notebookService'; -import { NotebookComponentStub } from 'sql/workbench/contrib/notebook/test/browser/common'; import { ICellModel, INotebookModel } from 'sql/workbench/contrib/notebook/browser/models/modelInterfaces'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { TestCommandService } from 'vs/editor/test/browser/editorTestServices'; +import { NotebookComponentStub } from 'sql/workbench/contrib/notebook/test/stubs'; suite('Notebook Actions', function (): void { test('Add Cell Action', async function (): Promise { diff --git a/src/sql/workbench/contrib/notebook/test/browser/notebookInput.test.ts b/src/sql/workbench/contrib/notebook/test/browser/notebookInput.test.ts new file mode 100644 index 0000000000..bf7cfad3fe --- /dev/null +++ b/src/sql/workbench/contrib/notebook/test/browser/notebookInput.test.ts @@ -0,0 +1,174 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as TypeMoq from 'typemoq'; +import * as assert from 'assert'; +import { nb } from 'azdata'; +import { workbenchInstantiationService } from 'vs/workbench/test/workbenchTestServices'; +import { Schemas } from 'vs/base/common/network'; +import { URI } from 'vs/base/common/uri'; +import { UntitledNotebookInput } from 'sql/workbench/contrib/notebook/common/models/untitledNotebookInput'; +import { FileNotebookInput } from 'sql/workbench/contrib/notebook/common/models/fileNotebookInput'; +import { IConnectionProfile } from 'sql/platform/connection/common/interfaces'; +import { UntitledTextEditorModel } from 'vs/workbench/common/editor/untitledTextEditorModel'; +import { NodeStub, NotebookServiceStub } from 'sql/workbench/contrib/notebook/test/stubs'; +import { basenameOrAuthority } from 'vs/base/common/resources'; +import { UntitledTextEditorInput } from 'vs/workbench/common/editor/untitledTextEditorInput'; +import { SimpleUriLabelService } from 'vs/editor/standalone/browser/simpleServices'; +import { IExtensionService, NullExtensionService } from 'vs/workbench/services/extensions/common/extensions'; +import { INotebookService, IProviderInfo } from 'sql/workbench/services/notebook/browser/notebookService'; + +suite('Notebook Input', function (): void { + const instantiationService = workbenchInstantiationService(); + + const testTitle = 'TestTitle'; + const testProvider = 'TestProvider'; + const untitledUri = URI.from({ scheme: Schemas.untitled, path: 'TestPath' }); + + const mockExtensionService = TypeMoq.Mock.ofType(NullExtensionService); + mockExtensionService.setup(s => s.whenInstalledExtensionsRegistered()).returns(() => Promise.resolve(true)); + + const mockNotebookService = TypeMoq.Mock.ofType(NotebookServiceStub); + mockNotebookService.setup(s => s.getProvidersForFileType(TypeMoq.It.isAny())).returns(() => [testProvider]); + mockNotebookService.setup(s => s.getStandardKernelsForProvider(TypeMoq.It.isAny())).returns(() => { + return [{ + name: 'TestName', + displayName: 'TestDisplayName', + connectionProviderIds: ['TestId'], + notebookProvider: 'TestProvider' + }]; + }); + + let untitledTextInput: UntitledTextEditorInput; + let untitledNotebookInput: UntitledNotebookInput; + + setup(() => { + untitledTextInput = new UntitledTextEditorInput(untitledUri, false, '', '', '', instantiationService, undefined, new SimpleUriLabelService(), undefined, undefined, undefined); + untitledNotebookInput = new UntitledNotebookInput( + testTitle, untitledUri, untitledTextInput, + undefined, instantiationService, mockNotebookService.object, mockExtensionService.object); + }); + + test('File Notebook Input', async function (): Promise { + let fileUri = URI.from({ scheme: Schemas.file, path: 'TestPath' }); + let fileNotebookInput = new FileNotebookInput( + testTitle, fileUri, undefined, + undefined, instantiationService, mockNotebookService.object, mockExtensionService.object); + + let inputId = fileNotebookInput.getTypeId(); + assert.strictEqual(inputId, FileNotebookInput.ID); + assert.strictEqual(fileNotebookInput.isUntitled(), false, 'File Input should not be untitled'); + }); + + test('Untitled Notebook Input', async function (): Promise { + let inputId = untitledNotebookInput.getTypeId(); + assert.strictEqual(inputId, UntitledNotebookInput.ID); + assert.ok(untitledNotebookInput.isUntitled(), 'Untitled Input should be untitled'); + }); + + test('Getters and Setters', async function (): Promise { + // Input title + assert.strictEqual(untitledNotebookInput.getTitle(), testTitle); + + let noTitleInput = instantiationService.createInstance(UntitledNotebookInput, undefined, untitledUri, undefined); + assert.strictEqual(noTitleInput.getTitle(), basenameOrAuthority(untitledUri)); + + // Text Input + assert.strictEqual(untitledNotebookInput.textInput, untitledTextInput); + + // Notebook URI + assert.deepStrictEqual(untitledNotebookInput.notebookUri, untitledUri); + + // Content Manager + assert.notStrictEqual(untitledNotebookInput.editorOpenedTimestamp, undefined); + + // Notebook editor timestamp + assert.notStrictEqual(untitledNotebookInput.contentManager, undefined); + + // Layout changed event + assert.notStrictEqual(untitledNotebookInput.layoutChanged, undefined); + + // Connection Profile + let testProfile = {}; + untitledNotebookInput.connectionProfile = testProfile; + assert.strictEqual(untitledNotebookInput.connectionProfile, testProfile); + + // Default Kernel + let testDefaultKernel: nb.IKernelSpec = { + name: 'TestName', + language: 'TestLanguage', + display_name: 'TestDisplayName' + }; + untitledNotebookInput.defaultKernel = testDefaultKernel; + assert.strictEqual(untitledNotebookInput.defaultKernel, testDefaultKernel); + + // Untitled Editor Model + let testModel = {}; + untitledNotebookInput.untitledEditorModel = testModel; + assert.strictEqual(untitledNotebookInput.untitledEditorModel, testModel); + + // getResource + assert.strictEqual(untitledNotebookInput.getResource(), untitledUri); + + // Standard kernels + let testKernels = [{ + name: 'TestName1', + displayName: 'TestDisplayName1', + connectionProviderIds: ['TestId1'], + notebookProvider: 'TestProvider' + }, { + name: 'TestName2', + displayName: 'TestDisplayName2', + connectionProviderIds: ['TestId2'], + notebookProvider: 'TestProvider' + }]; + untitledNotebookInput.standardKernels = testKernels; + assert.deepStrictEqual(untitledNotebookInput.standardKernels, testKernels); + + // Provider Info + let provider = await untitledNotebookInput.getProviderInfo(); + assert.deepStrictEqual(provider, { + providerId: testProvider, + providers: [testProvider] + }); + }); + + test('Parent container', async function (): Promise { + // Undefined container + let testContainer = undefined; + untitledNotebookInput.container = testContainer; + assert.strictEqual(untitledNotebookInput.container, testContainer); + + // Dispose old container when setting new one + let removedContainer: HTMLElement; + let mockParentNode = TypeMoq.Mock.ofType(NodeStub); + mockParentNode.setup(e => e.removeChild(TypeMoq.It.isAny())).returns(oldChild => { + removedContainer = oldChild; + return oldChild; + }); + testContainer = { parentNode: mockParentNode.object }; + untitledNotebookInput.container = testContainer; + assert.strictEqual(untitledNotebookInput.container, testContainer); + + let oldContainer = testContainer; + testContainer = {}; + untitledNotebookInput.container = testContainer; + assert.strictEqual(untitledNotebookInput.container, testContainer); + mockParentNode.verify(e => e.removeChild(TypeMoq.It.isAny()), TypeMoq.Times.once()); + assert.strictEqual(removedContainer, oldContainer); + }); + + test('Matches other input', async function (): Promise { + assert.strictEqual(untitledNotebookInput.matches(undefined), false, 'Input should not match undefined.'); + + assert.ok(untitledNotebookInput.matches(untitledNotebookInput), 'Input should match itself.'); + + let otherTestUri = URI.from({ scheme: Schemas.untitled, path: 'OtherTestPath' }); + let otherTextInput = new UntitledTextEditorInput(otherTestUri, false, '', '', '', instantiationService, undefined, new SimpleUriLabelService(), undefined, undefined, undefined); + let otherInput = instantiationService.createInstance(UntitledNotebookInput, 'OtherTestInput', otherTestUri, otherTextInput); + + assert.strictEqual(untitledNotebookInput.matches(otherInput), false, 'Input should not match different input.'); + }); +}); diff --git a/src/sql/workbench/contrib/notebook/test/electron-browser/cell.test.ts b/src/sql/workbench/contrib/notebook/test/electron-browser/cell.test.ts index 1caea8e046..8cf3563531 100644 --- a/src/sql/workbench/contrib/notebook/test/electron-browser/cell.test.ts +++ b/src/sql/workbench/contrib/notebook/test/electron-browser/cell.test.ts @@ -11,7 +11,7 @@ import * as objects from 'vs/base/common/objects'; import { CellTypes } from 'sql/workbench/contrib/notebook/common/models/contracts'; import { ModelFactory } from 'sql/workbench/contrib/notebook/browser/models/modelFactory'; -import { NotebookModelStub, ClientSessionStub, KernelStub, FutureStub } from './common'; +import { NotebookModelStub, ClientSessionStub, KernelStub, FutureStub } from 'sql/workbench/contrib/notebook/test/stubs'; import { EmptyFuture } from 'sql/workbench/services/notebook/browser/sessionManager'; import { ICellModel, ICellModelOptions, IClientSession, INotebookModel } from 'sql/workbench/contrib/notebook/browser/models/modelInterfaces'; import { Deferred } from 'sql/base/common/promise'; diff --git a/src/sql/workbench/contrib/notebook/test/electron-browser/clientSession.test.ts b/src/sql/workbench/contrib/notebook/test/electron-browser/clientSession.test.ts index 280b2ef40d..d797146329 100644 --- a/src/sql/workbench/contrib/notebook/test/electron-browser/clientSession.test.ts +++ b/src/sql/workbench/contrib/notebook/test/electron-browser/clientSession.test.ts @@ -13,7 +13,7 @@ import { URI } from 'vs/base/common/uri'; import { ClientSession } from 'sql/workbench/contrib/notebook/browser/models/clientSession'; import { SessionManager } from 'sql/workbench/services/notebook/browser/sessionManager'; -import { NotebookManagerStub, ServerManagerStub } from './common'; +import { NotebookManagerStub, ServerManagerStub } from 'sql/workbench/contrib/notebook/test/stubs'; import { isUndefinedOrNull } from 'vs/base/common/types'; suite('Client Session', function (): void { diff --git a/src/sql/workbench/contrib/notebook/test/electron-browser/notebookModel.test.ts b/src/sql/workbench/contrib/notebook/test/electron-browser/notebookModel.test.ts index dedca90579..17d6ec7d7d 100644 --- a/src/sql/workbench/contrib/notebook/test/electron-browser/notebookModel.test.ts +++ b/src/sql/workbench/contrib/notebook/test/electron-browser/notebookModel.test.ts @@ -12,7 +12,7 @@ import { TestNotificationService } from 'vs/platform/notification/test/common/te import { URI } from 'vs/base/common/uri'; import { LocalContentManager } from 'sql/workbench/services/notebook/common/localContentManager'; -import { NotebookManagerStub } from './common'; +import { NotebookManagerStub } from 'sql/workbench/contrib/notebook/test/stubs'; import { NotebookModel } from 'sql/workbench/contrib/notebook/browser/models/notebookModel'; import { ModelFactory } from 'sql/workbench/contrib/notebook/browser/models/modelFactory'; import { IClientSession, INotebookModelOptions, NotebookContentChange } from 'sql/workbench/contrib/notebook/browser/models/modelInterfaces'; diff --git a/src/sql/workbench/contrib/notebook/test/electron-browser/notebookUtils.test.ts b/src/sql/workbench/contrib/notebook/test/electron-browser/notebookUtils.test.ts index 1252605ba9..11c4516bec 100644 --- a/src/sql/workbench/contrib/notebook/test/electron-browser/notebookUtils.test.ts +++ b/src/sql/workbench/contrib/notebook/test/electron-browser/notebookUtils.test.ts @@ -9,7 +9,7 @@ import * as TypeMoq from 'typemoq'; import { nb, ServerInfo } from 'azdata'; import { tryMatchCellMagic, getHostAndPortFromEndpoint, isStream, getProvidersForFileName, asyncForEach, clusterEndpointsProperty, getClusterEndpoints, RawEndpoint, IEndpoint, getStandardKernelsForProvider, IStandardKernelWithProvider } from 'sql/workbench/contrib/notebook/browser/models/notebookUtils'; import { INotebookService, DEFAULT_NOTEBOOK_FILETYPE, DEFAULT_NOTEBOOK_PROVIDER } from 'sql/workbench/services/notebook/browser/notebookService'; -import { NotebookServiceStub } from 'sql/workbench/contrib/notebook/test/electron-browser/common'; +import { NotebookServiceStub } from 'sql/workbench/contrib/notebook/test/stubs'; suite('notebookUtils', function (): void { const mockNotebookService = TypeMoq.Mock.ofType(NotebookServiceStub); diff --git a/src/sql/workbench/contrib/notebook/test/electron-browser/common.ts b/src/sql/workbench/contrib/notebook/test/stubs.ts similarity index 58% rename from src/sql/workbench/contrib/notebook/test/electron-browser/common.ts rename to src/sql/workbench/contrib/notebook/test/stubs.ts index cdc9b18779..40b1db72e7 100644 --- a/src/sql/workbench/contrib/notebook/test/electron-browser/common.ts +++ b/src/sql/workbench/contrib/notebook/test/stubs.ts @@ -5,13 +5,13 @@ import { nb, IConnectionProfile } from 'azdata'; -import { Event, Emitter } from 'vs/base/common/event'; +import * as vsEvent from 'vs/base/common/event'; import { INotebookModel, ICellModel, IClientSession, NotebookContentChange, IKernelPreference } from 'sql/workbench/contrib/notebook/browser/models/modelInterfaces'; import { NotebookChangeType, CellType } from 'sql/workbench/contrib/notebook/common/models/contracts'; -import { INotebookManager, INotebookService, INotebookEditor, ILanguageMagic, INotebookProvider, INavigationProvider } from 'sql/workbench/services/notebook/browser/notebookService'; +import { INotebookManager, INotebookService, INotebookEditor, ILanguageMagic, INotebookProvider, INavigationProvider, INotebookParams, INotebookSection } from 'sql/workbench/services/notebook/browser/notebookService'; import { ISingleNotebookEditOperation } from 'sql/workbench/api/common/sqlExtHostTypes'; import { IStandardKernelWithProvider } from 'sql/workbench/contrib/notebook/browser/models/notebookUtils'; -import { URI } from 'vs/workbench/workbench.web.api'; +import { URI, Emitter } from 'vs/workbench/workbench.web.api'; import { RenderMimeRegistry } from 'sql/workbench/contrib/notebook/browser/outputs/registry'; import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile'; @@ -40,25 +40,25 @@ export class NotebookModelStub implements INotebookModel { get notebookManagers(): INotebookManager[] { throw new Error('method not implemented.'); } - get kernelChanged(): Event { + get kernelChanged(): vsEvent.Event { throw new Error('method not implemented.'); } - get kernelsChanged(): Event { + get kernelsChanged(): vsEvent.Event { throw new Error('method not implemented.'); } - get layoutChanged(): Event { + get layoutChanged(): vsEvent.Event { throw new Error('method not implemented.'); } get defaultKernel(): nb.IKernelSpec { throw new Error('method not implemented.'); } - get contextsChanged(): Event { + get contextsChanged(): vsEvent.Event { throw new Error('method not implemented.'); } - get contextsLoading(): Event { + get contextsLoading(): vsEvent.Event { throw new Error('method not implemented.'); } - get contentChanged(): Event { + get contentChanged(): vsEvent.Event { throw new Error('method not implemented.'); } get specs(): nb.IAllKernels { @@ -97,10 +97,10 @@ export class NotebookModelStub implements INotebookModel { getApplicableConnectionProviderIds(kernelName: string): string[] { throw new Error('Method not implemented.'); } - get onValidConnectionSelected(): Event { + get onValidConnectionSelected(): vsEvent.Event { throw new Error('method not implemented.'); } - get onProviderIdChange(): Event { + get onProviderIdChange(): vsEvent.Event { throw new Error('method not impelemented.'); } toJSON(): nb.INotebookContents { @@ -109,7 +109,7 @@ export class NotebookModelStub implements INotebookModel { serializationStateChanged(changeType: NotebookChangeType): void { throw new Error('Method not implemented.'); } - get onActiveCellChanged(): Event { + get onActiveCellChanged(): vsEvent.Event { throw new Error('Method not implemented.'); } updateActiveCell(cell: ICellModel) { @@ -129,7 +129,7 @@ export class NotebookManagerStub implements INotebookManager { export class ServerManagerStub implements nb.ServerManager { onServerStartedEmitter = new Emitter(); - onServerStarted: Event = this.onServerStartedEmitter.event; + onServerStarted: vsEvent.Event = this.onServerStartedEmitter.event; isStarted: boolean = false; calledStart: boolean = false; calledEnd: boolean = false; @@ -147,12 +147,24 @@ export class ServerManagerStub implements nb.ServerManager { export class NotebookServiceStub implements INotebookService { _serviceBrand: undefined; - onNotebookEditorAdd: Event; - onNotebookEditorRemove: Event; - onNotebookEditorRename: Event; - isRegistrationComplete: boolean; - registrationComplete: Promise; - languageMagics: ILanguageMagic[]; + get onNotebookEditorAdd(): vsEvent.Event { + throw new Error('Method not implemented.'); + } + get onNotebookEditorRemove(): vsEvent.Event { + throw new Error('Method not implemented.'); + } + get onNotebookEditorRename(): vsEvent.Event { + throw new Error('Method not implemented.'); + } + get isRegistrationComplete(): boolean { + throw new Error('Method not implemented.'); + } + get registrationComplete(): Promise { + throw new Error('Method not implemented.'); + } + get languageMagics(): ILanguageMagic[] { + throw new Error('Method not implemented.'); + } registerProvider(providerId: string, provider: INotebookProvider): void { throw new Error('Method not implemented.'); } @@ -243,22 +255,22 @@ export class ClientSessionStub implements IClientSession { dispose(): void { throw new Error('Method not implemented.'); } - get terminated(): Event { + get terminated(): vsEvent.Event { throw new Error('Method not implemented.'); } - get kernelChanged(): Event { + get kernelChanged(): vsEvent.Event { throw new Error('Method not implemented.'); } - get statusChanged(): Event { + get statusChanged(): vsEvent.Event { throw new Error('Method not implemented.'); } - get iopubMessage(): Event { + get iopubMessage(): vsEvent.Event { throw new Error('Method not implemented.'); } - get unhandledMessage(): Event { + get unhandledMessage(): vsEvent.Event { throw new Error('Method not implemented.'); } - get propertyChanged(): Event<'path' | 'name' | 'type'> { + get propertyChanged(): vsEvent.Event<'path' | 'name' | 'type'> { throw new Error('Method not implemented.'); } get kernel(): nb.IKernel | null { @@ -372,3 +384,206 @@ export class FutureStub implements nb.IFuture { return; } } + +export class NotebookComponentStub implements INotebookEditor { + get notebookParams(): INotebookParams { + throw new Error('Method not implemented.'); + } + get id(): string { + throw new Error('Method not implemented.'); + } + get cells(): ICellModel[] { + throw new Error('Method not implemented.'); + } + get modelReady(): Promise { + throw new Error('Method not implemented.'); + } + get model(): INotebookModel { + throw new Error('Method not implemented.'); + } + isDirty(): boolean { + throw new Error('Method not implemented.'); + } + isActive(): boolean { + throw new Error('Method not implemented.'); + } + isVisible(): boolean { + throw new Error('Method not implemented.'); + } + executeEdits(edits: ISingleNotebookEditOperation[]): boolean { + throw new Error('Method not implemented.'); + } + runCell(cell: ICellModel): Promise { + throw new Error('Method not implemented.'); + } + runAllCells(startCell?: ICellModel, endCell?: ICellModel): Promise { + throw new Error('Method not implemented.'); + } + clearOutput(cell: ICellModel): Promise { + throw new Error('Method not implemented.'); + } + clearAllOutputs(): Promise { + throw new Error('Method not implemented.'); + } + getSections(): INotebookSection[] { + throw new Error('Method not implemented.'); + } + navigateToSection(sectionId: string): void { + throw new Error('Method not implemented.'); + } + addCell(cellType: CellType, index?: number, event?: Event) { + throw new Error('Method not implemented.'); + } +} + +export class NodeStub implements Node { + get baseURI(): string { + throw new Error('Method not implemented.'); + } + get childNodes(): NodeListOf { + throw new Error('Method not implemented.'); + } + get firstChild(): ChildNode { + throw new Error('Method not implemented.'); + } + get isConnected(): boolean { + throw new Error('Method not implemented.'); + } + get lastChild(): ChildNode { + throw new Error('Method not implemented.'); + } + get namespaceURI(): string { + throw new Error('Method not implemented.'); + } + get nextSibling(): ChildNode { + throw new Error('Method not implemented.'); + } + get nodeName(): string { + throw new Error('Method not implemented.'); + } + get nodeType(): number { + throw new Error('Method not implemented.'); + } + get ownerDocument(): Document { + throw new Error('Method not implemented.'); + } + get parentElement(): HTMLElement { + throw new Error('Method not implemented.'); + } + get parentNode(): Node & ParentNode { + throw new Error('Method not implemented.'); + } + get previousSibling(): Node { + throw new Error('Method not implemented.'); + } + nodeValue: string; + textContent: string; + appendChild(newChild: T): T { + throw new Error('Method not implemented.'); + } + cloneNode(deep?: boolean): Node { + throw new Error('Method not implemented.'); + } + compareDocumentPosition(other: Node): number { + throw new Error('Method not implemented.'); + } + contains(other: Node): boolean { + throw new Error('Method not implemented.'); + } + getRootNode(options?: GetRootNodeOptions): Node { + throw new Error('Method not implemented.'); + } + hasChildNodes(): boolean { + throw new Error('Method not implemented.'); + } + insertBefore(newChild: T, refChild: Node): T { + throw new Error('Method not implemented.'); + } + isDefaultNamespace(namespace: string): boolean { + throw new Error('Method not implemented.'); + } + isEqualNode(otherNode: Node): boolean { + throw new Error('Method not implemented.'); + } + isSameNode(otherNode: Node): boolean { + throw new Error('Method not implemented.'); + } + lookupNamespaceURI(prefix: string): string { + throw new Error('Method not implemented.'); + } + lookupPrefix(namespace: string): string { + throw new Error('Method not implemented.'); + } + normalize(): void { + throw new Error('Method not implemented.'); + } + removeChild(oldChild: T): T { + throw new Error('Method not implemented.'); + } + replaceChild(newChild: Node, oldChild: T): T { + throw new Error('Method not implemented.'); + } + get ATTRIBUTE_NODE(): number { + throw new Error('Method not implemented.'); + } + get CDATA_SECTION_NODE(): number { + throw new Error('Method not implemented.'); + } + get COMMENT_NODE(): number { + throw new Error('Method not implemented.'); + } + get DOCUMENT_FRAGMENT_NODE(): number { + throw new Error('Method not implemented.'); + } + get DOCUMENT_NODE(): number { + throw new Error('Method not implemented.'); + } + get DOCUMENT_POSITION_CONTAINED_BY(): number { + throw new Error('Method not implemented.'); + } + get DOCUMENT_POSITION_CONTAINS(): number { + throw new Error('Method not implemented.'); + } + get DOCUMENT_POSITION_DISCONNECTED(): number { + throw new Error('Method not implemented.'); + } + get DOCUMENT_POSITION_FOLLOWING(): number { + throw new Error('Method not implemented.'); + } + get DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC(): number { + throw new Error('Method not implemented.'); + } + get DOCUMENT_POSITION_PRECEDING(): number { + throw new Error('Method not implemented.'); + } + get DOCUMENT_TYPE_NODE(): number { + throw new Error('Method not implemented.'); + } + get ELEMENT_NODE(): number { + throw new Error('Method not implemented.'); + } + get ENTITY_NODE(): number { + throw new Error('Method not implemented.'); + } + get ENTITY_REFERENCE_NODE(): number { + throw new Error('Method not implemented.'); + } + get NOTATION_NODE(): number { + throw new Error('Method not implemented.'); + } + get PROCESSING_INSTRUCTION_NODE(): number { + throw new Error('Method not implemented.'); + } + get TEXT_NODE(): number { + throw new Error('Method not implemented.'); + } + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void { + throw new Error('Method not implemented.'); + } + dispatchEvent(event: Event): boolean { + throw new Error('Method not implemented.'); + } + removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void { + throw new Error('Method not implemented.'); + } +}