Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review 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
RadioObservatory
LOFAR
Commits
a14466e8
Commit
a14466e8
authored
1 year ago
by
Reinder Kraaij
Browse files
Options
Downloads
Patches
Plain Diff
added comment to unit test
parent
e933cfc8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1174
Resolve TMS-2810 "Test fixes part 3"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/components/PanelButtons.test.js
+14
-8
14 additions, 8 deletions
...ebapp/src/routes/Timeline/components/PanelButtons.test.js
with
14 additions
and
8 deletions
SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/components/PanelButtons.test.js
+
14
−
8
View file @
a14466e8
...
...
@@ -28,8 +28,8 @@ describe('PanelButtons', () => {
});
it
(
'
adjusts left panel size when summary is not active
'
,
async
()
=>
{
cons
t
setLeftPanelSizeMock
=
jest
.
fn
();
const
pannelComponent
=
render
(
<
PanelButtons
le
t
setLeftPanelSizeMock
=
jest
.
fn
();
const
pannelComponent
=
render
(
<
PanelButtons
showLegendbar
=
{
false
}
setShowLegendbar
=
{
jest
.
fn
()}
showListTabs
=
{
true
}
...
...
@@ -38,7 +38,7 @@ describe('PanelButtons', () => {
leftPanelSize
=
{
20
}
setLeftPanelSize
=
{
setLeftPanelSizeMock
}
/>
)
;
await
waitFor
(()
=>
expect
(
pannelComponent
.
getByTitle
(
shrinkLabel
).
tobeinTheDocument
));
await
waitFor
(()
=>
expect
(
pannelComponent
.
getByTitle
(
shrinkLabel
).
tobeinTheDocument
));
const
shrinkButton
=
pannelComponent
.
getByTitle
(
shrinkLabel
);
clickItem
(
shrinkButton
)
expect
(
setLeftPanelSizeMock
).
toHaveBeenCalledWith
(
10
);
// 10% shrink
...
...
@@ -47,11 +47,16 @@ describe('PanelButtons', () => {
clickItem
(
expandButton
)
expect
(
setLeftPanelSizeMock
).
toHaveBeenCalledWith
(
30
);
// 10% expand
setLeftPanelSizeMock
=
null
;
});
// this test can fail, allthough it's good. SOmething with Jest and React 18 running compatibility mode
it
(
'
disables resize buttons when summary is active
'
,
async
()
=>
{
const
pannelComponent
=
render
(
<
PanelButtons
let
pannelComponentb
=
render
(
<
PanelButtons
showLegendbar
=
{
false
}
setShowLegendbar
=
{
jest
.
fn
()}
showListTabs
=
{
true
}
...
...
@@ -60,12 +65,13 @@ describe('PanelButtons', () => {
leftPanelSize
=
{
20
}
setLeftPanelSize
=
{
jest
.
fn
()}
/>
)
;
await
waitFor
(()
=>
expect
(
pannelComponent
.
getByTitle
(
shrinkLabel
)));
const
shrinkButton
=
pannelComponent
.
getByTitle
(
shrinkLabel
);
await
waitFor
(()
=>
expect
(
pannelComponentb
.
getByTitle
(
shrinkLabel
).
tobeinTheDocument
));
const
shrinkButton
=
pannelComponentb
.
getByTitle
(
shrinkLabel
);
expect
(
shrinkButton
).
toHaveAttribute
(
"
disabled
"
)
const
expandButton
=
pannelComponent
.
getByTitle
(
expandLabel
);
const
expandButton
=
pannelComponent
b
.
getByTitle
(
expandLabel
);
expect
(
expandButton
).
toHaveAttribute
(
"
disabled
"
)
});
});
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment