Skip to content

Commit

Permalink
Remove internal error
Browse files Browse the repository at this point in the history
  • Loading branch information
Alyar committed Jan 10, 2025
1 parent cb9b6b2 commit 9c78c3b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
11 changes: 0 additions & 11 deletions packages/devextreme/js/__internal/grids/new/grid_core/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
});

0 comments on commit 9c78c3b

Please sign in to comment.