Skip to content

Commit

Permalink
test: add missing data provider tests (#7425)
Browse files Browse the repository at this point in the history
  • Loading branch information
vursen authored May 17, 2024
1 parent 4af7633 commit f9559b6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/combo-box/test/lazy-loading.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,18 @@ describe('lazy loading', () => {
expect(comboBox.size).to.equal(SIZE);
});

it('should not add items exceeding the size returned by dataProvider', () => {
comboBox.dataProvider = (params, callback) => callback(['foo', 'bar'], 1);
comboBox.opened = true;
expect(comboBox.filteredItems).to.eql(['foo']);
});

it('should add items when dataProvider return size undefined', () => {
comboBox.dataProvider = (params, callback) => callback(['foo', 'bar'], undefined);
comboBox.opened = true;
expect(comboBox.filteredItems).to.eql(['foo', 'bar']);
});

it('should remove extra filteredItems when decreasing size', () => {
comboBox.dataProvider = (params, callback) => callback(['foo', 'bar'], 2);
comboBox.open();
Expand Down

0 comments on commit f9559b6

Please sign in to comment.