From fca2344c2edce2c561b34b130504adae7a74ea73 Mon Sep 17 00:00:00 2001 From: Chris LaFreniere <40371649+chlafreniere@users.noreply.github.com> Date: Tue, 7 Apr 2020 20:09:52 -0700 Subject: [PATCH] Remove old CTP code, add test (#9877) --- .../electron-browser/notebookUtils.test.ts | 14 ++++++++++++- .../services/notebook/browser/models/cell.ts | 21 +++---------------- .../notebook/browser/models/notebookUtils.ts | 13 ++++++++++++ 3 files changed, 29 insertions(+), 19 deletions(-) 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 d2e1364a39..c206162048 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 @@ -7,7 +7,7 @@ import * as assert from 'assert'; import * as TypeMoq from 'typemoq'; import { nb, ServerInfo } from 'azdata'; -import { getHostAndPortFromEndpoint, isStream, getProvidersForFileName, asyncForEach, clusterEndpointsProperty, getClusterEndpoints, RawEndpoint, IEndpoint, getStandardKernelsForProvider, IStandardKernelWithProvider } from 'sql/workbench/services/notebook/browser/models/notebookUtils'; +import { getHostAndPortFromEndpoint, isStream, getProvidersForFileName, asyncForEach, clusterEndpointsProperty, getClusterEndpoints, RawEndpoint, IEndpoint, getStandardKernelsForProvider, IStandardKernelWithProvider, rewriteUrlUsingRegex } from 'sql/workbench/services/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/stubs'; import { tryMatchCellMagic } from 'sql/workbench/services/notebook/browser/utils'; @@ -204,4 +204,16 @@ suite('notebookUtils', function (): void { assert.strictEqual(result.host, ''); assert.strictEqual(result.port, undefined); }); + + test('rewriteUrlUsingRegex Test', async function (): Promise { + // Give a URL that should be rewritten + let html = '