From 1fae7f527fd23125f199cc4861827ffe6f84fa42 Mon Sep 17 00:00:00 2001 From: Nikki Gonzales <38495263+nikkithelegendarypokemonster@users.noreply.github.com> Date: Mon, 7 Oct 2024 15:49:11 +0800 Subject: [PATCH] add additional test scenario --- .../DevExpress.ui.widgets/multiView.tests.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets/multiView.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets/multiView.tests.js index df94ddcacd1d..94d2dd8dcfcb 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets/multiView.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets/multiView.tests.js @@ -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'); + }); });