Skip to content

Commit

Permalink
Improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrunyon committed Oct 17, 2023
1 parent 683ed86 commit 5f1debd
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/dashboard-core-plugins/src/WidgetLoaderPlugin.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,13 @@ describe('WidgetLoaderPlugin', () => {

it('Overrides plugins that handle the same widget type', async () => {
const layoutManager = createAndMountDashboard([
['test-widget-plugin', testWidgetPlugin],
[
'test-widget-plugin',
{
...testWidgetPlugin,
supportedTypes: ['test-widget', 'test-widget-a'],
},
],
[
'test-widget-plugin-two',
{
Expand All @@ -224,9 +230,10 @@ describe('WidgetLoaderPlugin', () => {
act(
() =>
layoutManager?.eventHub.emit(PanelEvent.OPEN, {
widget: { type: 'test-widget-two' },
widget: { type: 'test-widget-a' },
})
);
expect(screen.queryAllByText('TestWidget').length).toBe(1);
expect(screen.queryAllByText('TestWidgetTwo').length).toBe(1);
});
});
Expand Down

0 comments on commit 5f1debd

Please sign in to comment.