@@ -18,11 +18,8 @@ if (!globalThis.window) {
1818 } )
1919}
2020Object . assign ( globalThis . window , {
21- screen : {
22- width : 1234 ,
23- height : 567 ,
24- } ,
25- devicePixelRatio : 1 ,
21+ innerWidth : 1234 ,
22+ innerHeight : 567 ,
2623} )
2724
2825describe ( 'Grafana App' , ( ) => {
@@ -31,18 +28,18 @@ describe('Grafana App', () => {
3128 let originalScreenHeight : number
3229
3330 beforeEach ( ( ) => {
34- originalScreenWidth = globalThis . window . screen . width
35- originalScreenHeight = globalThis . window . screen . height
31+ originalScreenWidth = globalThis . window . innerWidth
32+ originalScreenHeight = globalThis . window . innerHeight
3633 } )
3734
3835 afterEach ( ( ) => {
39- globalThis . window . screen . width = originalScreenWidth
40- globalThis . window . screen . height = originalScreenHeight
36+ globalThis . window . innerWidth = originalScreenWidth
37+ globalThis . window . innerHeight = originalScreenHeight
4138 } )
4239
4340 test ( 'should construct URL with correct parameters' , ( ) => {
44- globalThis . window . screen . width = 1234
45- globalThis . window . screen . height = 567
41+ globalThis . window . innerWidth = 1234
42+ globalThis . window . innerHeight = 567
4643
4744 const url = getRenderUrl ( 'https://grafana.example.com' , 'abc123' )
4845
@@ -55,8 +52,8 @@ describe('Grafana App', () => {
5552 } )
5653
5754 test ( 'should use dynamic window dimensions' , ( ) => {
58- globalThis . window . screen . width = 3840
59- globalThis . window . screen . height = 2160
55+ globalThis . window . innerWidth = 3840
56+ globalThis . window . innerHeight = 2160
6057
6158 const url = getRenderUrl ( 'grafana.example.com' , 'xyz789' )
6259
0 commit comments