Skip to content

Commit

Permalink
UT: Duplicates listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
piecioshka committed Oct 13, 2020
1 parent 63dca1f commit 6a8a76e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/test.index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,17 @@ test('trigger custom event after changed data', (assert) => {
});

test('support fluent API', (assert) => {
let updates = 0;

new SimpleDataTable($target)
.render()
.load([])
.on(SimpleDataTable.EVENTS.UPDATE, () => null)
.on(SimpleDataTable.EVENTS.UPDATE, () => updates++)
.on(SimpleDataTable.EVENTS.UPDATE, () => updates++)
.emit(SimpleDataTable.EVENTS.UPDATE)
.render();

assert.pass();
assert.is(updates, 2);
});

test('add button text should be configurable', (assert) => {
Expand Down

0 comments on commit 6a8a76e

Please sign in to comment.