Skip to content

Commit

Permalink
fixed linting rules
Browse files Browse the repository at this point in the history
  • Loading branch information
YulNaumenko committed Apr 1, 2022
1 parent 8845913 commit ec39aeb
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ export const LandingPageComponent = memo(() => {
</SecuritySolutionPageWrapper>
);
});

LandingPageComponent.displayName = 'LandingPageComponent';
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@

import { appendSearch } from './helpers';

export const getAppLandingUrl = (overviewPath: string, search?: string) =>
`${overviewPath}${appendSearch(search)}`;
export const getAppLandingUrl = (path: string, search?: string) =>
`${path}${appendSearch(search)}`;
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,17 @@ describe('Hosts - rendering', () => {
</Router>
</TestProviders>
);

const getUrlForAppMock = (
appId: string,
options?: { deepLinkId?: string; path?: string; absolute?: boolean }
) => `${appId}${options?.deepLinkId ? `/${options.deepLinkId}` : ''}${options?.path ?? ''}`;

const landingPath = getUrlForAppMock(APP_UI_ID, { deepLinkId: SecurityPageName.landing });

expect(mockNavigateToApp).toHaveBeenCalledWith(APP_UI_ID, {
deepLinkId: SecurityPageName.landing,
path: getAppLandingUrl(),
path: getAppLandingUrl(landingPath),
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { Network } from './network';
import { NetworkRoutes } from './navigation';
import { mockCasesContract } from '../../../../cases/public/mocks';
import { APP_UI_ID, SecurityPageName } from '../../../common/constants';
import { getAppLandingUrl } from '../../common/components/link_to';
import { getAppLandingUrl } from '../../common/components/link_to/redirect_to_landing';

jest.mock('../../common/containers/sourcerer');

Expand Down Expand Up @@ -133,9 +133,16 @@ describe('Network page - rendering', () => {
</TestProviders>
);

const getUrlForAppMock = (
appId: string,
options?: { deepLinkId?: string; path?: string; absolute?: boolean }
) => `${appId}${options?.deepLinkId ? `/${options.deepLinkId}` : ''}${options?.path ?? ''}`;

const landingPath = getUrlForAppMock(APP_UI_ID, { deepLinkId: SecurityPageName.landing });

expect(mockNavigateToApp).toHaveBeenCalledWith(APP_UI_ID, {
deepLinkId: SecurityPageName.landing,
path: getAppLandingUrl(SecurityPageName.landing),
path: getAppLandingUrl(landingPath),
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,16 @@ describe('Overview', () => {
</MemoryRouter>
</TestProviders>
);
const getUrlForAppMock = (
appId: string,
options?: { deepLinkId?: string; path?: string; absolute?: boolean }
) => `${appId}${options?.deepLinkId ? `/${options.deepLinkId}` : ''}${options?.path ?? ''}`;

const landingPath = getUrlForAppMock(APP_UI_ID, { deepLinkId: SecurityPageName.landing });

expect(mockNavigateToApp).toHaveBeenCalledWith(APP_UI_ID, {
deepLinkId: SecurityPageName.landing,
path: getAppLandingUrl(),
path: getAppLandingUrl(landingPath),
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,16 @@ describe('Users - rendering', () => {
</Router>
</TestProviders>
);
const getUrlForAppMock = (
appId: string,
options?: { deepLinkId?: string; path?: string; absolute?: boolean }
) => `${appId}${options?.deepLinkId ? `/${options.deepLinkId}` : ''}${options?.path ?? ''}`;

const landingPath = getUrlForAppMock(APP_UI_ID, { deepLinkId: SecurityPageName.landing });

expect(mockNavigateToApp).toHaveBeenCalledWith(APP_UI_ID, {
deepLinkId: SecurityPageName.landing,
path: getAppLandingUrl(),
path: getAppLandingUrl(landingPath),
});
});

Expand Down

0 comments on commit ec39aeb

Please sign in to comment.