Skip to content
Snippets Groups Projects

Feat/pin available submaps

Merged Mateusz Bolewski requested to merge feat/pin-available-submaps into development
1 unresolved thread
4 files
+ 87
4
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -9,6 +9,7 @@ import {
getReduxWrapperWithStore,
} from '@/utils/testing/getReduxWrapperWithStore';
import { render, screen } from '@testing-library/react';
// import { MODELS_MOCK_SHORT } from '@/models/mocks/modelsMock';
import { PinTypeWithNone } from '../PinsList.types';
import { PinsListItem } from './PinsListItem.component';
@@ -77,7 +78,7 @@ describe('PinsListItem - component ', () => {
expect(screen.getByText(secondPinReferenceResource, { exact: false })).toBeInTheDocument();
});
it('should display list of elements for pin for chemicals', () => {
renderComponent(CHEMICALS_PIN.name, CHEMICALS_PIN.pin, 'drugs');
renderComponent(CHEMICALS_PIN.name, CHEMICALS_PIN.pin, 'chemicals');
const firstPinElementType = chemicalsFixture[0].targets[0].targetParticipants[0].type;
const firstPinElementResource = chemicalsFixture[0].targets[0].targetParticipants[0].resource;
@@ -100,4 +101,14 @@ describe('PinsListItem - component ', () => {
expect(screen.queryByText(bioEntityName, { exact: false })).not.toBeInTheDocument();
});
it("should not display list of available submaps for pin when there aren't any submaps", () => {
const chemicalWithoutSubmaps = {
...CHEMICALS_PIN.pin,
targetElements: [],
};
renderComponent(CHEMICALS_PIN.name, chemicalWithoutSubmaps, 'chemicals');
expect(screen.queryByText('Available in submaps:')).toBeNull();
});
});
Loading