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
!61
test(search): added missing tests for search flow
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
test(search): added missing tests for search flow
fix/search-bioentites-tests
into
development
Overview
10
Commits
4
Pipelines
8
Changes
18
8 unresolved threads
Hide all comments
Merged
Mateusz Bolewski
requested to merge
fix/search-bioentites-tests
into
development
1 year ago
Overview
10
Commits
4
Pipelines
8
Changes
18
8 unresolved threads
Hide all comments
Expand
Added tests files for search flow:
Bio Entities Accrodions
Pins List
Pin Details
Bio Entities Pins List
Bio Entities Pins Details
0
0
Merge request reports
Compare
development
version 3
c7cb3497
1 year ago
version 2
e410058e
1 year ago
version 1
907d7442
1 year ago
development (base)
and
latest version
latest version
5d2768ec
4 commits,
1 year ago
version 3
c7cb3497
3 commits,
1 year ago
version 2
e410058e
2 commits,
1 year ago
version 1
907d7442
1 commit,
1 year ago
18 files
+
568
−
89
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
18
Search (e.g. *.vue) (Ctrl+P)
src/components/Map/Drawer/SearchDrawerWrapper/BioEntitiesResultsList/BioEntitiesPinsList/BioEntitiesPinsListItem/BioEntitiesPinsListItem.component.test.tsx
0 → 100644
+
86
−
0
Options
/* eslint-disable no-magic-numbers */
import
{
render
,
screen
}
from
'
@testing-library/react
'
;
import
{
InitialStoreState
,
getReduxWrapperWithStore
,
}
from
'
@/utils/testing/getReduxWrapperWithStore
'
;
import
{
bioEntitiesContentFixture
}
from
'
@/models/fixtures/bioEntityContentsFixture
'
;
import
{
StoreType
}
from
'
@/redux/store
'
;
import
{
BioEntity
}
from
'
@/types/models
'
;
import
{
BioEntitiesPinsListItem
}
from
'
./BioEntitiesPinsListItem.component
'
;
const
BIO_ENTITY
=
bioEntitiesContentFixture
[
2
].
bioEntity
;
const
renderComponent
=
(
name
:
string
,
pin
:
BioEntity
,
initialStoreState
:
InitialStoreState
=
{},
):
{
store
:
StoreType
}
=>
{
const
{
Wrapper
,
store
}
=
getReduxWrapperWithStore
(
initialStoreState
);
return
(
render
(
<
Wrapper
>
<
BioEntitiesPinsListItem
name
=
{
name
}
pin
=
{
pin
}
/>
</
Wrapper
>,
),
{
store
,
}
);
};
describe
(
'
BioEntitiesPinsList - component
'
,
()
=>
{
it
(
'
should display name of bio entity element
'
,
()
=>
{
renderComponent
(
BIO_ENTITY
.
name
,
BIO_ENTITY
);
const
bioEntityName
=
bioEntitiesContentFixture
[
2
].
bioEntity
.
fullName
||
''
;
expect
(
screen
.
getByText
(
bioEntityName
,
{
exact
:
false
})).
toBeInTheDocument
();
});
it
(
'
should display symbol of bio entity element
'
,
()
=>
{
renderComponent
(
BIO_ENTITY
.
name
,
BIO_ENTITY
);
const
bioEntitySymbol
=
BIO_ENTITY
.
symbol
||
''
;
expect
(
screen
.
getByText
(
bioEntitySymbol
,
{
exact
:
false
})).
toBeInTheDocument
();
});
it
(
'
should display empty string when symbol does not exist
'
,
()
=>
{
renderComponent
(
bioEntitiesContentFixture
[
1
].
bioEntity
.
name
,
bioEntitiesContentFixture
[
1
].
bioEntity
,
);
expect
(
screen
.
getAllByTestId
(
'
bio-entity-symbol
'
)[
0
].
textContent
).
toHaveLength
(
0
);
});
it
(
'
should display string type of bio entity element
'
,
()
=>
{
renderComponent
(
BIO_ENTITY
.
name
,
BIO_ENTITY
);
const
bioEntityStringType
=
bioEntitiesContentFixture
[
2
].
bioEntity
.
stringType
;
expect
(
screen
.
getByText
(
bioEntityStringType
,
{
exact
:
false
})).
toBeInTheDocument
();
});
it
(
'
should display synonyms of bio entity element
'
,
()
=>
{
renderComponent
(
BIO_ENTITY
.
name
,
BIO_ENTITY
);
const
firstBioEntitySynonym
=
bioEntitiesContentFixture
[
2
].
bioEntity
.
synonyms
[
0
];
const
secondBioEntitySynonym
=
bioEntitiesContentFixture
[
2
].
bioEntity
.
synonyms
[
1
];
expect
(
screen
.
getByText
(
firstBioEntitySynonym
,
{
exact
:
false
})).
toBeInTheDocument
();
expect
(
screen
.
getByText
(
secondBioEntitySynonym
,
{
exact
:
false
})).
toBeInTheDocument
();
});
it
(
'
should display list of references for pin
'
,
()
=>
{
renderComponent
(
BIO_ENTITY
.
name
,
BIO_ENTITY
);
const
firstPinReferenceType
=
bioEntitiesContentFixture
[
2
].
bioEntity
.
references
[
0
].
type
;
const
firstPinReferenceResource
=
bioEntitiesContentFixture
[
2
].
bioEntity
.
references
[
0
].
resource
;
const
secondPinReferenceType
=
bioEntitiesContentFixture
[
2
].
bioEntity
.
references
[
1
].
type
;
const
secondPinReferenceResource
=
bioEntitiesContentFixture
[
2
].
bioEntity
.
references
[
1
].
resource
;
expect
(
screen
.
getByText
(
firstPinReferenceType
,
{
exact
:
false
})).
toBeInTheDocument
();
expect
(
screen
.
getByText
(
firstPinReferenceResource
,
{
exact
:
false
})).
toBeInTheDocument
();
expect
(
screen
.
getByText
(
secondPinReferenceType
,
{
exact
:
false
})).
toBeInTheDocument
();
expect
(
screen
.
getByText
(
secondPinReferenceResource
,
{
exact
:
false
})).
toBeInTheDocument
();
});
});
Loading