Skip to content

Commit

Permalink
Updated unit test
Browse files Browse the repository at this point in the history
Signed-off-by: Emily Guo <[email protected]>
  • Loading branch information
LilyCaroline17 committed Sep 3, 2024
1 parent f41ef6b commit 37b944d
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions public/components/app.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

import React from 'react';
import { render } from '@testing-library/react';
import { coreMock } from '../../../../src/core/public/mocks';
import { MemoryRouter as Router } from 'react-router-dom';
import { QueryInsightsDashboardsApp } from './app';

describe('<QueryInsightsDashboardsApp /> spec', () => {
Expand All @@ -15,19 +17,23 @@ describe('<QueryInsightsDashboardsApp /> spec', () => {
serverBasePath: '/app/opensearch-dashboards',
},
};
const coreStart = coreMock.createStart();

const { container } = render(
<QueryInsightsDashboardsApp
basename="/"
http={mockHttpStart as any}
navigation={
{
ui: { TopNavMenu: () => null },
} as any
}
notifications={{} as any}
/>
<Router>
<QueryInsightsDashboardsApp
basename="/"
core={coreStart}
http={mockHttpStart as any}
navigation={
{
ui: { TopNavMenu: () => null },
} as any
}
notifications={{} as any}
/>
</Router>
);
expect(container).toMatchSnapshot();
});
});
});

Check failure on line 39 in public/components/app.test.tsx

View workflow job for this annotation

GitHub Actions / Run lint

Insert `⏎`

0 comments on commit 37b944d

Please sign in to comment.