File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -4377,27 +4377,23 @@ describe('Test axes', function() {
43774377 . then ( done , done . fail ) ;
43784378 } ) ;
43794379 it ( 'should respect axis title placement on relayout' , function ( done ) {
4380-
43814380 function getPos ( gd , sel ) {
4382- return d3Select ( gd ) . select ( sel ) . node ( ) . getBoundingClientRect ( )
4381+ return d3Select ( gd ) . select ( sel ) . node ( ) . getBoundingClientRect ( ) ;
43834382 }
43844383
4384+ // Tick position is < title position since 0 is at the top of the graph,
4385+ // rather than at the bottom. We're checking that the ticks and title don't overlap
43854386 function assertLayout ( ) {
43864387 var titleTop = getPos ( gd , '.xtitle' ) . top ;
43874388 var tickBottom = getPos ( gd , '.xtick' ) . bottom ;
43884389 expect ( tickBottom ) . toBeLessThan ( titleTop ) ;
43894390 }
4390- // TODO: This is failing now.
4391- // Is it maybe because there's overlap in these elements because of some padding?
4392- // I'm also not sure that I've accessed the correct properties
4391+
43934392 var fig = require ( '@mocks/z-automargin-zoom.json' ) ;
4394-
43954393 Plotly . newPlot ( gd , fig )
4396- console . log ( d3Select ( gd ) . select ( '.xtitle' ) . node ( ) . getBoundingClientRect ( ) . top )
4397- console . log ( d3Select ( gd ) . select ( '.xtitle' ) . node ( ) . getBoundingClientRect ( ) . bottom )
43984394
43994395 . then ( function ( ) {
4400- assertLayout ( ) ;
4396+ assertLayout ( ) ;
44014397 } )
44024398 . then ( function ( ) {
44034399 return Plotly . relayout ( gd , { 'xaxis.range' : [ 6 , 14 ] } ) ;
You can’t perform that action at this time.
0 commit comments