Skip to content

Commit fabdfdc

Browse files
authored
increase test coverage
Co-authored-by: Emily KL <4672118+emilykl@users.noreply.github.com>
1 parent 78549d2 commit fabdfdc

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

draftlogs/7997_add.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
- Add `legend.groupdoubleclick` to set the group behavior for a legend double-click [[#7997](https://github.com/plotly/plotly.js/pull/7997)]
1+
- Add `legend.groupdoubleclick` to set the group behavior for a legend double-click [[#7997](https://github.com/plotly/plotly.js/pull/7997)], with thanks to @rascal-sl for the contribution!

test/jasmine/tests/legend_test.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2539,19 +2539,37 @@ describe('legend interaction', function () {
25392539

25402540
it('isolates the clicked item instead of its legendgroup', function (done) {
25412541
Promise.resolve()
2542+
.then(assertVisible([false, true, true, true]))
2543+
.then(click(0, 2))
2544+
.then(assertVisible([false, true, 'legendonly', 'legendonly']))
2545+
.then(click(0, 2))
2546+
.then(assertVisible([false, true, true, true]))
25422547
.then(click(1, 2))
25432548
.then(assertVisible([false, 'legendonly', 'legendonly', true]))
25442549
.then(click(1, 2))
25452550
.then(assertVisible([false, true, true, true]))
2551+
.then(click(2, 2))
2552+
.then(assertVisible([false, 'legendonly', true, 'legendonly']))
2553+
.then(click(2, 2))
2554+
.then(assertVisible([false, true, true, true]))
25462555
.then(done, done.fail);
25472556
});
25482557

25492558
it('leaves the single click behavior to groupclick', function (done) {
25502559
Promise.resolve()
2560+
.then(assertVisible([false, true, true, true]))
2561+
.then(click(0))
2562+
.then(assertVisible([false, 'legendonly', true, 'legendonly']))
2563+
.then(click(0))
2564+
.then(assertVisible([false, true, true, true]))
25512565
.then(click(1))
25522566
.then(assertVisible([false, 'legendonly', true, 'legendonly']))
25532567
.then(click(1))
25542568
.then(assertVisible([false, true, true, true]))
2569+
.then(click(2))
2570+
.then(assertVisible([false, true, 'legendonly', true]))
2571+
.then(click(2))
2572+
.then(assertVisible([false, true, true, true]))
25552573
.then(done, done.fail);
25562574
});
25572575
});

0 commit comments

Comments
 (0)