Skip to content

Commit

Permalink
Fix lint and tests
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Ho <[email protected]>
  • Loading branch information
derek-ho committed Jul 18, 2024
1 parent ceb0f43 commit 4eade76
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import {
import { getDashboardsInfo } from '../../../../utils/dashboards-info-utils';
import { LOCAL_CLUSTER_ID } from '../../../../../common';
import { AccessErrorComponent } from '../../access-error-component';
import { LocalCluster } from '../../app-router';
import { LocalCluster } from '../../../../utils/datasource-utils';

export function ConfigureTab1(props: AppDependencies) {
const [isMultiTenancyEnabled, setIsMultiTenancyEnabled] = useState(false);
Expand Down
3 changes: 2 additions & 1 deletion public/apps/configuration/panels/tenant-list/manage_tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ import { useContextMenuState } from '../../utils/context-menu';
import { generateResourceName } from '../../utils/resource-utils';
import { DocLinks } from '../../constants';
import { TenantList } from './tenant-list';
import { LocalCluster, getBreadcrumbs } from '../../app-router';
import { getBreadcrumbs } from '../../app-router';
import { LocalCluster } from '../../../../utils/datasource-utils';
import { buildUrl } from '../../utils/url-builder';
import { CrossPageToast } from '../../cross-page-toast';
import { getDashboardsInfo } from '../../../../utils/dashboards-info-utils';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { AppDependencies } from '../../../types';
import { ExternalLink } from '../../utils/display-utils';
import { DocLinks } from '../../constants';
import { getDashboardsInfo } from '../../../../utils/dashboards-info-utils';
import { LocalCluster } from '../../app-router';
import { LocalCluster } from '../../../../utils/datasource-utils';
import { SecurityPluginTopNavMenu } from '../../top-nav-menu';

interface TenantListProps extends AppDependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ describe('Tenant list', () => {
setBreadcrumbs() {
return 1;
},
navGroup: {
getNavGroupEnabled: jest.fn().mockReturnValue(false),
},
},
};
const config = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,6 @@ exports[`SecurityPluginTopNavMenu renders DataSourceMenu when dataSource is enab
<Redirect
exact={true}
from="/"
to="/getstarted"
/>
</Switch>
</EuiPageBody>
Expand Down
4 changes: 4 additions & 0 deletions public/apps/configuration/test/app-router.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { getDataSourceFromUrl } from '../../../utils/datasource-utils';

jest.mock('../../../utils/datasource-utils', () => ({
getDataSourceFromUrl: jest.fn(),
LocalCluster: { id: '', label: 'Local cluster' },
}));

describe('SecurityPluginTopNavMenu', () => {
Expand All @@ -30,6 +31,9 @@ describe('SecurityPluginTopNavMenu', () => {
notifications: jest.fn(),
chrome: {
setBreadcrumbs: jest.fn(),
navGroup: {
getNavGroupEnabled: jest.fn().mockReturnValue(false),
},
},
};

Expand Down

0 comments on commit 4eade76

Please sign in to comment.