@@ -10,11 +10,10 @@ import { ToolkitNotification } from '../../notifications/types'
1010import { panelNode } from './controller.test'
1111import { getTestWindow } from '../shared/vscode/window'
1212import * as VsCodeUtils from '../../shared/utilities/vsCodeUtils'
13- import { readonlyDocument } from '../../shared/utilities/textDocumentUtilities '
13+ import { assertTextEditorContains } from '../testUtil '
1414
1515describe ( 'Notifications Rendering' , function ( ) {
1616 let sandbox : sinon . SinonSandbox
17- //const panelNode: NotificationsNode = testNotificationsNode
1817
1918 beforeEach ( function ( ) {
2019 sandbox = sinon . createSandbox ( )
@@ -27,23 +26,17 @@ describe('Notifications Rendering', function () {
2726 // util to test txt pop-up under different senarios
2827 async function verifyTxtNotification ( notification : ToolkitNotification ) {
2928 const expectedContent = notification . uiRenderInstructions . content [ 'en-US' ] . description
30- const readonlyDocumentShowStub = sandbox . stub ( readonlyDocument , 'show' ) . resolves ( )
29+ void panelNode . openNotification ( notification )
3130
32- await panelNode . openNotification ( notification )
33-
34- assert . ok ( readonlyDocumentShowStub . calledOnce )
35- assert . ok ( readonlyDocumentShowStub . calledWith ( expectedContent , `Notification: ${ notification . id } ` ) )
31+ await assertTextEditorContains ( expectedContent )
3632 }
3733
3834 // util to test open url under different senarios
3935 async function verifyOpenExternalUrl ( notification : ToolkitNotification ) {
40- const url = vscode . Uri . parse ( 'https://aws.amazon.com/visualstudiocode/' )
41- //const openExternalStub = getOpenExternalStub()
4236 const openUrlStub = sandbox . stub ( VsCodeUtils , 'openUrl' )
4337 await panelNode . openNotification ( notification )
4438
45- assert . ok ( openUrlStub . calledOnce )
46- assert . ok ( openUrlStub . calledWith ( url ) )
39+ assert . ok ( openUrlStub . calledWith ( vscode . Uri . parse ( 'https://aws.amazon.com/visualstudiocode/' ) ) )
4740 }
4841
4942 // test on-receive behaviors
@@ -130,7 +123,7 @@ describe('Notifications Rendering', function () {
130123// generate test notifications
131124function getToastURLTestNotification ( ) : ToolkitNotification {
132125 return {
133- id : 'test notification' ,
126+ id : 'test notification 1 ' ,
134127 displayIf : {
135128 extensionId : 'aws.toolkit.fake.extension' ,
136129 } ,
@@ -153,7 +146,7 @@ function getToastURLTestNotification(): ToolkitNotification {
153146
154147function getTxtNotification ( ) : ToolkitNotification {
155148 return {
156- id : 'test notification' ,
149+ id : 'test notification 2 ' ,
157150 displayIf : {
158151 extensionId : 'aws.toolkit.fake.extension' ,
159152 } ,
@@ -174,7 +167,7 @@ function getTxtNotification(): ToolkitNotification {
174167
175168function getModalNotification ( ) : ToolkitNotification {
176169 return {
177- id : 'test notification' ,
170+ id : 'test notification 3 ' ,
178171 displayIf : {
179172 extensionId : 'aws.toolkit.fake.extension' ,
180173 } ,
0 commit comments