Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
Minds Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
4
Snippets
Groups
Projects
Show more breadcrumbs
Minds
Minds Frontend
Commits
a612a59d
Commit
a612a59d
authored
5 years ago
by
Mark Harding
Browse files
Options
Downloads
Plain Diff
Merge branch 'fix/visibility-toggle-sidebar-2372' into 'master'
Fixed failing hashtag visibility toggle.
#2372
Closes
#2372
See merge request
!700
parents
65da1be5
711bed79
No related branches found
No related tags found
1 merge request
!700
Fixed failing hashtag visibility toggle. #2372
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cypress/integration/discovery.spec.js
+37
-8
37 additions, 8 deletions
cypress/integration/discovery.spec.js
src/app/modules/hashtags/sidebar-selector/sidebar-selector.component.ts
+6
-10
6 additions, 10 deletions
...s/hashtags/sidebar-selector/sidebar-selector.component.ts
with
43 additions
and
18 deletions
cypress/integration/discovery.spec.js
+
37
−
8
View file @
a612a59d
...
...
@@ -116,18 +116,47 @@ context('Discovery', () => {
cy
.
get
(
"
m-topbar--navigation--options ul > m-nsfw-selector ul > li:contains('Other')
"
).
click
();
});
it
(
'
should allow the user to
filter by a
single hashtag
'
,
()
=>
{
it
(
'
should allow the user to
turn off
single hashtag
filter and view all posts
'
,
()
=>
{
cy
.
visit
(
'
/newsfeed/global/top
'
);
cy
.
get
(
'
m-hashtagssidebarselector__item
'
)
.
first
()
.
click
();
});
it
(
'
should allow the user to t
urn off
single hashtag
filter and view all posts
'
,
()
=>
{
it
.
skip
(
'
should allow the user to t
oggle a
single hashtag
and then toggle back to the initial feed
'
,
()
=>
{
cy
.
visit
(
'
/newsfeed/global/top
'
);
cy
.
get
(
'
m-hashtagssidebarselector__item
'
)
.
first
()
.
find
(
'
.m-hashtagsSidebarSelectorList__visibility > i
'
)
.
click
();
})
// get first label value
cy
.
get
(
'
.m-hashtagsSidebarSelectorList__label
'
).
first
().
invoke
(
'
text
'
).
then
((
text
)
=>
{
// repeat twice to capture full cycle.
Cypress
.
_
.
times
(
2
,
(
i
)
=>
{
// split hashtag off of label text
let
label
=
text
.
split
(
'
#
'
)[
1
];
// click switch
toggleFirstVisibilitySwitch
();
// check location name has updated
cy
.
location
(
'
pathname
'
)
.
should
(
'
eq
'
,
`/newsfeed/global/top;period=12h;hashtag=
${
label
}
`
);
// click switch
toggleFirstVisibilitySwitch
();
// check location name has updated
cy
.
location
(
'
pathname
'
)
.
should
(
'
eq
'
,
`/newsfeed/global/top;period=12h`
);
});
});
});
// click first visibility switch
const
toggleFirstVisibilitySwitch
=
()
=>
{
cy
.
get
(
'
m-hashtagssidebarselector__item
'
)
.
first
()
.
find
(
'
.m-hashtagsSidebarSelectorList__visibility > i
'
)
.
click
();
}
})
This diff is collapsed.
Click to expand it.
src/app/modules/hashtags/sidebar-selector/sidebar-selector.component.ts
+
6
−
10
View file @
a612a59d
...
...
@@ -122,16 +122,12 @@ export class SidebarSelectorComponent implements OnInit {
}
hashtagVisibilityChange
(
hashtag
)
{
if
(
this
.
currentHashtag
!==
hashtag
.
value
)
{
this
.
currentHashtag
=
hashtag
.
value
;
this
.
filterChange
.
emit
({
type
:
'
single
'
,
value
:
this
.
currentHashtag
,
});
}
else
{
this
.
currentHashtag
=
null
;
}
this
.
currentHashtag
=
this
.
currentHashtag
!==
hashtag
.
value
?
hashtag
.
value
:
null
;
this
.
filterChange
.
emit
({
type
:
'
single
'
,
value
:
this
.
currentHashtag
,
});
}
preferredChange
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment