Skip to content
GitLab
Explore
Sign in
Register
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
2f1ed9c6
Commit
2f1ed9c6
authored
1 year ago
by
Reinder Kraaij
Browse files
Options
Downloads
Patches
Plain Diff
add jest to env for babel
parent
f5317959
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1188
TMSS-2810 "Multiple TMSS FrontEnd Unit tests Fixed"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
SAS/TMSS/frontend/tmss_webapp/.eslintrc.js
+6
-1
6 additions, 1 deletion
SAS/TMSS/frontend/tmss_webapp/.eslintrc.js
SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/helpers/toolbar/filters.helper.test.js
+20
-15
20 additions, 15 deletions
...rc/routes/Timeline/helpers/toolbar/filters.helper.test.js
with
26 additions
and
16 deletions
SAS/TMSS/frontend/tmss_webapp/.eslintrc.js
+
6
−
1
View file @
2f1ed9c6
module
.
exports
=
{
"
env
"
:
{
"
browser
"
:
true
,
"
es2021
"
:
true
"
es2021
"
:
true
,
"
node
"
:
true
,
"
jasmine
"
:
true
,
"
jest
"
:
true
,
"
es6
"
:
true
},
},
"
extends
"
:
[
"
eslint:recommended
"
,
"
plugin:react/recommended
"
],
"
plugins
"
:
[
...
...
This diff is collapsed.
Click to expand it.
SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/helpers/toolbar/filters.helper.test.js
+
20
−
15
View file @
2f1ed9c6
...
...
@@ -5,6 +5,7 @@ import {
splitObjectIfSpanIsMultipleDays
}
from
"
./filters.helper
"
;
import
moment
from
"
moment/moment
"
;
import
renderer
from
'
react-test-renderer
'
;
jest
.
mock
(
'
moment
'
,
()
=>
{
const
originalMoment
=
jest
.
requireActual
(
'
moment
'
);
...
...
@@ -176,7 +177,7 @@ describe("getTimelineItem", () => {
const
suBlueprint
=
{
id
:
"
blueprint-id
"
,
description
:
"
test blueprint
"
,
description
:
"
test blueprint
"
,
process_start_time
:
"
2023-07-06T10:00:00Z
"
,
on_sky_start_time
:
"
2023-07-06T10:00:00Z
"
,
tasks
:
tasks
,
...
...
@@ -188,12 +189,12 @@ describe("getTimelineItem", () => {
process_stop_time
:
"
2023-07-06T12:00:00Z
"
,
on_sky_stop_time
:
"
2023-07-06T12:00:00Z
"
,
real_start_time
:
"
2023-07-06T12:01:00Z
"
,
real_end_time
:
"
2023-07-06T12:02:00Z
"
,
real_end_time
:
"
2023-07-06T12:02:00Z
"
,
placed
:
true
,
unschedulable_reason
:
"
none
"
,
scheduling_constraints_doc
:
{
scheduler
:
"
fixed
"
},
antenna_set
:
"
antenna_set_value
"
,
scheduler
:
"
fixed
"
antenna_set
:
"
antenna_set_value
"
,
scheduler
:
"
fixed
"
};
const
displayDate
=
moment
(
"
2023-07-06
"
,
"
YYYY-MM-DD
"
)
...
...
@@ -205,8 +206,8 @@ describe("getTimelineItem", () => {
id
:
"
blueprint-id-27: Jul 06 - Thu
"
,
suId
:
"
blueprint-id
"
,
group
:
"
27: Jul 06 - Thu
"
,
band
:
"
antenna
"
,
desc
:
"
test blueprint
"
,
band
:
"
antenna
"
,
desc
:
"
test blueprint
"
,
title
:
""
,
project
:
"
bugs
"
,
name
:
"
the_fix_1
"
,
...
...
@@ -216,8 +217,8 @@ describe("getTimelineItem", () => {
start_time
:
moment
(
"
2023-07-06 10:00:00Z
"
),
end_time
:
moment
(
"
2023-07-06 12:00:00Z
"
),
real_start_time
:
"
2023-07-06T12:01:00Z
"
,
real_end_time
:
"
2023-07-06T12:02:00Z
"
,
stations
:
"
-
"
,
real_end_time
:
"
2023-07-06T12:02:00Z
"
,
stations
:
"
-
"
,
type
:
"
SCHEDULE
"
,
status
:
"
defined
"
,
scheduler
:
"
fixed
"
,
...
...
@@ -226,7 +227,7 @@ describe("getTimelineItem", () => {
});
it
(
"
returns the correct item object when antenna set is not provided
"
,
()
=>
{
let
suBlueprintWithoutAntennaSet
=
{
...
suBlueprint
,
...
...
@@ -239,14 +240,14 @@ describe("getTimelineItem", () => {
}
]
};
suBlueprintWithoutAntennaSet
.
antenna_set
=
undefined
;
suBlueprintWithoutAntennaSet
.
antenna_set
=
undefined
;
const
item
=
getTimelineItem
(
suBlueprintWithoutAntennaSet
,
displayDate
);
expect
(
item
).
toEqual
({
id
:
"
blueprint-id-27: Jul 06 - Thu
"
,
suId
:
"
blueprint-id
"
,
band
:
undefined
,
desc
:
"
test blueprint
"
,
band
:
undefined
,
desc
:
"
test blueprint
"
,
group
:
"
27: Jul 06 - Thu
"
,
title
:
""
,
project
:
"
bugs
"
,
...
...
@@ -254,22 +255,24 @@ describe("getTimelineItem", () => {
antenna_set
:
undefined
,
scheduler
:
"
fixed
"
,
duration
:
"
1.00Hrs
"
,
stations
:
"
-
"
,
stations
:
"
-
"
,
on_sky_duration
:
"
2.00Hrs
"
,
start_time
:
moment
(
"
2023-07-06 10:00:00Z
"
),
end_time
:
moment
(
"
2023-07-06 12:00:00Z
"
),
real_start_time
:
"
2023-07-06T12:01:00Z
"
,
real_end_time
:
"
2023-07-06T12:02:00Z
"
,
real_end_time
:
"
2023-07-06T12:02:00Z
"
,
type
:
"
SCHEDULE
"
,
status
:
"
defined
"
,
unschedulable_reason
:
"
none
"
});
});
});
describe
(
'
getReservationItem
'
,
()
=>
{
let
reservation
=
{
id
:
'
1
'
,
name
:
'
green grass
'
,
...
...
@@ -289,6 +292,7 @@ describe('getReservationItem', () => {
description
:
'
with a grass mower
'
};
let
expectedItem
=
{
id
:
"
Res-1-Aug 08 - Tue
"
,
start_time
:
moment
(
'
2023-08-08 10:00:00
'
),
...
...
@@ -307,6 +311,7 @@ describe('getReservationItem', () => {
stations
:
'
-
'
};
const
displayDate
=
moment
(
'
2023-08-08
'
,
'
YYYY-MM-DD
'
);
// TODO : Fix Unit Test should return the correct reservation item (no stations)
...
...
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