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
894
Issues
894
List
Boards
Labels
Service Desk
Milestones
Merge Requests
45
Merge Requests
45
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
fe3fcb81
Commit
fe3fcb81
authored
2 hours ago
by
Juan Manuel Solaro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(fix) add new e2e test and change message for poster
parent
ff893b0f
epic/post-scheduler
1 merge request
!494
WIP: epic/post-scheduler
Pipeline
#81086493
failed with stages
in 6 minutes and 25 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
4 deletions
+37
-4
newsfeed.spec.js
cypress/integration/newsfeed.spec.js
+36
-3
selector.component.ts
...mon/components/poster-date-selector/selector.component.ts
+1
-1
No files found.
cypress/integration/newsfeed.spec.js
View file @
fe3fcb81
...
...
@@ -38,14 +38,15 @@ context('Newsfeed', () => {
cy
.
get
(
'
.minds-list > minds-activity:first-child m-post-menu m-modal-confirm .mdl-button--colored
'
).
click
();
})
it
(
'
should
post an activity picking a scheduled date
'
,
()
=>
{
it
(
'
should
be able to post an activity picking a scheduled date and the edit it
'
,
()
=>
{
cy
.
get
(
'
minds-newsfeed-poster
'
).
should
(
'
be.visible
'
);
cy
.
get
(
'
minds-newsfeed-poster textarea
'
).
type
(
'
This is a post
'
);
// set scheduled date
cy
.
get
(
'
.m-poster-date-selector--input
'
).
click
();
cy
.
get
(
'
td.c-datepicker__day-body.c-datepicker__day--selected + td
'
).
click
();
cy
.
get
(
'
button.c-datepicker__next
'
).
click
();
cy
.
get
(
'
tr.c-datepicker__days-row:nth-child(2) td.c-datepicker__day-body:first-child
'
).
click
();
cy
.
get
(
'
a.c-btn.c-btn--flat.js-ok
'
).
click
();
// get setted date to compare
...
...
@@ -66,7 +67,39 @@ context('Newsfeed', () => {
scheduledDate
=
new
Date
(
scheduledDate
).
getTime
();
expect
(
scheduledDate
).
to
.
equal
(
time_created
);
});
// prepare to listen
cy
.
server
();
cy
.
route
(
"
POST
"
,
'
**/api/v1/newsfeed/**
'
).
as
(
"
saveEdited
"
);
// edit the activity
cy
.
get
(
'
.minds-list > minds-activity:first-child m-post-menu > button.minds-more
'
).
click
();
cy
.
get
(
'
.minds-list > minds-activity:first-child li.mdl-menu__item:first-child
'
).
click
();
cy
.
get
(
'
.minds-list > minds-activity:first-child .m-poster-date-selector--input
'
).
click
();
cy
.
get
(
'
button.c-datepicker__next
'
).
click
();
cy
.
get
(
'
tr.c-datepicker__days-row:nth-child(3) td.c-datepicker__day-body:first-child
'
).
click
();
cy
.
get
(
'
a.c-btn.c-btn--flat.js-ok
'
).
click
();
// get setted date to compare
cy
.
get
(
'
.minds-list > minds-activity:first-child div.m-poster-date-selector--input div.m-tooltip--bubble
'
)
.
invoke
(
'
text
'
).
then
((
text
)
=>
{
scheduledDate
=
text
;
});
// compare setted date with time_created
cy
.
get
(
'
.minds-list > minds-activity:first-child div.mdl-card__supporting-text > div.body > a.permalink > span
'
)
.
invoke
(
'
text
'
).
then
((
text
)
=>
{
const
time_created
=
new
Date
(
text
).
getTime
();
scheduledDate
=
new
Date
(
scheduledDate
).
getTime
();
expect
(
scheduledDate
).
to
.
equal
(
time_created
);
});
// Save
cy
.
get
(
'
.minds-list > minds-activity:first-child button.mdl-button.mdl-button--colored
'
).
click
();
cy
.
wait
(
'
@saveEdited
'
,
{
requestTimeout
:
5000
}).
then
((
xhr
)
=>
{
expect
(
xhr
.
status
).
to
.
equal
(
200
,
'
**/api/v1/newsfeed/** request status
'
);
});
// cleanup
cy
.
get
(
'
.minds-list > minds-activity:first-child m-post-menu .minds-more
'
).
click
();
cy
.
get
(
'
.minds-list > minds-activity:first-child m-post-menu .minds-dropdown-menu .mdl-menu__item:nth-child(4)
'
).
click
();
...
...
This diff is collapsed.
Click to expand it.
src/app/common/components/poster-date-selector/selector.component.ts
View file @
fe3fcb81
...
...
@@ -43,7 +43,7 @@ export class PosterDateSelectorComponent {
const
fiveMinutes
=
new
Date
();
fiveMinutes
.
setMinutes
(
fiveMinutes
.
getMinutes
()
+
5
);
if
(
date
<
fiveMinutes
)
{
return
"
Scheduled date can't be less than 5 minutes
"
;
return
"
Scheduled date can't be less than 5 minutes
or in the past
"
;
}
return
true
;
...
...
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