Skip to content
Snippets Groups Projects
Commit 3e77ca1c authored by Mateusz Bolewski's avatar Mateusz Bolewski
Browse files

Merge branch 'development' of ssh://gitlab.lcsb.uni.lu:8022/minerva/frontend...

Merge branch 'development' of ssh://gitlab.lcsb.uni.lu:8022/minerva/frontend into feat/bioentity-from-map
parents 0dd63ec8 19bfa400
No related branches found
No related tags found
2 merge requests!223reset the pin numbers before search results are fetch (so the results will be...,!71Feat/bioentity from map
Pipeline #82502 passed
......@@ -10,8 +10,7 @@ import { DrawerHeadingBackwardButton } from './DrawerHeadingBackwardButton.compo
const backwardFunction = jest.fn();
const renderComponent = (
title: string,
value: string[],
children: React.ReactNode,
initialStoreState: InitialStoreState = {},
): { store: StoreType } => {
const { Wrapper, store } = getReduxWrapperWithStore(initialStoreState);
......@@ -19,11 +18,9 @@ const renderComponent = (
return (
render(
<Wrapper>
<DrawerHeadingBackwardButton
title={title}
value={value}
backwardFunction={backwardFunction}
/>
<DrawerHeadingBackwardButton backwardFunction={backwardFunction}>
{children}
</DrawerHeadingBackwardButton>
</Wrapper>,
),
{
......@@ -38,16 +35,15 @@ describe('DrawerHeadingBackwardButton - component', () => {
});
it('should render passed values', () => {
renderComponent('Title', ['value']);
renderComponent('Title');
expect(screen.getByRole('back-button')).toBeInTheDocument();
expect(screen.getByText('Title:')).toBeInTheDocument();
expect(screen.getByText('value')).toBeInTheDocument();
expect(screen.getByText('Title')).toBeInTheDocument();
expect(screen.getByRole('close-drawer-button')).toBeInTheDocument();
});
it('should call backward function on back button click', () => {
renderComponent('Title', ['value']);
renderComponent('Title');
const backButton = screen.getByRole('back-button');
backButton.click();
......@@ -56,7 +52,7 @@ describe('DrawerHeadingBackwardButton - component', () => {
});
it('should call class drawer on close button click', () => {
const { store } = renderComponent('Title', ['value'], {
const { store } = renderComponent('Title', {
drawer: {
...drawerSearchStepOneFixture,
},
......
......@@ -4,15 +4,13 @@ import { IconButton } from '@/shared/IconButton';
import { BACK_BUTTON_ROLE, CLOSE_BUTTON_ROLE } from './DrawerHeadingBackwardButton.constants';
export interface DrawerHeadingBackwardButtonProps {
title: string;
value: string[];
backwardFunction: () => void;
children: React.ReactNode;
}
export const DrawerHeadingBackwardButton = ({
backwardFunction,
title,
value,
children,
}: DrawerHeadingBackwardButtonProps): JSX.Element => {
const dispatch = useAppDispatch();
......@@ -35,8 +33,7 @@ export const DrawerHeadingBackwardButton = ({
role={BACK_BUTTON_ROLE}
/>
<div className="ml-2 py-8 text-xl">
<span className="font-normal">{title}: </span>
<span className="font-semibold">{value}</span>
<span className="font-semibold">{children}</span>
</div>
</div>
<IconButton
......
......@@ -7,7 +7,6 @@ import { drugSchema } from '@/models/drugSchema';
import { elementSearchResult, elementSearchResultType } from '@/models/elementSearchResult';
import { mapBackground } from '@/models/mapBackground';
import { mapOverlay } from '@/models/mapOverlay';
import { mirnaSchema } from '@/models/mirnaSchema';
import { mapModelSchema } from '@/models/modelSchema';
import { organism } from '@/models/organism';
import { overviewImageView } from '@/models/overviewImageView';
......@@ -26,7 +25,6 @@ export type MapBackground = z.infer<typeof mapBackground>;
export type Organism = z.infer<typeof organism>;
export type Disease = z.infer<typeof disease>;
export type Drug = z.infer<typeof drugSchema>;
export type Mirna = z.infer<typeof mirnaSchema>;
export type PinDetailsItem = z.infer<typeof targetSchema>;
export type BioEntity = z.infer<typeof bioEntitySchema>;
export type BioEntityContent = z.infer<typeof bioEntityContentSchema>;
......
export type PinType = 'chemicals' | 'drugs' | 'mirna' | 'bioEntity';
export type PinType = 'chemicals' | 'drugs' | 'bioEntity';
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment