66import assert from 'assert'
77
88import { AWSError } from 'aws-sdk'
9- import * as path from 'path'
109import * as sinon from 'sinon'
1110import { DefaultEc2MetadataClient } from '../../shared/clients/ec2MetadataClient'
1211import * as vscode from 'vscode'
1312import { UserActivity , getComputeRegion , initializeComputeRegion } from '../../shared/extensionUtilities'
1413import { isDifferentVersion , setMostRecentVersion } from '../../shared/extensionUtilities'
15- import * as filesystemUtilities from '../../shared/filesystemUtilities'
16- import { FakeExtensionContext } from '../fakeExtensionContext'
1714import { InstanceIdentity } from '../../shared/clients/ec2MetadataClient'
1815import { extensionVersion } from '../../shared/vscode/env'
1916import { sleep } from '../../shared/utilities/timeoutUtils'
2017import globals from '../../shared/extensionGlobals'
21- import { createQuickStartWebview , maybeShowMinVscodeWarning } from '../../shared/extensionStartup'
22- import { fs } from '../../shared'
18+ import { maybeShowMinVscodeWarning } from '../../shared/extensionStartup'
2319import { getTestWindow } from './vscode/window'
2420import { assertTelemetry } from '../testUtil'
2521
@@ -34,53 +30,6 @@ describe('extensionUtilities', function () {
3430 assertTelemetry ( 'toolkit_showNotification' , [ ] )
3531 } )
3632
37- describe ( 'createQuickStartWebview' , async function ( ) {
38- let context : FakeExtensionContext
39- let tempDir : string | undefined
40-
41- beforeEach ( async function ( ) {
42- context = await FakeExtensionContext . create ( )
43- tempDir = await filesystemUtilities . makeTemporaryToolkitFolder ( )
44- context . extensionPath = tempDir
45- } )
46-
47- afterEach ( async function ( ) {
48- if ( tempDir ) {
49- await fs . delete ( tempDir , { recursive : true } )
50- }
51- } )
52-
53- it ( "throws error if a quick start page doesn't exist" , async ( ) => {
54- await assert . rejects ( createQuickStartWebview ( context , 'irresponsibly-named-file' ) )
55- } )
56-
57- it ( 'returns a webview with unaltered text if a valid file is passed without tokens' , async function ( ) {
58- const filetext = 'this temp page does not have any tokens'
59- const filepath = 'tokenless'
60- await fs . writeFile ( path . join ( context . extensionPath , filepath ) , filetext )
61- const webview = await createQuickStartWebview ( context , filepath )
62-
63- assert . strictEqual ( typeof webview , 'object' )
64- const forcedWebview = webview as vscode . WebviewPanel
65- assert . strictEqual ( forcedWebview . webview . html . includes ( filetext ) , true )
66- } )
67-
68- it ( 'returns a webview with tokens replaced' , async function ( ) {
69- const token = '!!EXTENSIONROOT!!'
70- const basetext = 'this temp page has tokens: '
71- const filetext = basetext + token
72- const filepath = 'tokenless'
73- await fs . writeFile ( path . join ( context . extensionPath , filepath ) , filetext )
74- const webview = await createQuickStartWebview ( context , filepath )
75-
76- assert . strictEqual ( typeof webview , 'object' )
77- const forcedWebview = webview as vscode . WebviewPanel
78-
79- const pathAsVsCodeResource = forcedWebview . webview . asWebviewUri ( vscode . Uri . file ( context . extensionPath ) )
80- assert . strictEqual ( forcedWebview . webview . html . includes ( `${ basetext } ${ pathAsVsCodeResource } ` ) , true )
81- } )
82- } )
83-
8433 describe ( 'isDifferentVersion' , function ( ) {
8534 it ( 'returns false if the version exists and matches the existing version exactly' , async function ( ) {
8635 const goodVersion = '1.2.3'
0 commit comments