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
871
Issues
871
List
Boards
Labels
Service Desk
Milestones
Merge Requests
55
Merge Requests
55
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
4157b7cf
Commit
4157b7cf
authored
30 minutes ago
by
Brian Hatchet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimizing unit tests
parent
80b21460
feat/closed-channels-602
1 merge request
!499
Feat/closed channels 602
Pipeline
#77384023
running with stages
Changes
13
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
114 additions
and
139 deletions
+114
-139
blogs.spec.js
cypress/integration/blogs.spec.js
+8
-12
boost-console.spec.js
cypress/integration/boost/boost-console.spec.js
+18
-22
boost-impressions.spec.js
cypress/integration/boost/boost-impressions.spec.js
+10
-23
channel.spec.js
cypress/integration/channel/channel.spec.js
+6
-5
comment-threads.spec.js
cypress/integration/comment-threads.spec.js
+26
-37
discovery.spec.js
cypress/integration/discovery.spec.js
+9
-16
groups.spec.js
cypress/integration/groups.spec.js
+6
-5
newsfeed.spec.js
cypress/integration/newsfeed.spec.js
+6
-5
onboarding.spec.js
cypress/integration/onboarding.spec.js
+1
-0
remind.spec.js
cypress/integration/remind.spec.js
+6
-5
topbar.spec.js
cypress/integration/topbar.spec.js
+6
-5
wire.spec.js
cypress/integration/wire.spec.js
+6
-4
commands.js
cypress/support/commands.js
+6
-0
No files found.
cypress/integration/blogs.spec.js
View file @
4157b7cf
...
...
@@ -2,14 +2,15 @@
context
(
'
Blogs
'
,
()
=>
{
before
(()
=>
{
if
(
cy
.
getCookie
(
'
minds_sess
'
)
===
null
)
{
cy
.
login
(
true
);
cy
.
location
(
'
pathname
'
,
{
timeout
:
30000
})
.
should
(
'
eq
'
,
`/newsfeed/subscriptions`
);
}
})
cy
.
getCookie
(
'
minds_sess
'
)
.
then
((
sessionCookie
)
=>
{
if
(
sessionCookie
===
null
)
{
cy
.
login
(
true
);
}
});
});
it
(
'
should not be able to create a new blog if no title or banner are specified
'
,
()
=>
{
it
(
'
should not be able to create a new blog if no title or banner are specified
'
,
()
=>
{
cy
.
visit
(
'
/blog/edit/new
'
);
cy
.
get
(
'
.m-button--submit
'
).
click
();
...
...
@@ -108,11 +109,6 @@ context('Blogs', () => {
cy
.
get
(
'
.m-mature-info a span
'
).
contains
(
'
Mature content
'
);
cy
.
get
(
'
.m-button--submit
'
).
click
({
force
:
true
});
// TODO: Investigate why disabled flag is being detected
cy
.
clock
();
cy
.
clock
().
then
((
clock
)
=>
{
clock
.
tick
(
1000
);
});
cy
.
wait
(
1000
);
cy
.
location
(
'
pathname
'
,
{
timeout
:
30000
})
.
should
(
'
contains
'
,
`/
${
Cypress
.
env
().
username
}
/blog`
);
...
...
This diff is collapsed.
Click to expand it.
cypress/integration/boost/boost-console.spec.js
View file @
4157b7cf
...
...
@@ -2,31 +2,26 @@ context('Boost Console', () => {
const
postContent
=
"
Test boost, please reject...
"
+
Math
.
random
().
toString
(
36
);
before
(()
=>
{
if
(
cy
.
getCookie
(
'
minds_sess
'
)
===
null
)
{
cy
.
login
(
true
);
cy
.
wait
(
5000
);
}
cy
.
getCookie
(
'
minds_sess
'
)
.
then
((
sessionCookie
)
=>
{
if
(
sessionCookie
===
null
)
{
cy
.
login
(
true
);
}
});
});
beforeEach
(()
=>
{
cy
.
visit
(
'
/newsfeed/subscriptions
'
);
cy
.
wait
(
3000
);
cy
.
location
(
'
pathname
'
,
{
timeout
:
30000
})
.
should
(
'
eq
'
,
`/newsfeed/subscriptions`
);
cy
.
visit
(
'
/newsfeed/subscribed
'
);
newBoost
(
postContent
,
100
);
});
it
(
'
should show a new boost in the console
'
,
()
=>
{
cy
.
visit
(
'
/boost/console/newsfeed/history
'
);
cy
.
wait
(
3000
);
cy
.
get
(
'
m-boost-console-card:nth-child(1) div.m-boost-card--manager-item.m-boost-card--state
'
)
.
should
(
'
not.contain
'
,
'
revoked
'
);
cy
.
get
(
'
m-boost-console-card:nth-child(1) .m-boost-card--manager-item--buttons > button
'
)
.
click
();
cy
.
wait
(
1000
);
cy
.
get
(
'
m-boost-console-card:nth-child(1) .m-mature-message span
'
)
.
contains
(
postContent
);
});
...
...
@@ -38,7 +33,6 @@ context('Boost Console', () => {
cy
.
get
(
'
m-boost-console-card:nth-child(1) .m-boost-card--manager-item--buttons > button
'
)
.
click
();
cy
.
wait
(
1000
);
cy
.
get
(
'
m-boost-console-card:nth-child(1) div.m-boost-card--manager-item.m-boost-card--state
'
)
.
contains
(
'
revoked
'
);
...
...
@@ -46,29 +40,31 @@ context('Boost Console', () => {
function
navToConsole
()
{
cy
.
visit
(
'
/boost/console/newsfeed/history
'
);
cy
.
wait
(
3000
);
cy
.
location
(
'
pathname
'
,
{
timeout
:
30000
})
.
should
(
'
eq
'
,
`/boost/console/newsfeed/history`
);
}
function
newBoost
(
text
,
views
)
{
cy
.
server
();
cy
.
route
(
"
POST
"
,
'
**/api/v2/boost/**
'
).
as
(
'
boostPost
'
);
cy
.
post
(
text
);
cy
.
wait
(
2000
);
cy
.
get
(
'
#boost-actions
'
)
.
first
()
.
click
();
cy
.
wait
(
5000
);
cy
.
get
(
'
.m-boost--creator-section-amount input
'
)
.
type
(
views
);
cy
.
get
(
'
m-overlay-modal > div.m-overlay-modal > m-boost--creator button
'
)
.
click
();
cy
.
wait
(
5000
);
cy
.
wait
(
'
@boostPost
'
,
{
requestTimeout
:
5000
}).
then
((
xhr
)
=>
{
cy
.
log
(
xhr
);
expect
(
xhr
.
status
).
to
.
equal
(
200
);
expect
(
xhr
.
response
.
body
.
status
).
to
.
deep
.
equal
(
"
success
"
);
});
cy
.
get
(
'
.m-overlay-modal
'
)
.
should
(
'
not.be.visible
'
)
}
...
...
This diff is collapsed.
Click to expand it.
cypress/integration/boost/boost-impressions.spec.js
View file @
4157b7cf
context
(
'
Boost Impressions
'
,
()
=>
{
before
(()
=>
{
if
(
cy
.
getCookie
(
'
minds_sess
'
)
===
null
)
{
cy
.
login
(
true
);
}
}
);
beforeEach
(()
=>
{
cy
.
getCookie
(
'
minds_sess
'
)
.
then
((
sessionCookie
)
=>
{
if
(
sessionCookie
===
null
)
{
cy
.
login
(
true
);
}
});
cy
.
visit
(
'
/newsfeed/subscriptions
'
);
cy
.
wait
(
3000
);
cy
.
location
(
'
pathname
'
,
{
timeout
:
30000
})
.
should
(
'
eq
'
,
`/newsfeed/subscriptions`
);
});
...
...
@@ -19,45 +18,33 @@ context('Boost Impressions', () => {
cy
.
route
(
"
POST
"
,
"
**/api/v2/analytics/views/activity/*
"
).
as
(
"
analytics
"
);
//load, scroll, wait to trigger analytics
cy
.
wait
(
3000
);
cy
.
scrollTo
(
0
,
500
);
cy
.
wait
(
3000
);
//assert
cy
.
wait
(
'
@analytics
'
,
{
requestTimeout
:
5000
}
).
then
((
xhr
)
=>
{
cy
.
wait
(
'
@analytics
'
).
then
((
xhr
)
=>
{
expect
(
xhr
.
status
).
to
.
equal
(
200
);
expect
(
xhr
.
response
.
body
).
to
.
deep
.
equal
({
status
:
'
success
'
});
});
});
it
(
'
should register views on boost rotate
forward
'
,
()
=>
{
it
(
'
should register views on boost rotate
'
,
()
=>
{
//stub endpoint
cy
.
server
();
cy
.
route
(
"
POST
"
,
"
**/api/v2/analytics/views/boost/*
"
).
as
(
"
analytics
"
);
cy
.
wait
(
3000
);
//rotate forward and wait to trigger analytics
cy
.
get
(
'
m-newsfeed--boost-rotator > div > ul > li:nth-child(
2
) > i
'
)
cy
.
get
(
'
m-newsfeed--boost-rotator > div > ul > li:nth-child(
3
) > i
'
)
.
click
();
cy
.
wait
(
3000
);
//assert
cy
.
wait
(
'
@analytics
'
,
{
requestTimeout
:
5000
}).
then
((
xhr
)
=>
{
expect
(
xhr
.
status
).
to
.
equal
(
200
);
expect
(
xhr
.
response
.
body
.
status
).
to
.
deep
.
equal
(
"
success
"
);
});
});
it
.
only
(
'
should register views on boost rotate backward
'
,
()
=>
{
//stub endpoint
cy
.
server
();
cy
.
route
(
"
POST
"
,
"
**/api/v2/analytics/views/boost/*
"
).
as
(
"
analytics
"
);
cy
.
wait
(
3000
);
//rotate forward and wait to trigger analytics
cy
.
get
(
'
m-newsfeed--boost-rotator >
.m-boost-rotator-tabs > li:nth-child(1
) > i
'
)
cy
.
get
(
'
m-newsfeed--boost-rotator >
div > ul > li:nth-child(2
) > i
'
)
.
click
();
cy
.
wait
(
3000
);
//assert
cy
.
wait
(
'
@analytics
'
,
{
requestTimeout
:
5000
}).
then
((
xhr
)
=>
{
...
...
This diff is collapsed.
Click to expand it.
cypress/integration/channel/channel.spec.js
View file @
4157b7cf
context
(
'
Channel
'
,
()
=>
{
before
(()
=>
{
if
(
cy
.
getCookie
(
'
minds_sess
'
)
===
null
)
{
cy
.
login
(
true
);
cy
.
location
(
'
pathname
'
,
{
timeout
:
30000
})
.
should
(
'
eq
'
,
`/newsfeed/subscriptions`
);
}
cy
.
getCookie
(
'
minds_sess
'
)
.
then
((
sessionCookie
)
=>
{
if
(
sessionCookie
===
null
)
{
cy
.
login
(
true
);
}
});
cy
.
visit
(
`/
${
Cypress
.
env
().
username
}
`
);
})
...
...
This diff is collapsed.
Click to expand it.
cypress/integration/comment-threads.spec.js
View file @
4157b7cf
...
...
@@ -34,71 +34,68 @@ context('Comment Threads', () => {
before
(()
=>
{
//make a post new.
if
(
cy
.
getCookie
(
'
minds_sess
'
)
===
null
)
{
login
();
}
cy
.
getCookie
(
'
minds_sess
'
)
.
then
((
sessionCookie
)
=>
{
if
(
sessionCookie
===
null
)
{
cy
.
login
(
true
);
}
});
cy
.
visit
(
'
/newsfeed/subscriptions
'
);
cy
.
location
(
'
pathname
'
,
{
timeout
:
30000
})
.
should
(
'
eq
'
,
`/newsfeed/subscriptions`
);
cy
.
post
(
'
test post
'
);
//manually sign-out.
cy
.
get
(
hamburgerMenu
).
click
();
cy
.
get
(
logoutButton
).
click
();
cy
.
get
(
commentButton
(
1
)).
click
();
});
after
(()
=>
{
/*
after(() => {
//delete the post
cy.wait(1000);
cy.get(postMenu).click();
cy.get(deletePostOption).click();
cy.get(deletePostButton).click();
});
beforeEach
(()
=>
{
login
();
cy
.
wait
(
2000
);
});
});*/
it
(
'
should allow a user to post a tier 1 comment
'
,
()
=>
{
cy
.
get
(
commentButton
(
2
)).
click
();
cy
.
get
(
commentInput
(
2
)).
type
(
testMessage
[
1
]);
cy
.
get
(
commentInput
(
1
)).
type
(
testMessage
[
1
]);
cy
.
get
(
postCommentButton
).
click
();
cy
.
get
(
commentContent
(
2
)).
contains
(
testMessage
[
1
]);
cy
.
get
(
commentContent
(
1
)).
contains
(
testMessage
[
1
]);
});
it
(
'
should allow a user to post a tier 2 comment
'
,
()
=>
{
//expand top comment, then top reply button.
cy
.
get
(
commentButton
(
2
)).
click
();
cy
.
get
(
replyButton
(
2
)).
click
();
cy
.
get
(
commentInput
(
2
)).
first
().
type
(
testMessage
[
2
]);
cy
.
get
(
replyButton
(
1
)).
click
();
cy
.
get
(
commentInput
(
1
)).
first
().
type
(
testMessage
[
2
]);
cy
.
get
(
postCommentButton
).
first
().
click
();
cy
.
get
(
commentContent
(
2
)).
contains
(
testMessage
[
2
]);
cy
.
get
(
commentContent
(
1
)).
contains
(
testMessage
[
2
]);
});
it
(
'
should allow a user to post a tier 3 comment
'
,
()
=>
{
//expand top comment, then top reply button.
cy
.
get
(
commentButton
(
2
)).
click
();
cy
.
get
(
replyButton
(
2
)).
click
();
cy
.
get
(
replyButton
(
1
)).
click
();
cy
.
wait
(
1000
);
//there are two reply buttons now, use the last one.
cy
.
get
(
replyButton
(
2
)).
last
().
click
();
cy
.
get
(
replyButton
(
1
)).
last
().
click
();
cy
.
wait
(
1000
);
//check the comments.
cy
.
get
(
commentInput
(
2
)).
first
().
type
(
testMessage
[
3
]);
cy
.
get
(
commentInput
(
1
)).
first
().
type
(
testMessage
[
3
]);
cy
.
get
(
postCommentButton
).
first
().
click
();
cy
.
get
(
commentContent
(
2
)).
contains
(
testMessage
[
3
]);
cy
.
get
(
commentContent
(
1
)).
contains
(
testMessage
[
3
]);
});
it
(
'
should allow the user to vote up and down comments
'
,
()
=>
{
//expand top comment, then top reply button.
cy
.
get
(
commentButton
(
2
)).
click
();
cy
.
get
(
replyButton
(
2
)).
click
();
cy
.
get
(
replyButton
(
1
)).
click
();
cy
.
wait
(
1000
);
//there are two reply buttons now, use the last one.
cy
.
get
(
replyButton
(
2
)).
last
().
click
();
cy
.
get
(
replyButton
(
1
)).
last
().
click
();
cy
.
wait
(
1000
);
//click thumbs up and down
...
...
@@ -112,12 +109,4 @@ context('Comment Threads', () => {
.
each
((
counter
)
=>
expect
(
counter
.
context
.
innerHTML
).
to
.
eql
(
'
1
'
));
});
function
login
()
{
cy
.
login
(
true
);
cy
.
location
(
'
pathname
'
,
{
timeout
:
30000
})
.
should
(
'
eq
'
,
`/newsfeed/subscriptions`
);
cy
.
get
(
channelButton
).
click
();
}
})
This diff is collapsed.
Click to expand it.
cypress/integration/discovery.spec.js
View file @
4157b7cf
context
(
'
Discovery
'
,
()
=>
{
before
(()
=>
{
if
(
cy
.
getCookie
(
'
minds_sess
'
)
===
null
)
{
cy
.
login
(
true
);
cy
.
location
(
'
pathname
'
,
{
timeout
:
30000
})
.
should
(
'
eq
'
,
`/newsfeed/subscriptions`
);
}
cy
.
getCookie
(
'
minds_sess
'
)
.
then
((
sessionCookie
)
=>
{
if
(
sessionCookie
===
null
)
{
cy
.
login
(
true
);
}
});
cy
.
visit
(
'
/newsfeed/global/top
'
);
});
it
(
'
should allow a user to post on the discovery page
'
,
()
=>
{
cy
.
visit
(
'
/newsfeed/global/top
'
);
cy
.
post
(
"
test!!
"
);
});
it
(
'
should be able to filter by hot
'
,
()
=>
{
cy
.
visit
(
'
/newsfeed/global/top
'
);
cy
.
get
(
'
.m-sort-selector--algorithm-dropdown ul > li:nth-child(1)
'
)
.
click
()
.
should
(
'
have.css
'
,
'
color
'
,
'
rgb(70, 144, 223)
'
);
// selected color
...
...
@@ -22,7 +22,6 @@ context('Discovery', () => {
});
it
(
'
should be able to filter by top
'
,
()
=>
{
cy
.
visit
(
'
/newsfeed/global/hot
'
);
cy
.
get
(
'
.m-sort-selector--algorithm-dropdown ul > li:nth-child(2)
'
)
.
click
()
.
should
(
'
have.css
'
,
'
color
'
,
'
rgb(70, 144, 223)
'
);
// selected color
...
...
@@ -30,13 +29,10 @@ context('Discovery', () => {
});
it
(
'
should be able to filter by time in the top feed
'
,
()
=>
{
cy
.
visit
(
'
/newsfeed/global/top
'
);
cy
.
get
(
'
.m-sort-selector--period-dropdown
'
).
click
();
cy
.
get
(
'
.m-sort-selector--period-dropdown ul > li:nth-child(5)
'
).
click
();
cy
.
url
().
should
(
'
include
'
,
'
=1y
'
);
cy
.
get
(
'
.m-sort-selector--period-dropdown
'
).
click
();
cy
.
get
(
'
.m-sort-selector--period-dropdown ul > li:nth-child(4)
'
).
click
();
cy
.
url
().
should
(
'
include
'
,
'
=30d
'
);
...
...
@@ -55,7 +51,6 @@ context('Discovery', () => {
});
it
(
'
should filter by latest
'
,
()
=>
{
cy
.
visit
(
'
/newsfeed/global/hot
'
);
cy
.
get
(
'
.m-sort-selector--algorithm-dropdown ul > li:nth-child(3)
'
)
.
click
()
.
should
(
'
have.css
'
,
'
color
'
,
'
rgb(70, 144, 223)
'
);
// selected color
...
...
@@ -64,28 +59,24 @@ context('Discovery', () => {
});
it
(
'
should filter by image
'
,
()
=>
{
cy
.
visit
(
'
/newsfeed/global/hot
'
);
cy
.
get
(
'
.m-sort-selector--custom-type-dropdown
'
).
click
();
cy
.
get
(
'
.m-sort-selector--custom-type-dropdown ul > li:nth-child(2)
'
).
click
();
cy
.
url
().
should
(
'
include
'
,
'
=images
'
);
});
it
(
'
should filter by video
'
,
()
=>
{
cy
.
visit
(
'
/newsfeed/global/hot
'
);
cy
.
get
(
'
.m-sort-selector--custom-type-dropdown
'
).
click
();
cy
.
get
(
'
.m-sort-selector--custom-type-dropdown ul > li:nth-child(3)
'
).
click
();
cy
.
url
().
should
(
'
include
'
,
'
=videos
'
);
});
it
(
'
should filter by blog
'
,
()
=>
{
cy
.
visit
(
'
/newsfeed/global/hot
'
);
cy
.
get
(
'
.m-sort-selector--custom-type-dropdown
'
).
click
();
cy
.
get
(
'
.m-sort-selector--custom-type-dropdown ul > li:nth-child(4)
'
).
click
();
cy
.
url
().
should
(
'
include
'
,
'
=blog
'
);
});
it
(
'
should filter by channels
'
,
()
=>
{
cy
.
visit
(
'
/newsfeed/global/hot
'
);
cy
.
get
(
'
.m-sort-selector--custom-type-dropdown
'
).
click
();
cy
.
get
(
'
.m-sort-selector--custom-type-dropdown ul > li:nth-child(5)
'
).
click
();
cy
.
url
().
should
(
'
include
'
,
'
=channels
'
);
...
...
@@ -118,11 +109,13 @@ context('Discovery', () => {
});
it
(
'
should allow the user to filter by a single hashtag
'
,
()
=>
{
cy
.
visit
(
'
/newsfeed/global/top
'
);
cy
.
get
(
'
.m-hashtagsSidebarSelector__list > ul > li:nth-child(1) .m-hashtagsSidebarSelectorList__visibility > i
'
)
.
click
();
// Will fail on non-configured users
});
it
(
'
should allow the user to turn off single hashtag filter and view all posts
'
,
()
=>
{
cy
.
visit
(
'
/newsfeed/global/top
'
);
cy
.
get
(
'
.m-hashtagsSidebarSelector__list > ul > li:nth-child(1) .m-hashtagsSidebarSelectorList__visibility > i
'
)
.
click
();
})
...
...
This diff is collapsed.
Click to expand it.
cypress/integration/groups.spec.js
View file @
4157b7cf
context
(
'
Groups
'
,
()
=>
{
before
(()
=>
{
if
(
cy
.
getCookie
(
'
minds_sess
'
)
===
null
)
{
cy
.
login
(
true
);
cy
.
location
(
'
pathname
'
,
{
timeout
:
30000
})
.
should
(
'
eq
'
,
`/newsfeed/subscriptions`
);
}
cy
.
getCookie
(
'
minds_sess
'
)
.
then
((
sessionCookie
)
=>
{
if
(
sessionCookie
===
null
)
{
cy
.
login
(
true
);
}
});
})
it
(
'
should create and edit a group
'
,
()
=>
{
...
...
This diff is collapsed.
Click to expand it.
cypress/integration/newsfeed.spec.js
View file @
4157b7cf
context
(
'
Newsfeed
'
,
()
=>
{
before
(()
=>
{
if
(
cy
.
getCookie
(
'
minds_sess
'
)
===
null
)
{
cy
.
login
(
true
);
cy
.
location
(
'
pathname
'
,
{
timeout
:
30000
})
.
should
(
'
eq
'
,
`/newsfeed/subscriptions`
);
}
cy
.
getCookie
(
'
minds_sess
'
)
.
then
((
sessionCookie
)
=>
{
if
(
sessionCookie
===
null
)
{
cy
.
login
(
true
);
}
});
})
it
(
'
should post an activity picking hashtags from the dropdown
'
,
()
=>
{
...
...
This diff is collapsed.
Click to expand it.
cypress/integration/onboarding.spec.js
View file @
4157b7cf
...
...
@@ -24,6 +24,7 @@ context('Onboarding', () => {
const
getTopic
=
(
i
)
=>
`m-onboarding--topics > div > ul > li:nth-child(
${
i
}
) span`
;
before
(()
=>
{
cy
.
clearCookies
();
cy
.
visit
(
'
/login
'
);
//type values
...
...
This diff is collapsed.
Click to expand it.
cypress/integration/remind.spec.js
View file @
4157b7cf
...
...
@@ -3,11 +3,12 @@ context('Remind', () => {
const
remindText
=
'
remind test text
'
;
before
(()
=>
{
if
(
cy
.
getCookie
(
'
minds_sess
'
)
===
null
)
{
cy
.
login
(
true
);
cy
.
location
(
'
pathname
'
,
{
timeout
:
30000
})
.
should
(
'
eq
'
,
`/newsfeed/subscriptions`
);
}
cy
.
getCookie
(
'
minds_sess
'
)
.
then
((
sessionCookie
)
=>
{
if
(
sessionCookie
===
null
)
{
cy
.
login
(
true
);
}
});
});
beforeEach
(()
=>
{
...
...
This diff is collapsed.
Click to expand it.
cypress/integration/topbar.spec.js
View file @
4157b7cf
context
(
'
Topbar
'
,
()
=>
{
before
(()
=>
{
if
(
cy
.
getCookie
(
'
minds_sess
'
)
===
null
)
{
cy
.
login
(
true
);
cy
.
location
(
'
pathname
'
,
{
timeout
:
30000
})
.
should
(
'
eq
'
,
`/newsfeed/subscriptions`
);
}
cy
.
getCookie
(
'
minds_sess
'
)
.
then
((
sessionCookie
)
=>
{
if
(
sessionCookie
===
null
)
{
cy
.
login
(
true
);
}
});
});
it
(
"
clicking on the dropdown on the right should allow to go to the user's channel
"
,
()
=>
{
...
...
This diff is collapsed.
Click to expand it.
cypress/integration/wire.spec.js
View file @
4157b7cf
...
...
@@ -11,10 +11,12 @@ context('Wire', () => {
const
modal
=
'
m-overlay-modal > div.m-overlay-modal
'
;
before
(()
=>
{
if
(
cy
.
getCookie
(
'
minds_sess
'
)
===
null
)
{
cy
.
login
();
cy
.
wait
(
2000
);
}
cy
.
getCookie
(
'
minds_sess
'
)
.
then
((
sessionCookie
)
=>
{
if
(
sessionCookie
===
null
)
{
cy
.
login
(
true
);
}
});
});
it
(
'
should allow a user to send a wire to another user
'
,
()
=>
{
...
...
This diff is collapsed.
Click to expand it.
cypress/support/commands.js
View file @
4157b7cf
...
...
@@ -61,8 +61,14 @@ Cypress.Commands.add('uploadFile', (selector, fileName, type = '') => {
});
Cypress
.
Commands
.
add
(
'
post
'
,
(
message
)
=>
{
cy
.
server
();
cy
.
route
(
"
POST
"
,
'
**/v1/newsfeed**
'
).
as
(
'
postActivity
'
);
cy
.
get
(
'
m-text-input--autocomplete-container textarea
'
).
type
(
message
);
cy
.
get
(
'
.m-posterActionBar__PostButton
'
).
click
();
cy
.
wait
(
'
@postActivity
'
).
then
((
xhr
)
=>
{
expect
(
xhr
.
status
).
to
.
equal
(
200
);
expect
(
xhr
.
response
.
body
.
status
).
to
.
deep
.
equal
(
"
success
"
);
});
});
function
b64toBlob
(
b64Data
,
contentType
,
sliceSize
=
512
)
{
...
...
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