Skip to content

Commit

Permalink
Fix 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 Aug 31, 2024
1 parent 455a945 commit 9881add
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 79 deletions.
69 changes: 0 additions & 69 deletions public/components/__snapshots__/app.test.tsx.snap

This file was deleted.

26 changes: 16 additions & 10 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,18 +17,22 @@ 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();
});
Expand Down

0 comments on commit 9881add

Please sign in to comment.