From 6cc2ecc18da9e9b5f2100b9e6677d366d30fe9a0 Mon Sep 17 00:00:00 2001 From: Martha Cryan Date: Tue, 21 Jan 2025 12:10:50 -0600 Subject: [PATCH 1/4] Remove extra parameter from toBeCloseTo --- test/jasmine/tests/sankey_test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/jasmine/tests/sankey_test.js b/test/jasmine/tests/sankey_test.js index 29b777c87ae..74db31ba26f 100644 --- a/test/jasmine/tests/sankey_test.js +++ b/test/jasmine/tests/sankey_test.js @@ -816,8 +816,8 @@ describe('sankey tests', function() { var g = d3Select('.hovertext'); var pos = g.node().getBoundingClientRect(); - expect(pos.x).toBeCloseTo(279, -1.5, 'it should have correct x position'); - expect(pos.y).toBeCloseTo(500, -1.5, 'it should have correct y position'); + expect(pos.x).toBeCloseTo(279, -1.5); + expect(pos.y).toBeCloseTo(500, -1.5); }) .then(done, done.fail); }); From c006a9034cd0350576bbcdc740d4a688a4b914a8 Mon Sep 17 00:00:00 2001 From: Martha Cryan Date: Tue, 21 Jan 2025 14:28:39 -0600 Subject: [PATCH 2/4] remove error when in headless mode --- test/jasmine/assets/mouse_event.js | 6 +++--- test/jasmine/tests/sankey_test.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/jasmine/assets/mouse_event.js b/test/jasmine/assets/mouse_event.js index 3b6b0c9f466..cb5b78c0667 100644 --- a/test/jasmine/assets/mouse_event.js +++ b/test/jasmine/assets/mouse_event.js @@ -2,9 +2,9 @@ var Lib = require('../../../src/lib'); module.exports = function(type, x, y, opts) { var visibility = document.visibilityState; - if(visibility && visibility !== 'visible') { - throw new Error('document.visibilityState = "' + visibility + '" - Please make the window visible.'); - } + // if(visibility && visibility !== 'visible') { + // throw new Error('document.visibilityState = "' + visibility + '" - Please make the window visible.'); + // } var fullOpts = { bubbles: true, diff --git a/test/jasmine/tests/sankey_test.js b/test/jasmine/tests/sankey_test.js index 74db31ba26f..a9f24c1d63a 100644 --- a/test/jasmine/tests/sankey_test.js +++ b/test/jasmine/tests/sankey_test.js @@ -1513,7 +1513,7 @@ function assertLabel(content, style) { function assertMultipleLabels(contentArray, styleArray) { var g = d3SelectAll('.hovertext'); - expect(g.size()).toEqual(contentArray.length, 'wrong number of hoverlabels, expected to find ' + contentArray.length); + expect(g.size()).toEqual(contentArray.length); g.each(function(el, i) { _assertLabelGroup(d3Select(this), contentArray[i], styleArray[i]); }); From c610b606726b2d6465e481fefc8ca2859874d28c Mon Sep 17 00:00:00 2001 From: Martha Cryan Date: Tue, 21 Jan 2025 14:49:48 -0600 Subject: [PATCH 3/4] Fix setting of title field --- test/jasmine/tests/plot_api_react_test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/jasmine/tests/plot_api_react_test.js b/test/jasmine/tests/plot_api_react_test.js index dfeb6fdba5c..7153566ff4a 100644 --- a/test/jasmine/tests/plot_api_react_test.js +++ b/test/jasmine/tests/plot_api_react_test.js @@ -183,7 +183,7 @@ describe('@noCIdep Plotly.react', function() { Plotly.newPlot(gd, data, layout) .then(countPlots) .then(function() { - layout.title.text = 'XXXXX'; + layout.title = { text: 'XXXXX' }; layout.hovermode = 'closest'; data[0].marker = {color: 'rgb(0, 100, 200)'}; return Plotly.react(gd, data, layout); From a6dcc4ffd715ff560dcddaa918cb9ec85b31fea9 Mon Sep 17 00:00:00 2001 From: Martha Cryan Date: Tue, 21 Jan 2025 14:54:39 -0600 Subject: [PATCH 4/4] Fix unsafe access of selectedData variable --- test/jasmine/tests/select_test.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/jasmine/tests/select_test.js b/test/jasmine/tests/select_test.js index 3d345c63a3a..e9962d33e59 100644 --- a/test/jasmine/tests/select_test.js +++ b/test/jasmine/tests/select_test.js @@ -1996,7 +1996,10 @@ describe('Test select box and lasso per trace:', function() { return function(expected) { var msg = '(call #' + callNumber + ') lasso points '; - var lassoPoints = selectedData.lassoPoints || {}; + var lassoPoints = {}; + if (selectedData && selectedData.lassoPoints) { + lassoPoints = selectedData.lassoPoints; + } if(subplot) { expect(lassoPoints[subplot] || [])