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
828
Issues
828
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
865d2f4b
Commit
865d2f4b
authored
21 minutes ago
by
Ben Hayward
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added spec test for Pro Settings
parent
238dad73
epic/minds-pro
1 merge request
!528
WIP: (feat): Minds Pro
Pipeline
#82811267
failed with stages
in 7 minutes and 29 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
244 additions
and
0 deletions
+244
-0
settings.spec.js
cypress/integration/pro/settings.spec.js
+244
-0
No files found.
cypress/integration/pro/settings.spec.js
0 → 100644
View file @
865d2f4b
/**
* @author Ben Hayward
* @desc E2E testing for Minds Pro's settings.
*/
context
(
'
Pro Settings
'
,
()
=>
{
const
title
=
'
#title
'
;
const
headline
=
'
#headline
'
;
const
previewButton
=
'
.m-proSettings__previewBtn
'
;
const
activityContainer
=
'
minds-activity
'
;
const
footerText
=
'
#footer_text
'
;
const
theme
=
{
primaryColor
:
'
#primary_color
'
,
plainBackgroundColor
:
'
#plain_background_color
'
,
schemeLight
:
'
#scheme_light
'
,
schemeDark
:
'
#scheme_dark
'
,
aspectRatio
:
{
169
:
'
#tile_ratio_16
\
:9
'
,
// 16:9
1610
:
'
#tile_ratio_16
\
:10
'
,
// 16:10
43
:
'
#tile_ratio_4
\
:3
'
,
// 4:3
11
:
'
#tile_ratio_1
\
:1
'
,
// 1:1
},
logoGuid
:
'
#logo_guid
'
,
}
const
hashtags
=
{
labelInput0
:
'
#tag-label-0
'
,
hashtagInput0
:
'
#tag-tag-0
'
,
labelInput1
:
'
#tag-label-1
'
,
hashtagInput1
:
'
#tag-tag-1
'
,
label1
:
'
label1
'
,
label2
:
'
label2
'
,
label3
:
'
label3
'
,
hashtag1
:
'
#hashtag1
'
,
hashtag2
:
'
#hashtag2
'
,
hashtag3
:
'
#hashtag3
'
,
}
const
footer
=
{
hrefInput
:
`#footer_link-href-0`
,
titleInput
:
`#footer_link-title-0`
,
}
const
strings
=
{
title
:
"
Minds Pro E2E
"
,
headline
:
"
This headline is a test
"
,
footer
:
"
This is a footer
"
,
footerTitle
:
"
Minds
"
,
footerHref
:
'
https://www.minds.com/
'
,
}
before
(()
=>
{
cy
.
clearCookies
();
cy
.
getCookie
(
'
minds_sess
'
)
.
then
((
sessionCookie
)
=>
{
if
(
sessionCookie
===
null
)
{
return
cy
.
login
(
true
);
}
});
});
after
(()
=>
{
cy
.
visit
(
"
/pro/settings
"
)
.
location
(
'
pathname
'
)
.
should
(
'
eq
'
,
'
/pro/settings
'
);
clearHashtags
();
});
beforeEach
(()
=>
{
cy
.
preserveCookies
();
cy
.
server
();
cy
.
route
(
"
POST
"
,
"
**/api/v2/pro/settings
"
).
as
(
"
settings
"
);
cy
.
visit
(
"
/pro/settings
"
)
.
location
(
'
pathname
'
)
.
should
(
'
eq
'
,
'
/pro/settings
'
);
});
it
(
'
should update the title and headline
'
,
()
=>
{
//enter data
cy
.
get
(
title
)
.
focus
()
.
clear
()
.
type
(
strings
.
title
);
cy
.
get
(
headline
)
.
focus
()
.
clear
()
.
type
(
strings
.
headline
);
saveAndPreview
();
//check tab title.
cy
.
title
()
.
should
(
'
eq
'
,
strings
.
title
+
'
-
'
+
strings
.
headline
+
"
| Minds
"
);
});
// Need to find a way around the color input in Cypress.
it
(
'
should allow the user to set a dark theme for posts
'
,
()
=>
{
cy
.
contains
(
'
Theme
'
)
.
click
();
cy
.
get
(
theme
.
schemeDark
)
.
click
();
saveAndPreview
();
cy
.
contains
(
'
Feed
'
)
.
click
();
cy
.
get
(
activityContainer
)
.
should
(
'
have.css
'
,
'
background-color
'
)
.
and
(
'
eq
'
,
'
rgb(35, 35, 35)
'
);
});
it
(
'
should allow the user to set a light theme for posts
'
,
()
=>
{
cy
.
contains
(
'
Theme
'
)
.
click
();
cy
.
get
(
theme
.
schemeLight
)
.
click
();
saveAndPreview
();
cy
.
contains
(
'
Feed
'
)
.
click
();
cy
.
get
(
activityContainer
)
.
should
(
'
have.css
'
,
'
background-color
'
)
.
and
(
'
eq
'
,
'
rgb(255, 255, 255)
'
);
});
it
(
'
should allow the user to set category hashtags
'
,
()
=>
{
cy
.
contains
(
'
Hashtags
'
)
.
click
();
cy
.
contains
(
'
+ Add Tag
'
)
.
click
();
cy
.
get
(
hashtags
.
labelInput0
)
.
clear
()
.
type
(
hashtags
.
label1
);
cy
.
get
(
hashtags
.
hashtagInput0
)
.
clear
()
.
type
(
hashtags
.
hashtag1
);
cy
.
contains
(
'
+ Add Tag
'
)
.
click
();
cy
.
get
(
hashtags
.
labelInput1
)
.
first
()
.
clear
()
.
type
(
hashtags
.
label2
);
cy
.
get
(
hashtags
.
hashtagInput1
)
.
first
()
.
clear
()
.
type
(
hashtags
.
hashtag2
);
saveAndPreview
();
//check the labels are present and clickable.
cy
.
contains
(
'
label1
'
);
cy
.
contains
(
'
label2
'
);
});
it
(
'
should allow the user to set footer
'
,
()
=>
{
cy
.
contains
(
'
Footer
'
)
.
click
();
cy
.
get
(
footerText
)
.
clear
()
.
type
(
strings
.
footer
);
cy
.
contains
(
'
Add Link
'
)
.
click
();
cy
.
get
(
footer
.
hrefInput
)
.
clear
()
.
type
(
strings
.
footerHref
);
cy
.
get
(
footer
.
titleInput
)
.
clear
()
.
type
(
strings
.
footerTitle
);
saveAndPreview
();
cy
.
contains
(
strings
.
footerTitle
)
.
should
(
'
have.attr
'
,
'
href
'
)
.
should
(
'
contain
'
,
strings
.
footerHref
);
});
//save, await response, preview.
function
saveAndPreview
()
{
//save and await response
cy
.
contains
(
'
Save
'
)
.
click
()
.
wait
(
'
@settings
'
).
then
((
xhr
)
=>
{
expect
(
xhr
.
status
).
to
.
equal
(
200
);
expect
(
xhr
.
response
.
body
).
to
.
deep
.
equal
({
status
:
'
success
'
});
});
//go to pro page
cy
.
get
(
previewButton
)
.
click
();
}
function
clearHashtags
()
{
cy
.
contains
(
'
Hashtags
'
)
.
click
();
cy
.
contains
(
'
+ Add Tag
'
)
.
click
();
cy
.
contains
(
'
clear
'
)
.
click
({
multiple
:
true
});
saveAndPreview
();
}
//
// it.only('should update the theme', () => {
// // nav to theme tab
// cy.contains('Theme')
// .click();
// cy.get(theme.plainBackgroundColor).then(elem => {
// elem.val('#00dd00');
// //save and await response
// cy.contains('Save')
// .click()
// .wait('@settings').then((xhr) => {
// expect(xhr.status).to.equal(200);
// expect(xhr.response.body).to.deep.equal({ status: 'success' });
// });
// //go to pro page
// cy.get(previewButton)
// .click();
// });
// })
})
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