Skip to content

Commit 25cd36b

Browse files
author
Alyar
committed
Remove internal error
1 parent fab836d commit 25cd36b

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

packages/devextreme/js/__internal/grids/new/grid_core/utils.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,6 @@ export function normalizeToolbarItems(
3434
userItems: (ToolbarItem | string)[] | undefined,
3535
defaultItemNames: readonly string[],
3636
): ToolbarItem[] {
37-
// TO DO: We need to discuss about this error. It may need to be removed.
38-
/*
39-
defaultItems.forEach((button) => {
40-
if (!defaultItemNames.includes(button.name)) {
41-
throw new Error(
42-
`Default toolbar item '${button.name}' is not added to DEFAULT_TOOLBAR_ITEM_NAMES`
43-
);
44-
}
45-
});
46-
*/
47-
4837
if (!isDefined(userItems)) {
4938
return defaultItems;
5039
}

packages/devextreme/testing/tests/DevExpress.ui.widgets.dataGrid/headerPanel.tests.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -938,20 +938,4 @@ QUnit.module('Draw buttons in header panel', {
938938
assert.strictEqual($customToolbarItem.length, 1, 'item is rendered');
939939
assert.ok($customToolbarItem.is(':visible'), 'item is visible');
940940
});
941-
942-
QUnit.test('The error should be raised if new default toolbar item is not added to DEFAULT_TOOLBAR_ITEM_NAMES', function(assert) {
943-
// arrange
944-
const headerPanel = this.headerPanel;
945-
const $testElement = $('#container');
946-
947-
// act
948-
headerPanel._getToolbarItems = () => [{ name: 'new' }];
949-
950-
assert.throws(function() {
951-
headerPanel.init();
952-
headerPanel.render($testElement);
953-
}, function(e) {
954-
return e.message === 'Default toolbar item \'new\' is not added to DEFAULT_TOOLBAR_ITEM_NAMES';
955-
}, 'exception');
956-
});
957941
});

0 commit comments

Comments
 (0)