Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f4ac3a4

Browse files
committed
test: make linter happy
1 parent 74f3fa0 commit f4ac3a4

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

test/jasmine/tests/bar_test.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -778,12 +778,14 @@ describe('bar hover', function() {
778778
subplot = gd._fullLayout._plots.xy,
779779
xa = subplot.xaxis,
780780
ya = subplot.yaxis,
781-
barDelta = 1 * 0.8 / 2;
781+
barDelta = 1 * 0.8 / 2,
782+
x0 = xa.c2p(0.5, true),
783+
x1 = x0,
784+
y0 = ya.c2p(0 - barDelta, true),
785+
y1 = ya.c2p(0 + barDelta, true);
782786

783787
expect(out.style).toEqual([0, '#1f77b4', 0.5, 0]);
784-
assertPos(out.pos,
785-
[xa.c2p(0.5, true), xa.c2p(0.5, true),
786-
ya.c2p(0 - barDelta, true), ya.c2p(0 + barDelta, true)]);
788+
assertPos(out.pos, [x0, x1, y0, y1]);
787789
});
788790

789791
it('should return the correct hover point data (case closest)', function() {
@@ -792,12 +794,14 @@ describe('bar hover', function() {
792794
xa = subplot.xaxis,
793795
ya = subplot.yaxis,
794796
barDelta = 1 * 0.8 / 2 / 2,
795-
barPos = 0 - 1 * 0.8 / 2 + barDelta;
797+
barPos = 0 - 1 * 0.8 / 2 + barDelta,
798+
x0 = xa.c2p(0.5, true),
799+
x1 = x0,
800+
y0 = ya.c2p(barPos - barDelta, true),
801+
y1 = ya.c2p(barPos + barDelta, true);
796802

797803
expect(out.style).toEqual([0, '#1f77b4', 0.5, 0]);
798-
assertPos(out.pos,
799-
[xa.c2p(0.5, true), xa.c2p(0.5, true),
800-
ya.c2p(barPos - barDelta, true), ya.c2p(barPos + barDelta, true)]);
804+
assertPos(out.pos, [x0, x1, y0, y1]);
801805
});
802806
});
803807

0 commit comments

Comments
 (0)