mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-09 07:23:39 +00:00
Enhance NoProfilerBanner component with data-testid attributes and update related tests
This commit is contained in:
parent
1dfa6b92ba
commit
005d902b10
@ -48,8 +48,10 @@ const NoProfilerBanner = () => {
|
|||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid size={9}>
|
<Grid size={9}>
|
||||||
<p className="profiler-title">{t('message.no-profiler-title')}</p>
|
<p className="profiler-title" data-testid="profiler-title">
|
||||||
<p className="profiler-description">
|
{t('message.no-profiler-title')}
|
||||||
|
</p>
|
||||||
|
<p className="profiler-description" data-testid="profiler-description">
|
||||||
{t('message.no-profiler-message')}
|
{t('message.no-profiler-message')}
|
||||||
</p>
|
</p>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@ -12,6 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
import { render, screen } from '@testing-library/react';
|
import { render, screen } from '@testing-library/react';
|
||||||
import { MemoryRouter } from 'react-router-dom';
|
import { MemoryRouter } from 'react-router-dom';
|
||||||
|
import '../../../../../test/unit/mocks/mui.mock';
|
||||||
import NoProfilerBanner from './NoProfilerBanner.component';
|
import NoProfilerBanner from './NoProfilerBanner.component';
|
||||||
|
|
||||||
jest.mock('react-router-dom', () => ({
|
jest.mock('react-router-dom', () => ({
|
||||||
@ -30,7 +31,10 @@ describe('NoProfilerBanner', () => {
|
|||||||
expect(
|
expect(
|
||||||
await screen.findByTestId('no-profiler-placeholder')
|
await screen.findByTestId('no-profiler-placeholder')
|
||||||
).toBeInTheDocument();
|
).toBeInTheDocument();
|
||||||
expect(await screen.findByTestId('error-msg')).toBeInTheDocument();
|
expect(await screen.findByTestId('profiler-title')).toBeInTheDocument();
|
||||||
|
expect(
|
||||||
|
await screen.findByTestId('profiler-description')
|
||||||
|
).toBeInTheDocument();
|
||||||
expect(await screen.findByTestId('documentation-link')).toBeInTheDocument();
|
expect(await screen.findByTestId('documentation-link')).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -14,13 +14,13 @@
|
|||||||
import { render, screen, waitFor } from '@testing-library/react';
|
import { render, screen, waitFor } from '@testing-library/react';
|
||||||
import { AxiosError } from 'axios';
|
import { AxiosError } from 'axios';
|
||||||
import { DateRangeObject } from 'Models';
|
import { DateRangeObject } from 'Models';
|
||||||
import '../../../../../test/unit/mocks/mui.mock';
|
|
||||||
import { OperationPermission } from '../../../../context/PermissionProvider/PermissionProvider.interface';
|
import { OperationPermission } from '../../../../context/PermissionProvider/PermissionProvider.interface';
|
||||||
import { ColumnProfile } from '../../../../generated/entity/data/container';
|
import { ColumnProfile } from '../../../../generated/entity/data/container';
|
||||||
import { Table } from '../../../../generated/entity/data/table';
|
import { Table } from '../../../../generated/entity/data/table';
|
||||||
import { Operation } from '../../../../generated/entity/policies/accessControl/resourcePermission';
|
import { Operation } from '../../../../generated/entity/policies/accessControl/resourcePermission';
|
||||||
import { DataType } from '../../../../generated/tests/testDefinition';
|
import { DataType } from '../../../../generated/tests/testDefinition';
|
||||||
import { getColumnProfilerList } from '../../../../rest/tableAPI';
|
import { getColumnProfilerList } from '../../../../rest/tableAPI';
|
||||||
|
import '../../../../test/unit/mocks/mui.mock';
|
||||||
import { showErrorToast } from '../../../../utils/ToastUtils';
|
import { showErrorToast } from '../../../../utils/ToastUtils';
|
||||||
import SingleColumnProfile from './SingleColumnProfile';
|
import SingleColumnProfile from './SingleColumnProfile';
|
||||||
import { useTableProfiler } from './TableProfilerProvider';
|
import { useTableProfiler } from './TableProfilerProvider';
|
||||||
|
|||||||
@ -13,10 +13,10 @@
|
|||||||
import { fireEvent, render, screen } from '@testing-library/react';
|
import { fireEvent, render, screen } from '@testing-library/react';
|
||||||
import QueryString from 'qs';
|
import QueryString from 'qs';
|
||||||
import { act } from 'react';
|
import { act } from 'react';
|
||||||
import '../../../test/unit/mocks/mui.mock';
|
|
||||||
import { Table } from '../../generated/entity/data/table';
|
import { Table } from '../../generated/entity/data/table';
|
||||||
import { MOCK_PERMISSIONS } from '../../mocks/Glossary.mock';
|
import { MOCK_PERMISSIONS } from '../../mocks/Glossary.mock';
|
||||||
import { getListTestCaseIncidentStatusFromSearch } from '../../rest/incidentManagerAPI';
|
import { getListTestCaseIncidentStatusFromSearch } from '../../rest/incidentManagerAPI';
|
||||||
|
import '../../test/unit/mocks/mui.mock';
|
||||||
import IncidentManager from './IncidentManager.component';
|
import IncidentManager from './IncidentManager.component';
|
||||||
|
|
||||||
jest.mock('../common/NextPrevious/NextPrevious', () => {
|
jest.mock('../common/NextPrevious/NextPrevious', () => {
|
||||||
|
|||||||
@ -11,6 +11,9 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
window.React = React;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Global mock for Material-UI (MUI) components
|
* Global mock for Material-UI (MUI) components
|
||||||
* This mock resolves Jest compatibility issues with MUI Grid v2 and theme context
|
* This mock resolves Jest compatibility issues with MUI Grid v2 and theme context
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user