Skip to content

Add a test to for custom hover format of epoch timestamp #6763

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions test/jasmine/tests/hover_label_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4380,6 +4380,21 @@ describe('hover distance', function() {
})
.then(done, done.fail);
});

it('correctly format the epoch timestamp in a given hover format', function(done) {
var x = ['1970-01-01 00:00:00'];
var mock = {
data: [{type: 'scatter', x: x, y: [1]}],
layout: {width: 400, height: 400, xaxis: {hoverformat: '%H:%M:%S'}}
};

Plotly.newPlot(gd, mock)
.then(function(gd) {
Fx.hover(gd, {xpx: 120, ypx: 110});
assertHoverLabelContent({nums: '(00:00:00, 1)'});
})
.then(done, done.fail);
});
});
});

Expand Down