Skip to content

Commit

Permalink
Ensure test uses same fragment instance
Browse files Browse the repository at this point in the history
  • Loading branch information
craigbeck committed Jul 3, 2024
1 parent 04338c3 commit 87b6acb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/dom/bindings.mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,11 +476,12 @@ describe('bindings', function() {
$items.set(['alpha', 'beta']);
// if getFragment called before second set() call, bindings are evaluated
// multiple times, leading to suggested bug below of len() called w undefined
page.getFragment('Body');
const fragment = page.getFragment('Body');
expect(fragment).html('<div>alpha [L=5]</div><div>beta [L=4]</div>');
// When `items` gets set to an array of one, down from two, a possible bug is the `len` function
// getting invoked again for the no-longer-existing second item, resulting in a thrown exception.
$items.set(['omega']);
expect(page.getFragment('Body')).html('<div>omega [L=5]</div>');
expect(fragment).html('<div>omega [L=5]</div>');
});

// Racer model listeners could mutate the model, causing changed mutations.
Expand Down

0 comments on commit 87b6acb

Please sign in to comment.