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
863
Issues
863
List
Boards
Labels
Service Desk
Milestones
Merge Requests
50
Merge Requests
50
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
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
57595be0
Commit
57595be0
authored
10 minutes ago
by
Ben Hayward
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed flaking in newsfeed test
parent
76dd3659
feat/closed-channels-602
1 merge request
!499
Feat/closed channels 602
Pipeline
#77602779
running with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
17 deletions
+40
-17
newsfeed.spec.js
cypress/integration/newsfeed.spec.js
+40
-17
No files found.
cypress/integration/newsfeed.spec.js
View file @
57595be0
...
...
@@ -5,11 +5,14 @@ context('Newsfeed', () => {
if
(
sessionCookie
===
null
)
{
return
cy
.
login
(
true
);
}
});
});
})
beforeEach
(()
=>
{
cy
.
preserveCookies
();
cy
.
server
();
cy
.
route
(
"
POST
"
,
"
**/api/v1/newsfeed
"
).
as
(
"
newsfeedPOST
"
);
cy
.
route
(
"
POST
"
,
"
**/api/v1/media
"
).
as
(
"
mediaPOST
"
);
});
it
(
'
should post an activity picking hashtags from the dropdown
'
,
()
=>
{
...
...
@@ -26,14 +29,18 @@ context('Newsfeed', () => {
// type in another hashtag manually
cy
.
get
(
'
minds-newsfeed-poster m-hashtags-selector m-form-tags-input input
'
).
type
(
'
hashtag{enter}
'
).
click
();
// click away
cy
.
get
(
'
minds-newsfeed-poster m-hashtags-selector .minds-bg-overlay
'
).
click
();
// click away on arbitrary area.
cy
.
get
(
'
minds-newsfeed-poster m-hashtags-selector .minds-bg-overlay
'
).
click
({
force
:
true
});
// define request
cy
.
get
(
'
.m-posterActionBar__PostButton
'
).
click
();
//await response
cy
.
wait
(
'
@newsfeedPOST
'
).
then
((
xhr
)
=>
{
expect
(
xhr
.
status
).
to
.
equal
(
200
);
});
cy
.
wait
(
100
);
cy
.
get
(
'
.minds-list > minds-activity:first-child .message
'
).
contains
(
'
This is a post #art #hashtag
'
);
cy
.
get
(
'
.mdl-card__supporting-text.message.m-mature-message > span
'
).
first
().
contains
(
'
This is a post #art #hashtag
'
);
cy
.
get
(
'
.minds-list > minds-activity:first-child .message a:first-child
'
).
contains
(
'
#art
'
).
should
(
'
have.attr
'
,
'
href
'
,
'
/newsfeed/global/top;hashtag=art;period=24h
'
);
cy
.
get
(
'
.minds-list > minds-activity:first-child .message a:last-child
'
).
contains
(
'
#hashtag
'
).
should
(
'
have.attr
'
,
'
href
'
,
'
/newsfeed/global/top;hashtag=hashtag;period=24h
'
);
...
...
@@ -50,13 +57,18 @@ context('Newsfeed', () => {
cy
.
get
(
'
minds-newsfeed-poster textarea
'
).
type
(
'
This is a post with an image
'
);
cy
.
uploadFile
(
'
#attachment-input-poster
'
,
'
../fixtures/international-space-station-1776401_1920.jpg
'
,
'
image/jpg
'
);
cy
.
wait
(
1000
);
cy
.
wait
(
'
@mediaPOST
'
).
then
((
xhr
)
=>
{
expect
(
xhr
.
status
).
to
.
equal
(
200
);
});
cy
.
get
(
'
.m-posterActionBar__PostButton
'
).
click
();
cy
.
wait
(
300
);
//await response
cy
.
wait
(
'
@newsfeedPOST
'
).
then
((
xhr
)
=>
{
expect
(
xhr
.
status
).
to
.
equal
(
200
);
});
cy
.
get
(
'
.minds-list > minds-activity:first-child .message
'
).
contains
(
'
This is a post with an image
'
);
// assert image
...
...
@@ -83,7 +95,10 @@ context('Newsfeed', () => {
cy
.
get
(
'
.m-posterActionBar__PostButton
'
).
click
();
cy
.
wait
(
100
);
//await response
cy
.
wait
(
'
@newsfeedPOST
'
).
then
((
xhr
)
=>
{
expect
(
xhr
.
status
).
to
.
equal
(
200
);
});
// should have the mature text toggle
cy
.
get
(
'
.minds-list > minds-activity:first-child .message .m-mature-text-toggle
'
).
should
(
'
not.have.class
'
,
'
mdl-color-text--red-500
'
);
...
...
@@ -145,6 +160,7 @@ context('Newsfeed', () => {
})
it
(
'
should have a "Buy Tokens" button and it should redirect to /token
'
,
()
=>
{
cy
.
visit
(
'
/
'
);
cy
.
get
(
'
.m-page--sidebar--navigation a.m-page--sidebar--navigation--item:last-child span
'
)
.
contains
(
'
Buy Tokens
'
);
...
...
@@ -155,6 +171,8 @@ context('Newsfeed', () => {
})
it
(
'
"create blog" button in poster should redirect to /blog/edit/new
'
,
()
=>
{
cy
.
visit
(
'
/
'
);
cy
.
get
(
'
minds-newsfeed-poster .m-posterActionBar__CreateBlog
'
)
.
contains
(
'
Create blog
'
)
.
click
();
...
...
@@ -163,6 +181,8 @@ context('Newsfeed', () => {
})
it
(
'
clicking on "create blog" button in poster should prompt a confirm dialog and open a new blog with the currently inputted text
'
,
()
=>
{
cy
.
visit
(
'
/
'
);
cy
.
get
(
'
minds-newsfeed-poster textarea
'
).
type
(
'
thegreatmigration
'
);
// TODO: fix UX issue when hashtag element is overlapping input
const
stub
=
cy
.
stub
();
...
...
@@ -179,6 +199,8 @@ context('Newsfeed', () => {
})
it
(
'
should record a view when the user scrolls and an activity is visible
'
,
()
=>
{
cy
.
visit
(
'
/
'
);
cy
.
server
();
cy
.
route
(
"
POST
"
,
"
**/api/v2/analytics/views/activity/*
"
).
as
(
"
view
"
);
// create the post
...
...
@@ -186,12 +208,13 @@ context('Newsfeed', () => {
cy
.
get
(
'
.m-posterActionBar__PostButton
'
).
click
();
cy
.
wait
(
200
);
//await response
cy
.
wait
(
'
@newsfeedPOST
'
).
then
((
xhr
)
=>
{
expect
(
xhr
.
status
).
to
.
equal
(
200
);
});
cy
.
scrollTo
(
0
,
'
20px
'
);
cy
.
wait
(
600
);
cy
.
wait
(
'
@view
'
,
{
requestTimeout
:
2000
}).
then
((
xhr
)
=>
{
expect
(
xhr
.
status
).
to
.
equal
(
200
);
expect
(
xhr
.
response
.
body
).
to
.
deep
.
equal
({
status
:
'
success
'
});
...
...
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