Skip to content

Commit 10566c1

Browse files
committed
update outdated test
1 parent f0900d7 commit 10566c1

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

src/test/ec2/explorer/ec2InstanceNode.test.ts

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55

66
import * as assert from 'assert'
77
import { Ec2InstanceNode } from '../../../ec2/explorer/ec2InstanceNode'
8-
import { Ec2Instance, getNameOfInstance } from '../../../shared/clients/ec2Client'
8+
import { Ec2Client, Ec2Instance, getNameOfInstance } from '../../../shared/clients/ec2Client'
9+
import { Ec2ParentNode } from '../../../ec2/explorer/ec2ParentNode'
910

1011
describe('ec2InstanceNode', function () {
1112
let testNode: Ec2InstanceNode
1213
let testInstance: Ec2Instance
14+
const testRegion = 'testRegion'
15+
const testPartition = 'testPartition'
1316

1417
before(function () {
1518
testInstance = {
@@ -20,9 +23,11 @@ describe('ec2InstanceNode', function () {
2023
Value: 'testName',
2124
},
2225
],
26+
status: 'testing',
2327
}
24-
25-
testNode = new Ec2InstanceNode('testRegion', 'testPartition', testInstance)
28+
const testClient = new Ec2Client('')
29+
const testParentNode = new Ec2ParentNode(testRegion, testPartition, testClient)
30+
testNode = new Ec2InstanceNode(testParentNode, testClient, 'testRegion', 'testPartition', testInstance)
2631
})
2732

2833
it('instantiates without issue', async function () {
@@ -41,13 +46,17 @@ describe('ec2InstanceNode', function () {
4146
assert.strictEqual(testNode.name, getNameOfInstance(testInstance))
4247
})
4348

44-
it('initializes the tooltip', async function () {
45-
assert.strictEqual(testNode.tooltip, `${testNode.name}\n${testNode.InstanceId}\n${testNode.arn}`)
46-
})
47-
4849
it('has no children', async function () {
4950
const childNodes = await testNode.getChildren()
5051
assert.ok(childNodes)
5152
assert.strictEqual(childNodes.length, 0, 'Expected node to have no children')
5253
})
54+
55+
it('has an EC2ParentNode as parent', async function () {
56+
assert.ok(testNode.parent instanceof Ec2ParentNode)
57+
})
58+
59+
it('intializes the client', async function () {
60+
assert.ok(testNode.client instanceof Ec2Client)
61+
})
5362
})

0 commit comments

Comments
 (0)