Skip to content

Commit f56413a

Browse files
committed
restore and update spikeline tests
1 parent 6c2f368 commit f56413a

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

test/jasmine/tests/modebar_test.js

+28
Original file line numberDiff line numberDiff line change
@@ -861,13 +861,41 @@ describe('ModeBar', function() {
861861
});
862862

863863
describe('button toggleSpikelines', function() {
864+
it('should not change layout hovermode', function() {
865+
expect(gd._fullLayout.hovermode).toBe('x');
866+
assertActive(hovermodeButtons, buttonCompare);
867+
868+
buttonToggle.click();
869+
expect(gd._fullLayout.hovermode).toBe('x');
870+
assertActive(hovermodeButtons, buttonCompare);
871+
});
864872
it('should makes spikelines visible', function() {
865873
buttonToggle.click();
866874
expect(gd._fullLayout._cartesianSpikesEnabled).toBe('on');
867875

868876
buttonToggle.click();
869877
expect(gd._fullLayout._cartesianSpikesEnabled).toBe('off');
870878
});
879+
it('should not become disabled when hovermode is switched off closest', function() {
880+
buttonToggle.click();
881+
expect(gd._fullLayout._cartesianSpikesEnabled).toBe('on');
882+
883+
buttonCompare.click();
884+
expect(gd._fullLayout._cartesianSpikesEnabled).toBe('on');
885+
});
886+
it('should keep the state on changing the hovermode', function() {
887+
buttonToggle.click();
888+
expect(gd._fullLayout._cartesianSpikesEnabled).toBe('on');
889+
890+
buttonCompare.click();
891+
expect(gd._fullLayout._cartesianSpikesEnabled).toBe('on');
892+
893+
buttonToggle.click();
894+
expect(gd._fullLayout._cartesianSpikesEnabled).toBe('off');
895+
896+
buttonClosest.click();
897+
expect(gd._fullLayout._cartesianSpikesEnabled).toBe('off');
898+
});
871899
});
872900
});
873901

0 commit comments

Comments
 (0)