From e810c1ee55900132caa009b5f96e1644d272634b Mon Sep 17 00:00:00 2001 From: etienne Date: Wed, 14 Mar 2018 16:05:29 -0400 Subject: [PATCH] :hocho: layoutStyles call in drawFramework step - this appear to be no longer needed - adapt plot_api test to relied on layoutStyles spy counts --- src/plot_api/plot_api.js | 4 +--- test/jasmine/tests/plot_api_test.js | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/plot_api/plot_api.js b/src/plot_api/plot_api.js index 51d5bf5c514..1805321221e 100644 --- a/src/plot_api/plot_api.js +++ b/src/plot_api/plot_api.js @@ -245,9 +245,7 @@ exports.plot = function(gd, data, layout, config) { .attr('height', fullLayout.height); } - return Lib.syncOrAsync([ - subroutines.layoutStyles - ], gd); + return Plots.previousPromises(gd); } // draw anything that can affect margins. diff --git a/test/jasmine/tests/plot_api_test.js b/test/jasmine/tests/plot_api_test.js index 8af0b1e3820..1924111d1a0 100644 --- a/test/jasmine/tests/plot_api_test.js +++ b/test/jasmine/tests/plot_api_test.js @@ -2440,9 +2440,7 @@ describe('Test plot api', function() { function countCalls(counts) { var callsFinal = Lib.extendFlat({}, counts); - // TODO: do we really need to do layoutStyles twice in Plotly.plot? - // We get one from drawFramework and another directly from Plotly.plot. - callsFinal.layoutStyles = (counts.layoutStyles || 0) + 2 * (counts.plot || 0); + callsFinal.layoutStyles = (counts.layoutStyles || 0) + (counts.plot || 0); mockedMethods.forEach(function(m) { expect(subroutines[m]).toHaveBeenCalledTimes(callsFinal[m] || 0);