25
25
import { LookerEmbedSDK , LookerEmbedDashboard } from '../src/index'
26
26
import { ChattyHost } from '@looker/chatty'
27
27
import mock from 'xhr-mock'
28
+ import { EmbedClient } from '../src/embed'
28
29
29
30
const testUrl = '/base/tests/test.html'
30
31
31
32
describe ( 'LookerEmbed' , ( ) => {
32
33
let builder
33
34
let el
34
- let client
35
+ let client : any
35
36
36
37
beforeEach ( ( ) => {
37
38
LookerEmbedSDK . init ( 'host.looker.com:9999' , '/auth' )
@@ -40,7 +41,7 @@ describe('LookerEmbed', () => {
40
41
} )
41
42
42
43
describe ( 'with ID' , ( ) => {
43
- let fakeDashboardClient
44
+ let fakeDashboardClient : any
44
45
45
46
beforeEach ( ( ) => {
46
47
mock . setup ( )
@@ -92,15 +93,15 @@ describe('LookerEmbed', () => {
92
93
93
94
client . connect ( )
94
95
. then ( done . fail )
95
- . catch ( ( error ) => {
96
+ . catch ( ( error : any ) => {
96
97
expect ( error ) . toEqual ( 'foo' )
97
98
done ( )
98
99
} )
99
100
} )
100
101
} )
101
102
102
103
describe ( 'with URL' , ( ) => {
103
- let fakeDashboardClient
104
+ let fakeDashboardClient : any
104
105
105
106
beforeEach ( ( ) => {
106
107
fakeDashboardClient = { }
@@ -139,8 +140,8 @@ describe('LookerEmbed', () => {
139
140
140
141
describe ( 'creating an iframe' , ( ) => {
141
142
let fakeDashboardClient
142
- let el
143
- let iframe
143
+ let el : HTMLDivElement
144
+ let iframe : HTMLIFrameElement
144
145
145
146
beforeEach ( ( ) => {
146
147
el = document . createElement ( 'div' )
@@ -155,7 +156,7 @@ describe('LookerEmbed', () => {
155
156
builder . withClassName ( 'classy' )
156
157
client = builder . build ( )
157
158
spyOn ( window , 'fetch' )
158
- spyOn ( ChattyHost . prototype , 'connect' ) . and . callFake ( async function ( ) {
159
+ spyOn ( ChattyHost . prototype , 'connect' ) . and . callFake ( async function ( this : any ) {
159
160
iframe = this . iframe
160
161
return Promise . resolve ( { } )
161
162
} )
@@ -170,6 +171,7 @@ describe('LookerEmbed', () => {
170
171
. then ( ( ) => {
171
172
expect ( iframe . sandbox . toString ( ) ) . toEqual ( 'allow-scripts' )
172
173
expect ( iframe . classList . toString ( ) ) . toEqual ( 'classy' )
174
+ // tslint:disable-next-line:deprecation
173
175
expect ( iframe . frameBorder ) . toEqual ( '0' )
174
176
expect ( iframe . src ) . toMatch ( testUrl )
175
177
done ( )
0 commit comments