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() {
4377
4377
. then ( done , done . fail ) ;
4378
4378
} ) ;
4379
4379
it ( 'should respect axis title placement on relayout' , function ( done ) {
4380
-
4381
4380
function getPos ( gd , sel ) {
4382
- return d3Select ( gd ) . select ( sel ) . node ( ) . getBoundingClientRect ( )
4381
+ return d3Select ( gd ) . select ( sel ) . node ( ) . getBoundingClientRect ( ) ;
4383
4382
}
4384
4383
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
4385
4386
function assertLayout ( ) {
4386
4387
var titleTop = getPos ( gd , '.xtitle' ) . top ;
4387
4388
var tickBottom = getPos ( gd , '.xtick' ) . bottom ;
4388
4389
expect ( tickBottom ) . toBeLessThan ( titleTop ) ;
4389
4390
}
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
+
4393
4392
var fig = require ( '@mocks/z-automargin-zoom.json' ) ;
4394
-
4395
4393
Plotly . newPlot ( gd , fig )
4396
- console . log ( d3Select ( gd ) . select ( '.xtitle' ) . node ( ) . getBoundingClientRect ( ) . top )
4397
- console . log ( d3Select ( gd ) . select ( '.xtitle' ) . node ( ) . getBoundingClientRect ( ) . bottom )
4398
4394
4399
4395
. then ( function ( ) {
4400
- assertLayout ( ) ;
4396
+ assertLayout ( ) ;
4401
4397
} )
4402
4398
. then ( function ( ) {
4403
4399
return Plotly . relayout ( gd , { 'xaxis.range' : [ 6 , 14 ] } ) ;
You can’t perform that action at this time.
0 commit comments