From 9c78c3bb21280aa0b79bdba572bfe354ed96b6a5 Mon Sep 17 00:00:00 2001 From: Alyar <> Date: Fri, 10 Jan 2025 16:23:27 +0400 Subject: [PATCH] Remove internal error --- .../js/__internal/grids/new/grid_core/utils.ts | 11 ----------- .../headerPanel.tests.js | 16 ---------------- 2 files changed, 27 deletions(-) diff --git a/packages/devextreme/js/__internal/grids/new/grid_core/utils.ts b/packages/devextreme/js/__internal/grids/new/grid_core/utils.ts index a50793ad5717..35a846b48315 100644 --- a/packages/devextreme/js/__internal/grids/new/grid_core/utils.ts +++ b/packages/devextreme/js/__internal/grids/new/grid_core/utils.ts @@ -34,17 +34,6 @@ export function normalizeToolbarItems( userItems: (ToolbarItem | string)[] | undefined, defaultItemNames: readonly string[], ): ToolbarItem[] { - // TO DO: We need to discuss about this error. It may need to be removed. - /* - defaultItems.forEach((button) => { - if (!defaultItemNames.includes(button.name)) { - throw new Error( - `Default toolbar item '${button.name}' is not added to DEFAULT_TOOLBAR_ITEM_NAMES` - ); - } - }); - */ - if (!isDefined(userItems)) { return defaultItems; } diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.dataGrid/headerPanel.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.dataGrid/headerPanel.tests.js index 970db3d94b22..f9e6c8e1da6e 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.dataGrid/headerPanel.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.dataGrid/headerPanel.tests.js @@ -938,20 +938,4 @@ QUnit.module('Draw buttons in header panel', { assert.strictEqual($customToolbarItem.length, 1, 'item is rendered'); assert.ok($customToolbarItem.is(':visible'), 'item is visible'); }); - - QUnit.test('The error should be raised if new default toolbar item is not added to DEFAULT_TOOLBAR_ITEM_NAMES', function(assert) { - // arrange - const headerPanel = this.headerPanel; - const $testElement = $('#container'); - - // act - headerPanel._getToolbarItems = () => [{ name: 'new' }]; - - assert.throws(function() { - headerPanel.init(); - headerPanel.render($testElement); - }, function(e) { - return e.message === 'Default toolbar item \'new\' is not added to DEFAULT_TOOLBAR_ITEM_NAMES'; - }, 'exception'); - }); });