Skip to content

Commit

Permalink
added test from cheeriojs#834
Browse files Browse the repository at this point in the history
  • Loading branch information
5saviahv committed Jan 6, 2021
1 parent 5dbfabe commit a0efbc9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/api/traversing.js
Original file line number Diff line number Diff line change
Expand Up @@ -1383,6 +1383,21 @@ describe('$(...)', function () {
expect($selection[3]).toBe($pear[0]);
});
});

it('modifying nested selections should not impact the parent [#834]', function () {
var apple_pear = $apple.add($pear);

// applies red to apple and pear
apple_pear.addClass('red');

expect($apple.hasClass('red')).toBe(true); // this is true
expect($pear.hasClass('red')).toBe(true); // this is true

// applies green to pear... AND should not affect apple
$pear.addClass('green');
expect($pear.hasClass('green')).toBe(true); //currently this is true
expect($apple.hasClass('green')).toBe(false); // and this is true!
});
});
});

Expand Down

0 comments on commit a0efbc9

Please sign in to comment.