refactor: return null when passing empty menu templates (#23364)
This commit is contained in:
parent
59c1c12e0b
commit
0f0cc51b35
4 changed files with 11 additions and 13 deletions
|
@ -93,12 +93,6 @@ describe('Menu module', function () {
|
|||
}).to.throw(/Invalid template for MenuItem: must have at least one of label, role or type/);
|
||||
});
|
||||
|
||||
it('throws when an empty array is passed as a template', () => {
|
||||
expect(() => {
|
||||
Menu.buildFromTemplate([]);
|
||||
}).to.throw(/Invalid template for Menu: Menu template must be an non-empty array/);
|
||||
});
|
||||
|
||||
it('throws when an non-array is passed as a template', () => {
|
||||
expect(() => {
|
||||
Menu.buildFromTemplate('hello' as any);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue