@@ -13,6 +13,7 @@ function createFigure(layoutOverrides: Partial<Plotly.Layout> = {}): Figure {
1313 return {
1414 data : [ ] ,
1515 layout : { ...layoutOverrides } as Plotly . Layout ,
16+ frames : null ,
1617 } ;
1718}
1819
@@ -74,14 +75,14 @@ describe("computeLayoutOnFigureChange", () => {
7475
7576describe ( "computeOmitKeys" , ( ) => {
7677 it ( "omits user-interaction keys unless they changed in figure" , ( ) => {
77- const unchanged = computeOmitKeys ( { } as Plotly . Layout , { } as Plotly . Layout ) ;
78+ const unchanged = computeOmitKeys ( { } , { } ) ;
7879 expect ( [ ...unchanged ] ) . toEqual (
7980 expect . arrayContaining ( [ "autosize" , "dragmode" , "xaxis" , "yaxis" ] ) ,
8081 ) ;
8182
8283 const changed = computeOmitKeys (
83- { dragmode : "zoom" , xaxis : { range : [ 0 , 10 ] } } as Plotly . Layout ,
84- { dragmode : "select" , xaxis : { range : [ 0 , 5 ] } } as Plotly . Layout ,
84+ { dragmode : "zoom" , xaxis : { range : [ 0 , 10 ] } } ,
85+ { dragmode : "select" , xaxis : { range : [ 0 , 5 ] } } ,
8586 ) ;
8687 expect ( changed . has ( "dragmode" ) ) . toBe ( false ) ;
8788 expect ( changed . has ( "xaxis" ) ) . toBe ( false ) ;
@@ -93,8 +94,8 @@ describe("computeLayoutUpdate", () => {
9394 it ( "merges figure layout while respecting omit keys" , ( ) => {
9495 // dragmode unchanged in figure -> preserve prev layout's dragmode
9596 const result1 = computeLayoutUpdate (
96- { dragmode : "pan" , title : { text : "New" } } as Plotly . Layout ,
97- { dragmode : "pan" } as Plotly . Layout ,
97+ { dragmode : "pan" , title : { text : "New" } } ,
98+ { dragmode : "pan" } ,
9899 { dragmode : "zoom" , height : 400 } ,
99100 ) ;
100101 expect ( result1 . dragmode ) . toBe ( "zoom" ) ;
@@ -103,8 +104,8 @@ describe("computeLayoutUpdate", () => {
103104
104105 // dragmode changed in figure -> use figure's dragmode
105106 const result2 = computeLayoutUpdate (
106- { dragmode : "pan" } as Plotly . Layout ,
107- { dragmode : "select" } as Plotly . Layout ,
107+ { dragmode : "pan" } ,
108+ { dragmode : "select" } ,
108109 { dragmode : "zoom" } ,
109110 ) ;
110111 expect ( result2 . dragmode ) . toBe ( "pan" ) ;
0 commit comments