Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
888
Issues
888
List
Boards
Labels
Service Desk
Milestones
Merge Requests
50
Merge Requests
50
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Frontend
Commits
ab9e5db0
Commit
ab9e5db0
authored
3 hours ago
by
Juan Manuel Solaro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(fix) update scheduler tests
parent
52a199f0
epic/post-scheduler
1 merge request
!494
WIP: epic/post-scheduler
Pipeline
#79821524
failed with stages
in 6 minutes and 56 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
4 deletions
+29
-4
selector.component.spec.ts
...omponents/poster-date-selector/selector.component.spec.ts
+29
-4
No files found.
src/app/common/components/poster-date-selector/selector.component.spec.ts
View file @
ab9e5db0
...
...
@@ -53,9 +53,34 @@ describe('PosterDateSelectorComponent', () => {
it
(
'
should emit when onDateChange is called
'
,
fakeAsync
(()
=>
{
spyOn
(
comp
.
dateChange
,
'
emit
'
);
comp
.
onDateChange
(
'
8/1/19, 11:00 AM
'
);
let
newDate
=
new
Date
(
'
8/1/19, 11:00 AM
'
).
getTime
();
newDate
=
Math
.
floor
(
+
newDate
/
1000
);
expect
(
comp
.
dateChange
.
emit
).
toHaveBeenCalledWith
(
newDate
);
const
testDate
=
new
Date
();
testDate
.
setMonth
(
testDate
.
getMonth
()
+
1
);
comp
.
onDateChange
(
testDate
.
toString
());
let
timeDate
=
testDate
.
getTime
();
timeDate
=
Math
.
floor
(
timeDate
/
1000
);
expect
(
comp
.
dateChange
.
emit
).
toHaveBeenCalledWith
(
timeDate
);
}));
it
(
'
should emit onError when date more than 3 months
'
,
fakeAsync
(()
=>
{
spyOn
(
comp
.
onError
,
'
emit
'
);
const
testDate
=
new
Date
();
testDate
.
setMonth
(
testDate
.
getMonth
()
+
4
);
comp
.
onDateChange
(
testDate
.
toString
());
let
timeDate
=
testDate
.
getTime
();
timeDate
=
Math
.
floor
(
timeDate
/
1000
);
expect
(
comp
.
onError
.
emit
).
toHaveBeenCalledWith
(
"
Scheduled date can't be 3 months or more
"
);
}));
it
(
'
should emit onError when date less than 5 minutes
'
,
fakeAsync
(()
=>
{
spyOn
(
comp
.
onError
,
'
emit
'
);
const
testDate
=
new
Date
();
comp
.
onDateChange
(
testDate
.
toString
());
let
timeDate
=
testDate
.
getTime
();
timeDate
=
Math
.
floor
(
timeDate
/
1000
);
expect
(
comp
.
onError
.
emit
).
toHaveBeenCalledWith
(
"
Scheduled date can't be less than 5 minutes
"
);
}));
});
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment