From 5872f73b5f332b89cdaeb11edfd381381b65aad3 Mon Sep 17 00:00:00 2001 From: Emily Kellison-Linn <4672118+emilykl@users.noreply.github.com> Date: Tue, 21 Jan 2025 12:09:38 -0500 Subject: [PATCH 01/13] change title to title.text in noCI tests --- test/jasmine/tests/page_test.js | 2 +- test/jasmine/tests/plot_api_react_test.js | 2 +- test/jasmine/tests/transition_test.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/jasmine/tests/page_test.js b/test/jasmine/tests/page_test.js index 77f5b83f112..e05c8fffd13 100644 --- a/test/jasmine/tests/page_test.js +++ b/test/jasmine/tests/page_test.js @@ -55,7 +55,7 @@ describe('page rendering', function() { mock.layout.updatemenus = require('../../image/mocks/updatemenus.json').layout.updatemenus; mock.layout.sliders = require('../../image/mocks/sliders.json').layout.sliders; - mock.layout.xaxis.title = 'XXX'; + mock.layout.xaxis.title.text = 'XXX'; mock.layout.showlegend = true; return Plotly.newPlot(gd, mock.data, mock.layout).then(function() { diff --git a/test/jasmine/tests/plot_api_react_test.js b/test/jasmine/tests/plot_api_react_test.js index e858a52e8ad..28c334b6ae2 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 = 'XXXXX'; + layout.title.text = 'XXXXX'; layout.hovermode = 'closest'; data[0].marker = {color: 'rgb(0, 100, 200)'}; return Plotly.react(gd, data, layout); diff --git a/test/jasmine/tests/transition_test.js b/test/jasmine/tests/transition_test.js index 72204267182..62affe35465 100644 --- a/test/jasmine/tests/transition_test.js +++ b/test/jasmine/tests/transition_test.js @@ -455,7 +455,7 @@ describe('Plotly.react transitions:', function() { ]); }) .then(function() { - layout.title = 'FIGURE'; + layout.title.text = 'FIGURE'; return Plotly.react(gd, data, layout); }) .then(function() { From b8666d9d7d364d4f56f78008bc99ba3ac7fdbf68 Mon Sep 17 00:00:00 2001 From: Emily Kellison-Linn <4672118+emilykl@users.noreply.github.com> Date: Tue, 21 Jan 2025 12:19:53 -0500 Subject: [PATCH 02/13] remove tests which use transforms --- test/jasmine/tests/plot_api_react_test.js | 165 ---------------------- 1 file changed, 165 deletions(-) diff --git a/test/jasmine/tests/plot_api_react_test.js b/test/jasmine/tests/plot_api_react_test.js index 28c334b6ae2..dfeb6fdba5c 100644 --- a/test/jasmine/tests/plot_api_react_test.js +++ b/test/jasmine/tests/plot_api_react_test.js @@ -574,104 +574,6 @@ describe('@noCIdep Plotly.react', function() { .then(done, done.fail); }); - function aggregatedPie(i) { - var labels = i <= 1 ? - ['A', 'B', 'A', 'C', 'A', 'B', 'C', 'A', 'B', 'C', 'A'] : - ['X', 'Y', 'Z', 'Z', 'Y', 'Z', 'X', 'Z', 'Y', 'Z', 'X']; - var trace = { - type: 'pie', - values: [4, 1, 4, 4, 1, 4, 4, 2, 1, 1, 15], - labels: labels, - transforms: [{ - type: 'aggregate', - groups: labels, - aggregations: [{target: 'values', func: 'sum'}] - }] - }; - return { - data: [trace], - layout: { - datarevision: i, - colorway: ['red', 'orange', 'yellow', 'green', 'blue', 'violet'] - } - }; - } - - var aggPie1CD = [[ - {v: 26, label: 'A', color: 'red', i: 0}, - {v: 9, label: 'C', color: 'orange', i: 2}, - {v: 6, label: 'B', color: 'yellow', i: 1} - ]]; - - var aggPie2CD = [[ - {v: 23, label: 'X', color: 'red', i: 0}, - {v: 15, label: 'Z', color: 'orange', i: 2}, - {v: 3, label: 'Y', color: 'yellow', i: 1} - ]]; - - function aggregatedScatter(i) { - return { - data: [{ - x: [1, 2, 3, 4, 6, 5], - y: [2, 1, 3, 5, 6, 4], - transforms: [{ - type: 'aggregate', - groups: [1, -1, 1, -1, 1, -1], - aggregations: i > 1 ? [{func: 'last', target: 'x'}] : [] - }] - }], - layout: {daterevision: i + 10} - }; - } - - var aggScatter1CD = [[ - {x: 1, y: 2, i: 0}, - {x: 2, y: 1, i: 1} - ]]; - - var aggScatter2CD = [[ - {x: 6, y: 2, i: 0}, - {x: 5, y: 1, i: 1} - ]]; - - function aggregatedParcoords(i) { - return { - data: [{ - type: 'parcoords', - dimensions: [ - {label: 'A', values: [1, 2, 3, 4]}, - {label: 'B', values: [4, 3, 2, 1]} - ], - transforms: i ? [{ - type: 'aggregate', - groups: [1, 2, 1, 2], - aggregations: [ - {target: 'dimensions[0].values', func: i > 1 ? 'avg' : 'first'}, - {target: 'dimensions[1].values', func: i > 1 ? 'first' : 'avg'} - ] - }] : - [] - }] - }; - } - - var aggParcoords0Vals = [[1, 2, 3, 4], [4, 3, 2, 1]]; - var aggParcoords1Vals = [[1, 2], [3, 2]]; - var aggParcoords2Vals = [[2, 3], [4, 3]]; - - function checkCalcData(expectedCD) { - return function() { - expect(gd.calcdata.length).toBe(expectedCD.length); - expectedCD.forEach(function(expectedCDi, i) { - var cdi = gd.calcdata[i]; - expect(cdi.length).toBe(expectedCDi.length, i); - expectedCDi.forEach(function(expectedij, j) { - expect(cdi[j]).toEqual(jasmine.objectContaining(expectedij)); - }); - }); - }; - } - function checkValues(expectedVals) { return function() { expect(gd._fullData.length).toBe(1); @@ -687,73 +589,6 @@ describe('@noCIdep Plotly.react', function() { return function() { return Plotly.react(gd, fig); }; } - it('can change pie aggregations', function(done) { - Plotly.newPlot(gd, aggregatedPie(1)) - .then(checkCalcData(aggPie1CD)) - - .then(reactTo(aggregatedPie(2))) - .then(checkCalcData(aggPie2CD)) - - .then(reactTo(aggregatedPie(1))) - .then(checkCalcData(aggPie1CD)) - .then(done, done.fail); - }); - - it('can change scatter aggregations', function(done) { - Plotly.newPlot(gd, aggregatedScatter(1)) - .then(checkCalcData(aggScatter1CD)) - - .then(reactTo(aggregatedScatter(2))) - .then(checkCalcData(aggScatter2CD)) - - .then(reactTo(aggregatedScatter(1))) - .then(checkCalcData(aggScatter1CD)) - .then(done, done.fail); - }); - - it('@gl can change parcoords aggregations', function(done) { - Plotly.newPlot(gd, aggregatedParcoords(0)) - .then(checkValues(aggParcoords0Vals)) - - .then(reactTo(aggregatedParcoords(1))) - .then(checkValues(aggParcoords1Vals)) - - .then(reactTo(aggregatedParcoords(2))) - .then(checkValues(aggParcoords2Vals)) - - .then(reactTo(aggregatedParcoords(0))) - .then(checkValues(aggParcoords0Vals)) - - .then(done, done.fail); - }); - - it('@gl can change type with aggregations', function(done) { - Plotly.newPlot(gd, aggregatedScatter(1)) - .then(checkCalcData(aggScatter1CD)) - - .then(reactTo(aggregatedPie(1))) - .then(checkCalcData(aggPie1CD)) - - .then(reactTo(aggregatedParcoords(1))) - .then(checkValues(aggParcoords1Vals)) - - .then(reactTo(aggregatedScatter(1))) - .then(checkCalcData(aggScatter1CD)) - - .then(reactTo(aggregatedParcoords(2))) - .then(checkValues(aggParcoords2Vals)) - - .then(reactTo(aggregatedPie(2))) - .then(checkCalcData(aggPie2CD)) - - .then(reactTo(aggregatedScatter(2))) - .then(checkCalcData(aggScatter2CD)) - - .then(reactTo(aggregatedParcoords(0))) - .then(checkValues(aggParcoords0Vals)) - .then(done, done.fail); - }); - it('can change frames without redrawing', function(done) { var data = [{y: [1, 2, 3]}]; var layout = {}; From 39520c1abf16c050ade2f3e7c96071937e2fb16d Mon Sep 17 00:00:00 2001 From: Emily Kellison-Linn <4672118+emilykl@users.noreply.github.com> Date: Tue, 21 Jan 2025 12:50:03 -0500 Subject: [PATCH 03/13] run noCI tests in CI --- .github/workflows/test.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000000..0828f8d98e1 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,33 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs + +name: No CI Test + +on: push + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x] + + steps: + - uses: browser-actions/setup-chrome@v1 + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: chrome --version + - run: ls + - run: npm run pretest + - run: npm ci + - run: npm run cibuild + - name: Run headless test + uses: coactions/setup-xvfb@v1 + with: + run: ./tasks/noci_test.sh From 6cc2ecc18da9e9b5f2100b9e6677d366d30fe9a0 Mon Sep 17 00:00:00 2001 From: Martha Cryan Date: Tue, 21 Jan 2025 12:10:50 -0600 Subject: [PATCH 04/13] 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 05/13] 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 06/13] 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 07/13] 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] || []) From 7c418a50e8c52d1768d0f97c7becc883023efacc Mon Sep 17 00:00:00 2001 From: Emily Kellison-Linn <4672118+emilykl@users.noreply.github.com> Date: Tue, 21 Jan 2025 16:53:21 -0500 Subject: [PATCH 08/13] add margin of error to assertTextIsInsidePath --- test/jasmine/tests/bar_test.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/jasmine/tests/bar_test.js b/test/jasmine/tests/bar_test.js index fc6c5bb8c80..10e6413659b 100644 --- a/test/jasmine/tests/bar_test.js +++ b/test/jasmine/tests/bar_test.js @@ -1195,14 +1195,14 @@ describe('A bar plot', function() { return node.querySelectorAll('g.point'); } - function assertTextIsInsidePath(textNode, pathNode) { + function assertTextIsInsidePath(textNode, pathNode, errorMargin=0) { var textBB = textNode.getBoundingClientRect(); var pathBB = pathNode.getBoundingClientRect(); - expect(pathBB.left).not.toBeGreaterThan(textBB.left); - expect(textBB.right).not.toBeGreaterThan(pathBB.right); - expect(pathBB.top).not.toBeGreaterThan(textBB.top); - expect(textBB.bottom).not.toBeGreaterThan(pathBB.bottom); + expect(pathBB.left - errorMargin).not.toBeGreaterThan(textBB.left); + expect(textBB.right - errorMargin).not.toBeGreaterThan(pathBB.right); + expect(pathBB.top - errorMargin).not.toBeGreaterThan(textBB.top); + expect(textBB.bottom - errorMargin).not.toBeGreaterThan(pathBB.bottom); } function assertTextIsAbovePath(textNode, pathNode) { @@ -1828,7 +1828,7 @@ describe('A bar plot', function() { assertTextIsInsidePath(text03, path03); // inside assertTextIsInsidePath(text12, path12); // inside assertTextIsInsidePath(text20, path20); // inside - assertTextIsInsidePath(text30, path30); // inside + assertTextIsInsidePath(text30, path30, 0.5); // inside }) .then(done, done.fail); }); From 8e0d77b02c99b0911c1bdd33a9f855457f0df174 Mon Sep 17 00:00:00 2001 From: Emily Kellison-Linn <4672118+emilykl@users.noreply.github.com> Date: Wed, 22 Jan 2025 05:12:19 -0500 Subject: [PATCH 09/13] increase tolerance for zoom test --- test/jasmine/tests/cartesian_interact_test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/jasmine/tests/cartesian_interact_test.js b/test/jasmine/tests/cartesian_interact_test.js index 5332f9237c9..ffbcaaf9c33 100644 --- a/test/jasmine/tests/cartesian_interact_test.js +++ b/test/jasmine/tests/cartesian_interact_test.js @@ -827,7 +827,7 @@ describe('axis zoom/pan and main plot zoom', function() { }); describe('updates matching axes', function() { - var TOL = 1.5; + var TOL = 1; var eventData; function assertRanges(msg, exp) { From c71a251991685755975ace76da96becd789ab3dc Mon Sep 17 00:00:00 2001 From: Emily Kellison-Linn <4672118+emilykl@users.noreply.github.com> Date: Wed, 22 Jan 2025 05:20:10 -0500 Subject: [PATCH 10/13] add margin of error for funnel restyle test --- test/jasmine/tests/funnel_test.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/jasmine/tests/funnel_test.js b/test/jasmine/tests/funnel_test.js index 326a20927da..2c5dbf03dae 100644 --- a/test/jasmine/tests/funnel_test.js +++ b/test/jasmine/tests/funnel_test.js @@ -591,14 +591,14 @@ describe('A funnel plot', function() { return node.querySelectorAll('g.point'); } - function assertTextIsInsidePath(textNode, pathNode) { + function assertTextIsInsidePath(textNode, pathNode, errorMargin=0) { var textBB = textNode.getBoundingClientRect(); var pathBB = pathNode.getBoundingClientRect(); - expect(pathBB.left).not.toBeGreaterThan(textBB.left); - expect(textBB.right).not.toBeGreaterThan(pathBB.right); - expect(pathBB.top).not.toBeGreaterThan(textBB.top); - expect(textBB.bottom).not.toBeGreaterThan(pathBB.bottom); + expect(pathBB.left - errorMargin).not.toBeGreaterThan(textBB.left); + expect(textBB.right - errorMargin).not.toBeGreaterThan(pathBB.right); + expect(pathBB.top - errorMargin).not.toBeGreaterThan(textBB.top); + expect(textBB.bottom - errorMargin).not.toBeGreaterThan(pathBB.bottom); } function assertTextIsAbovePath(textNode, pathNode) { @@ -969,7 +969,7 @@ describe('A funnel plot', function() { assertTextIsInsidePath(text03, path03); // inside assertTextIsInsidePath(text12, path12); // inside assertTextIsInsidePath(text20, path20); // inside - assertTextIsInsidePath(text30, path30); // inside + assertTextIsInsidePath(text30, path30, 0.5); // inside }) .then(done, done.fail); }); From 659afc3152cba20fecfd2530982121c5b5f9c3cd Mon Sep 17 00:00:00 2001 From: Emily Kellison-Linn <4672118+emilykl@users.noreply.github.com> Date: Wed, 22 Jan 2025 08:44:40 -0500 Subject: [PATCH 11/13] fix setting of title.text --- test/jasmine/tests/transition_test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/jasmine/tests/transition_test.js b/test/jasmine/tests/transition_test.js index 62affe35465..3356add57a1 100644 --- a/test/jasmine/tests/transition_test.js +++ b/test/jasmine/tests/transition_test.js @@ -455,7 +455,7 @@ describe('Plotly.react transitions:', function() { ]); }) .then(function() { - layout.title.text = 'FIGURE'; + layout.title = { text: 'FIGURE' }; return Plotly.react(gd, data, layout); }) .then(function() { From af7d3cd9c679da97e954f0487bdee80757266b0a Mon Sep 17 00:00:00 2001 From: Martha Cryan Date: Fri, 24 Jan 2025 14:55:24 -0600 Subject: [PATCH 12/13] Remove test that checks for bug that no longer occurs --- test/jasmine/tests/gl3d_plot_interact_test.js | 126 ------------------ 1 file changed, 126 deletions(-) diff --git a/test/jasmine/tests/gl3d_plot_interact_test.js b/test/jasmine/tests/gl3d_plot_interact_test.js index 67e7805cc39..568f6374c25 100644 --- a/test/jasmine/tests/gl3d_plot_interact_test.js +++ b/test/jasmine/tests/gl3d_plot_interact_test.js @@ -14,132 +14,6 @@ var drag = require('../assets/drag'); var selectButton = require('../assets/modebar_button'); var delay = require('../assets/delay'); -describe('Test gl3d before/after plot', function() { - var gd; - - var mock = require('../../image/mocks/gl3d_marker-arrays.json'); - - beforeEach(function() { - jasmine.DEFAULT_TIMEOUT_INTERVAL = 8000; - }); - - afterEach(function() { - Plotly.purge(gd); - destroyGraphDiv(); - }); - - it('@noCI @gl should not rotate camera on the very first click before scene is complete and then should rotate', function(done) { - var _mock = Lib.extendDeep( - { - layout: { - scene: { - camera: { - up: { - x: 0, - y: 0, - z: 1 - }, - eye: { - x: 1.2, - y: 1.2, - z: 1.2 - }, - center: { - x: 0, - y: 0, - z: 0 - } - } - } - } - }, - mock - ); - - var x = 605; - var y = 271; - - function _stayThere() { - mouseEvent('mousemove', x, y); - return delay(20)(); - } - - function _clickThere() { - mouseEvent('mouseover', x, y, {buttons: 1}); - return delay(20)(); - } - - function _clickOtherplace() { - mouseEvent('mouseover', 300, 300, {buttons: 1}); - return delay(20)(); - } - - _stayThere() - .then(function() { - gd = createGraphDiv(); - return Plotly.newPlot(gd, _mock); - }) - .then(delay(100)) - .then(function() { - var cameraIn = gd._fullLayout.scene.camera; - expect(cameraIn.up.x).toEqual(0, 'cameraIn.up.x'); - expect(cameraIn.up.y).toEqual(0, 'cameraIn.up.y'); - expect(cameraIn.up.z).toEqual(1, 'cameraIn.up.z'); - expect(cameraIn.center.x).toEqual(0, 'cameraIn.center.x'); - expect(cameraIn.center.y).toEqual(0, 'cameraIn.center.y'); - expect(cameraIn.center.z).toEqual(0, 'cameraIn.center.z'); - expect(cameraIn.eye.x).toEqual(1.2, 'cameraIn.eye.x'); - expect(cameraIn.eye.y).toEqual(1.2, 'cameraIn.eye.y'); - expect(cameraIn.eye.z).toEqual(1.2, 'cameraIn.eye.z'); - }) - .then(delay(100)) - .then(function() { - var cameraBefore = gd._fullLayout.scene._scene.camera; - expect(cameraBefore.up[0]).toBeCloseTo(0, 2, 'cameraBefore.up[0]'); - expect(cameraBefore.up[1]).toBeCloseTo(0, 2, 'cameraBefore.up[1]'); - expect(cameraBefore.up[2]).toBeCloseTo(1, 2, 'cameraBefore.up[2]'); - expect(cameraBefore.center[0]).toBeCloseTo(0, 2, 'cameraBefore.center[0]'); - expect(cameraBefore.center[1]).toBeCloseTo(0, 2, 'cameraBefore.center[1]'); - expect(cameraBefore.center[2]).toBeCloseTo(0, 2, 'cameraBefore.center[2]'); - expect(cameraBefore.eye[0]).toBeCloseTo(1.2, 2, 'cameraBefore.eye[0]'); - expect(cameraBefore.eye[1]).toBeCloseTo(1.2, 2, 'cameraBefore.eye[1]'); - expect(cameraBefore.eye[2]).toBeCloseTo(1.2, 2, 'cameraBefore.eye[2]'); - expect(cameraBefore.mouseListener.enabled === true); - }) - .then(_clickThere) - .then(delay(100)) - .then(function() { - var cameraAfter = gd._fullLayout.scene._scene.camera; - expect(cameraAfter.up[0]).toBeCloseTo(0, 2, 'cameraAfter.up[0]'); - expect(cameraAfter.up[1]).toBeCloseTo(0, 2, 'cameraAfter.up[1]'); - expect(cameraAfter.up[2]).toBeCloseTo(1, 2, 'cameraAfter.up[2]'); - expect(cameraAfter.center[0]).toBeCloseTo(0, 2, 'cameraAfter.center[0]'); - expect(cameraAfter.center[1]).toBeCloseTo(0, 2, 'cameraAfter.center[1]'); - expect(cameraAfter.center[2]).toBeCloseTo(0, 2, 'cameraAfter.center[2]'); - expect(cameraAfter.eye[0]).toBeCloseTo(1.2, 2, 'cameraAfter.eye[0]'); - expect(cameraAfter.eye[1]).toBeCloseTo(1.2, 2, 'cameraAfter.eye[1]'); - expect(cameraAfter.eye[2]).toBeCloseTo(1.2, 2, 'cameraAfter.eye[2]'); - expect(cameraAfter.mouseListener.enabled === true); - }) - .then(_clickOtherplace) - .then(delay(100)) - .then(function() { - var cameraFinal = gd._fullLayout.scene._scene.camera; - expect(cameraFinal.up[0]).toBeCloseTo(0, 2, 'cameraFinal.up[0]'); - expect(cameraFinal.up[1]).toBeCloseTo(0, 2, 'cameraFinal.up[1]'); - expect(cameraFinal.up[2]).toBeCloseTo(1, 2, 'cameraFinal.up[2]'); - expect(cameraFinal.center[0]).toBeCloseTo(0, 2, 'cameraFinal.center[0]'); - expect(cameraFinal.center[1]).toBeCloseTo(0, 2, 'cameraFinal.center[1]'); - expect(cameraFinal.center[2]).toBeCloseTo(0, 2, 'cameraFinal.center[2]'); - expect(cameraFinal.eye[0]).not.toBeCloseTo(1.2, 2, 'cameraFinal.eye[0]'); - expect(cameraFinal.eye[1]).not.toBeCloseTo(1.2, 2, 'cameraFinal.eye[1]'); - expect(cameraFinal.eye[2]).not.toBeCloseTo(1.2, 2, 'cameraFinal.eye[2]'); - expect(cameraFinal.mouseListener.enabled === true); - }) - .then(done, done.fail); - }); -}); - describe('Test gl3d plots', function() { var gd; From 3ec831c3c82d5620dccd36892765cf660edb7321 Mon Sep 17 00:00:00 2001 From: Martha Cryan Date: Fri, 24 Jan 2025 15:02:22 -0600 Subject: [PATCH 13/13] Add different mapbox style url --- test/jasmine/tests/mapbox_test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/jasmine/tests/mapbox_test.js b/test/jasmine/tests/mapbox_test.js index 0432710fade..0dfc28039fb 100644 --- a/test/jasmine/tests/mapbox_test.js +++ b/test/jasmine/tests/mapbox_test.js @@ -417,7 +417,7 @@ describe('mapbox credentials', function() { }], { mapbox: { accesstoken: MAPBOX_ACCESS_TOKEN, - style: 'mapbox://styles/plotly-js-tests/ck4og36lx0vnj1cpdl8y0cr8m' + style: 'mapbox://styles/examples/cke97f49z5rlg19l310b7uu7j' } }).catch(function() { cnt++;