Skip to content

Commit 08c7d1e

Browse files
fix: invalid subprotocol during IDER connection (#1246)
1 parent 02c8476 commit 08c7d1e

File tree

4 files changed

+12
-21
lines changed

4 files changed

+12
-21
lines changed

ider/src/ider.component.spec.ts

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ describe('IderComponent', () => {
2525

2626
it('should create', () => {
2727
expect(component).toBeTruthy()
28-
expect(component.ider).toBeInstanceOf(AMTIDER)
29-
expect(component.redirector).toBeInstanceOf(AMTRedirector)
30-
expect(component.mpsServer).toEqual('')
31-
expect(component.deviceId).toEqual('')
32-
expect(component.authToken).toEqual('')
3328
})
3429

3530
it('should correctly instantiate redirector and ider', () => {
@@ -41,6 +36,10 @@ describe('IderComponent', () => {
4136

4237
expect(component.redirector).toBeTruthy()
4338
expect(component.ider).toBeTruthy()
39+
40+
expect(component.ider).toBeInstanceOf(AMTIDER)
41+
expect(component.redirector).toBeInstanceOf(AMTRedirector)
42+
4443
expect(component.redirector?.server).toEqual('testServer')
4544
expect(component.redirector?.authToken).toEqual('testToken')
4645
expect(component.redirector?.host).toEqual('testDeviceId')
@@ -64,22 +63,17 @@ describe('IderComponent', () => {
6463
expect(component.stopIder).toHaveBeenCalled()
6564
})
6665

67-
it('should call instantiate in ngAfterViewInit', () => {
68-
spyOn(component, 'instantiate')
69-
component.ngAfterViewInit()
70-
expect(component.instantiate).toHaveBeenCalled()
71-
})
72-
7366
it('should emit updated iderData', () => {
7467
spyOn(component.iderData, 'emit')
68+
component.instantiate()
7569
component.iderSectorStats(1, 0, 0, 0, 2)
7670
expect(component.iderData.emit).toHaveBeenCalled()
7771
})
7872

7973
it('should stop ider', () => {
8074
const redirectorSpy = spyOn(AMTRedirector.prototype, 'stop')
8175
const cleanupSpy = spyOn(component, 'cleanup')
82-
76+
component.instantiate()
8377
component.stopIder()
8478

8579
expect(component.ider).not.toBeNull()
@@ -90,6 +84,7 @@ describe('IderComponent', () => {
9084

9185
it('should stop ider on destroy', () => {
9286
const stopSpy = spyOn(AMTIDER.prototype, 'stop')
87+
component.instantiate()
9388
component.ngOnDestroy()
9489
expect(stopSpy).toHaveBeenCalled()
9590
})

ider/src/ider.component.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ export class IderComponent {
3939
})
4040
}
4141

42-
ngAfterViewInit (): void {
43-
this.init()
44-
}
45-
4642
init (): void {
4743
this.instantiate()
4844
setTimeout(() => {

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"peerDependencies": {
1919
"@angular/common": "^17.3.5",
2020
"@angular/core": "^17.3.5",
21-
"@open-amt-cloud-toolkit/ui-toolkit": "~3.2.4",
21+
"@open-amt-cloud-toolkit/ui-toolkit": "~3.2.5",
2222
"xterm": "^5.3.0"
2323
},
2424
"devDependencies": {

0 commit comments

Comments
 (0)