Skip to content

Commit

Permalink
add additional test scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
nikkithelegendarypokemonster committed Oct 7, 2024
1 parent 3faa927 commit 1fae7f5
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1767,4 +1767,19 @@ QUnit.module('selectIndex changing', () => {

assert.strictEqual(instance.option('selectedIndex'), 0, 'selectedIndex is updated on proper index');
});

QUnit.test('when hiding last visible item selectedIndex should return to 0 index', function(assert) {
const $multiView = $('#multiView').dxMultiView({
items: [
{ text: '1', visible: false },
{ text: '2', visible: false },
{ text: '3', visible: true },
],
selectedIndex: 2
});
const instance = $multiView.dxMultiView('instance');
instance.option('items[2].visible', false);

assert.strictEqual(instance.option('selectedIndex'), 0, 'selectedIndex is updated on proper index');
});
});

0 comments on commit 1fae7f5

Please sign in to comment.