@@ -2446,6 +2446,7 @@ describe('SDK-to-HPM', function () {
2446
2446
let page1 : page . Page ;
2447
2447
let visual1 : visualDescriptor . VisualDescriptor ;
2448
2448
let uniqueId = 'uniqueId' ;
2449
+ let sdkSessionId = 'sdkSessionId' ;
2449
2450
let createUniqueId = 'uniqueId' ;
2450
2451
let dashboardUniqueId = 'uniqueId' ;
2451
2452
let visualUniqueId = 'uniqueId' ;
@@ -2513,6 +2514,7 @@ describe('SDK-to-HPM', function () {
2513
2514
page1 = new page . Page ( report , 'xyz' ) ;
2514
2515
visual1 = new visualDescriptor . VisualDescriptor ( page1 , 'uvw' , 'title' , 'type' , { } ) ;
2515
2516
uniqueId = report . config . uniqueId ;
2517
+ sdkSessionId = powerbi . getSdkSessionId ( ) ;
2516
2518
createUniqueId = create . config . uniqueId ;
2517
2519
dashboardUniqueId = dashboard . config . uniqueId ;
2518
2520
visualUniqueId = embeddedVisual . config . uniqueId ;
@@ -2567,7 +2569,7 @@ describe('SDK-to-HPM', function () {
2567
2569
report . load ( testData . loadConfiguration ) ;
2568
2570
2569
2571
// Assert
2570
- expect ( spyHpm . post ) . toHaveBeenCalledWith ( '/report/load' , testData . loadConfiguration , { uid : uniqueId } , iframe . contentWindow ) ;
2572
+ expect ( spyHpm . post ) . toHaveBeenCalledWith ( '/report/load' , testData . loadConfiguration , { uid : uniqueId , sdkSessionId : sdkSessionId } , iframe . contentWindow ) ;
2571
2573
} ) ;
2572
2574
2573
2575
it ( 'report.load() returns promise that rejects with validation error if the load configuration is invalid' , function ( done ) {
@@ -2589,7 +2591,7 @@ describe('SDK-to-HPM', function () {
2589
2591
// Act
2590
2592
report . load ( testData . loadConfiguration )
2591
2593
. catch ( error => {
2592
- expect ( spyHpm . post ) . toHaveBeenCalledWith ( '/report/load' , testData . loadConfiguration , { uid : uniqueId } , iframe . contentWindow ) ;
2594
+ expect ( spyHpm . post ) . toHaveBeenCalledWith ( '/report/load' , testData . loadConfiguration , { uid : uniqueId , sdkSessionId : sdkSessionId } , iframe . contentWindow ) ;
2593
2595
expect ( error ) . toEqual ( testData . errorResponse . body ) ;
2594
2596
// Assert
2595
2597
done ( ) ;
@@ -2613,7 +2615,7 @@ describe('SDK-to-HPM', function () {
2613
2615
// Act
2614
2616
report . load ( testData . loadConfiguration )
2615
2617
. then ( response => {
2616
- expect ( spyHpm . post ) . toHaveBeenCalledWith ( '/report/load' , testData . loadConfiguration , { uid : uniqueId } , iframe . contentWindow ) ;
2618
+ expect ( spyHpm . post ) . toHaveBeenCalledWith ( '/report/load' , testData . loadConfiguration , { uid : uniqueId , sdkSessionId : sdkSessionId } , iframe . contentWindow ) ;
2617
2619
expect ( response ) . toEqual ( null ) ;
2618
2620
// Assert
2619
2621
done ( ) ;
@@ -2709,7 +2711,7 @@ describe('SDK-to-HPM', function () {
2709
2711
let spyArgs = spyHpm . post . calls . mostRecent ( ) . args ;
2710
2712
expect ( spyArgs [ 0 ] ) . toEqual ( '/report/load' ) ;
2711
2713
expect ( spyArgs [ 1 ] ) . toEqual ( expectedConfiguration ) ;
2712
- expect ( spyArgs [ 2 ] ) . toEqual ( { uid : visualUniqueId } ) ;
2714
+ expect ( spyArgs [ 2 ] ) . toEqual ( { uid : visualUniqueId , sdkSessionId : sdkSessionId } ) ;
2713
2715
expect ( spyArgs [ 3 ] ) . toEqual ( visualFrame . contentWindow ) ;
2714
2716
} ) ;
2715
2717
@@ -3167,7 +3169,7 @@ describe('SDK-to-HPM', function () {
3167
3169
report . reload ( ) ;
3168
3170
3169
3171
// Assert
3170
- expect ( spyHpm . post ) . toHaveBeenCalledWith ( '/report/load' , jasmine . objectContaining ( testData . loadConfiguration ) , { uid : uniqueId } , iframe . contentWindow ) ;
3172
+ expect ( spyHpm . post ) . toHaveBeenCalledWith ( '/report/load' , jasmine . objectContaining ( testData . loadConfiguration ) , { uid : uniqueId , sdkSessionId : sdkSessionId } , iframe . contentWindow ) ;
3171
3173
} ) ;
3172
3174
} ) ;
3173
3175
} ) ;
@@ -3274,7 +3276,7 @@ describe('SDK-to-HPM', function () {
3274
3276
create . createReport ( testData . createConfiguration ) ;
3275
3277
3276
3278
// Assert
3277
- expect ( spyHpm . post ) . toHaveBeenCalledWith ( '/report/create' , testData . createConfiguration , { uid : createUniqueId } , createIframe . contentWindow ) ;
3279
+ expect ( spyHpm . post ) . toHaveBeenCalledWith ( '/report/create' , testData . createConfiguration , { uid : createUniqueId , sdkSessionId : sdkSessionId } , createIframe . contentWindow ) ;
3278
3280
} ) ;
3279
3281
3280
3282
it ( 'create.createReport() returns promise that rejects with validation error if the create configuration is invalid' , function ( done ) {
@@ -3296,7 +3298,7 @@ describe('SDK-to-HPM', function () {
3296
3298
// Act
3297
3299
create . createReport ( testData . createConfiguration )
3298
3300
. catch ( error => {
3299
- expect ( spyHpm . post ) . toHaveBeenCalledWith ( '/report/create' , testData . createConfiguration , { uid : createUniqueId } , createIframe . contentWindow ) ;
3301
+ expect ( spyHpm . post ) . toHaveBeenCalledWith ( '/report/create' , testData . createConfiguration , { uid : createUniqueId , sdkSessionId : sdkSessionId } , createIframe . contentWindow ) ;
3300
3302
expect ( error ) . toEqual ( testData . errorResponse . body ) ;
3301
3303
// Assert
3302
3304
done ( ) ;
@@ -3320,7 +3322,7 @@ describe('SDK-to-HPM', function () {
3320
3322
// Act
3321
3323
create . createReport ( testData . createConfiguration )
3322
3324
. then ( response => {
3323
- expect ( spyHpm . post ) . toHaveBeenCalledWith ( '/report/create' , testData . createConfiguration , { uid : createUniqueId } , createIframe . contentWindow ) ;
3325
+ expect ( spyHpm . post ) . toHaveBeenCalledWith ( '/report/create' , testData . createConfiguration , { uid : createUniqueId , sdkSessionId : sdkSessionId } , createIframe . contentWindow ) ;
3324
3326
expect ( response ) . toEqual ( null ) ;
3325
3327
// Assert
3326
3328
done ( ) ;
@@ -3350,7 +3352,7 @@ describe('SDK-to-HPM', function () {
3350
3352
dashboard . load ( testData . loadConfiguration ) ;
3351
3353
3352
3354
// Assert
3353
- expect ( spyHpm . post ) . toHaveBeenCalledWith ( '/dashboard/load' , testData . loadConfiguration , { uid : dashboardUniqueId } , dashboardIframe . contentWindow ) ;
3355
+ expect ( spyHpm . post ) . toHaveBeenCalledWith ( '/dashboard/load' , testData . loadConfiguration , { uid : dashboardUniqueId , sdkSessionId : sdkSessionId } , dashboardIframe . contentWindow ) ;
3354
3356
} ) ;
3355
3357
} ) ;
3356
3358
} ) ;
0 commit comments