Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
minerva
frontend
Merge requests
!71
Feat/bioentity from map
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Feat/bioentity from map
feat/bioentity-from-map
into
development
Overview
2
Commits
4
Pipelines
6
Changes
16
1 unresolved thread
Hide all comments
Merged
Mateusz Bolewski
requested to merge
feat/bioentity-from-map
into
development
1 year ago
Overview
2
Commits
4
Pipelines
6
Changes
16
1 unresolved thread
Hide all comments
Expand
Added BioEntity details in drawer after clicking on entry on map.
Screenshot:
0
0
Merge request reports
Compare
development
version 2
3e77ca1c
1 year ago
version 1
0dd63ec8
1 year ago
development (base)
and
latest version
latest version
ca33ca5a
4 commits,
1 year ago
version 2
3e77ca1c
3 commits,
1 year ago
version 1
0dd63ec8
2 commits,
1 year ago
16 files
+
342
−
5
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
16
Search (e.g. *.vue) (Ctrl+P)
src/components/Map/Drawer/BioEntityDrawer/BioEntityDrawer.component.test.tsx
0 → 100644
+
181
−
0
Options
/* eslint-disable no-magic-numbers */
import
{
InitialStoreState
,
getReduxWrapperWithStore
,
}
from
'
@/utils/testing/getReduxWrapperWithStore
'
;
import
{
render
,
screen
}
from
'
@testing-library/react
'
;
import
{
DRAWER_INITIAL_STATE
}
from
'
@/redux/drawer/drawer.constants
'
;
import
{
StoreType
}
from
'
@/redux/store
'
;
import
{
bioEntitiesContentFixture
,
bioEntityContentFixture
,
}
from
'
@/models/fixtures/bioEntityContentsFixture
'
;
import
{
FIRST_ARRAY_ELEMENT
}
from
'
@/constants/common
'
;
import
{
BioEntityDrawer
}
from
'
./BioEntityDrawer.component
'
;
const
renderComponent
=
(
initialStoreState
:
InitialStoreState
=
{}):
{
store
:
StoreType
}
=>
{
const
{
Wrapper
,
store
}
=
getReduxWrapperWithStore
(
initialStoreState
);
return
(
render
(
<
Wrapper
>
<
BioEntityDrawer
/>
</
Wrapper
>,
),
{
store
,
}
);
};
describe
(
'
BioEntityDrawer - component
'
,
()
=>
{
beforeEach
(()
=>
{
jest
.
resetAllMocks
();
jest
.
clearAllMocks
();
});
describe
(
"
when there's NO matching bioEntity
"
,
()
=>
{
beforeEach
(()
=>
renderComponent
({
bioEntity
:
{
data
:
[],
loading
:
'
succeeded
'
,
error
:
{
message
:
''
,
name
:
''
},
},
drawer
:
DRAWER_INITIAL_STATE
,
}),
);
it
(
'
should not show drawer content
'
,
()
=>
{
expect
(
screen
.
queryByText
(
'
Compartment:
'
)).
toBeNull
();
expect
(
screen
.
queryByText
(
'
Full name:
'
)).
toBeNull
();
expect
(
screen
.
queryByText
(
'
Annotations:
'
)).
toBeNull
();
expect
(
screen
.
queryByText
(
'
Source:
'
)).
toBeNull
();
});
});
describe
(
'
when there IS a matching bioEntity
'
,
()
=>
{
const
{
bioEntity
}
=
bioEntitiesContentFixture
[
FIRST_ARRAY_ELEMENT
];
it
(
'
should show drawer header
'
,
()
=>
{
renderComponent
({
bioEntity
:
{
data
:
[
{
searchQueryElement
:
''
,
loading
:
'
succeeded
'
,
error
:
{
name
:
''
,
message
:
''
},
data
:
bioEntitiesContentFixture
,
},
],
loading
:
'
succeeded
'
,
error
:
{
message
:
''
,
name
:
''
},
},
drawer
:
{
...
DRAWER_INITIAL_STATE
,
bioEntityDrawerState
:
{
bioentityId
:
bioEntity
.
id
,
},
},
});
expect
(
screen
.
getByText
(
bioEntity
.
stringType
,
{
exact
:
false
})).
toBeInTheDocument
();
expect
(
screen
.
getByText
(
bioEntity
.
name
,
{
exact
:
false
})).
toBeInTheDocument
();
});
it
(
'
should show drawer bioEntity full name
'
,
()
=>
{
renderComponent
({
bioEntity
:
{
data
:
[
{
searchQueryElement
:
''
,
loading
:
'
succeeded
'
,
error
:
{
name
:
''
,
message
:
''
},
data
:
[
{
...
bioEntityContentFixture
,
bioEntity
:
{
...
bioEntityContentFixture
.
bioEntity
,
fullName
:
'
BioEntity Full Name
'
,
},
},
],
},
],
loading
:
'
succeeded
'
,
error
:
{
message
:
''
,
name
:
''
},
},
drawer
:
{
...
DRAWER_INITIAL_STATE
,
bioEntityDrawerState
:
{
bioentityId
:
bioEntityContentFixture
.
bioEntity
.
id
,
},
},
});
expect
(
screen
.
getByText
(
'
Full name:
'
,
{
exact
:
false
})).
toBeInTheDocument
();
expect
(
screen
.
getByText
(
'
BioEntity Full Name
'
,
{
exact
:
false
})).
toBeInTheDocument
();
});
it
(
"
should not show drawer bioEntity full name if it doesn't exists
"
,
()
=>
{
renderComponent
({
bioEntity
:
{
data
:
[
{
searchQueryElement
:
''
,
loading
:
'
succeeded
'
,
error
:
{
name
:
''
,
message
:
''
},
data
:
[
{
...
bioEntityContentFixture
,
bioEntity
:
{
...
bioEntityContentFixture
.
bioEntity
,
fullName
:
null
,
},
},
],
},
],
loading
:
'
succeeded
'
,
error
:
{
message
:
''
,
name
:
''
},
},
drawer
:
{
...
DRAWER_INITIAL_STATE
,
bioEntityDrawerState
:
{
bioentityId
:
bioEntityContentFixture
.
bioEntity
.
id
,
},
},
});
expect
(
screen
.
queryByText
(
'
Full name:
'
)).
toBeNull
();
});
it
(
'
should show list of annotations
'
,
()
=>
{
renderComponent
({
bioEntity
:
{
data
:
[
{
searchQueryElement
:
''
,
loading
:
'
succeeded
'
,
error
:
{
name
:
''
,
message
:
''
},
data
:
bioEntitiesContentFixture
,
},
],
loading
:
'
succeeded
'
,
error
:
{
message
:
''
,
name
:
''
},
},
drawer
:
{
...
DRAWER_INITIAL_STATE
,
bioEntityDrawerState
:
{
bioentityId
:
bioEntity
.
id
,
},
},
});
expect
(
screen
.
getByText
(
'
Annotations:
'
)).
toBeInTheDocument
();
expect
(
screen
.
getByText
(
bioEntity
.
references
[
0
].
type
,
{
exact
:
false
})).
toBeInTheDocument
();
expect
(
screen
.
getByText
(
bioEntity
.
references
[
0
].
resource
,
{
exact
:
false
}),
).
toBeInTheDocument
();
});
});
});
Loading