Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
c8a5db34
Commit
c8a5db34
authored
5 years ago
by
Igor
Committed by
Phil Hughes
5 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix skipping of user rendering for none and any
parent
9023cf71
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
6 deletions
+28
-6
app/assets/javascripts/filtered_search/visual_token_value.js
app/assets/javascripts/filtered_search/visual_token_value.js
+2
-2
spec/javascripts/filtered_search/visual_token_value_spec.js
spec/javascripts/filtered_search/visual_token_value_spec.js
+26
-4
No files found.
app/assets/javascripts/filtered_search/visual_token_value.js
View file @
c8a5db34
...
@@ -13,9 +13,9 @@ export default class VisualTokenValue {
...
@@ -13,9 +13,9 @@ export default class VisualTokenValue {
}
}
render
(
tokenValueContainer
,
tokenValueElement
)
{
render
(
tokenValueContainer
,
tokenValueElement
)
{
const
{
tokenType
}
=
this
;
const
{
tokenType
,
tokenValue
}
=
this
;
if
([
'
none
'
,
'
any
'
].
includes
(
token
Type
))
{
if
([
'
none
'
,
'
any
'
].
includes
(
token
Value
.
toLowerCase
()
))
{
return
;
return
;
}
}
...
...
This diff is collapsed.
Click to expand it.
spec/javascripts/filtered_search/visual_token_value_spec.js
View file @
c8a5db34
...
@@ -317,7 +317,18 @@ describe('Filtered Search Visual Tokens', () => {
...
@@ -317,7 +317,18 @@ describe('Filtered Search Visual Tokens', () => {
it
(
'
does not update user token appearance for `none` filter
'
,
()
=>
{
it
(
'
does not update user token appearance for `none` filter
'
,
()
=>
{
const
{
subject
,
tokenValueContainer
,
tokenValueElement
}
=
findElements
(
authorToken
);
const
{
subject
,
tokenValueContainer
,
tokenValueElement
}
=
findElements
(
authorToken
);
subject
.
tokenType
=
'
none
'
;
subject
.
tokenValue
=
'
none
'
;
const
{
updateUserTokenAppearanceSpy
}
=
setupSpies
(
subject
);
subject
.
render
(
tokenValueContainer
,
tokenValueElement
);
expect
(
updateUserTokenAppearanceSpy
.
calls
.
count
()).
toBe
(
0
);
});
it
(
'
does not update user token appearance for `None` filter
'
,
()
=>
{
const
{
subject
,
tokenValueContainer
,
tokenValueElement
}
=
findElements
(
authorToken
);
subject
.
tokenValue
=
'
None
'
;
const
{
updateUserTokenAppearanceSpy
}
=
setupSpies
(
subject
);
const
{
updateUserTokenAppearanceSpy
}
=
setupSpies
(
subject
);
subject
.
render
(
tokenValueContainer
,
tokenValueElement
);
subject
.
render
(
tokenValueContainer
,
tokenValueElement
);
...
@@ -328,7 +339,7 @@ describe('Filtered Search Visual Tokens', () => {
...
@@ -328,7 +339,7 @@ describe('Filtered Search Visual Tokens', () => {
it
(
'
does not update user token appearance for `any` filter
'
,
()
=>
{
it
(
'
does not update user token appearance for `any` filter
'
,
()
=>
{
const
{
subject
,
tokenValueContainer
,
tokenValueElement
}
=
findElements
(
authorToken
);
const
{
subject
,
tokenValueContainer
,
tokenValueElement
}
=
findElements
(
authorToken
);
subject
.
token
Typ
e
=
'
any
'
;
subject
.
token
Valu
e
=
'
any
'
;
const
{
updateUserTokenAppearanceSpy
}
=
setupSpies
(
subject
);
const
{
updateUserTokenAppearanceSpy
}
=
setupSpies
(
subject
);
subject
.
render
(
tokenValueContainer
,
tokenValueElement
);
subject
.
render
(
tokenValueContainer
,
tokenValueElement
);
...
@@ -336,10 +347,21 @@ describe('Filtered Search Visual Tokens', () => {
...
@@ -336,10 +347,21 @@ describe('Filtered Search Visual Tokens', () => {
expect
(
updateUserTokenAppearanceSpy
.
calls
.
count
()).
toBe
(
0
);
expect
(
updateUserTokenAppearanceSpy
.
calls
.
count
()).
toBe
(
0
);
});
});
it
(
'
does not update label token color for `None` filter
'
,
()
=>
{
const
{
subject
,
tokenValueContainer
,
tokenValueElement
}
=
findElements
(
bugLabelToken
);
subject
.
tokenValue
=
'
None
'
;
const
{
updateLabelTokenColorSpy
}
=
setupSpies
(
subject
);
subject
.
render
(
tokenValueContainer
,
tokenValueElement
);
expect
(
updateLabelTokenColorSpy
.
calls
.
count
()).
toBe
(
0
);
});
it
(
'
does not update label token color for `none` filter
'
,
()
=>
{
it
(
'
does not update label token color for `none` filter
'
,
()
=>
{
const
{
subject
,
tokenValueContainer
,
tokenValueElement
}
=
findElements
(
bugLabelToken
);
const
{
subject
,
tokenValueContainer
,
tokenValueElement
}
=
findElements
(
bugLabelToken
);
subject
.
token
Typ
e
=
'
none
'
;
subject
.
token
Valu
e
=
'
none
'
;
const
{
updateLabelTokenColorSpy
}
=
setupSpies
(
subject
);
const
{
updateLabelTokenColorSpy
}
=
setupSpies
(
subject
);
subject
.
render
(
tokenValueContainer
,
tokenValueElement
);
subject
.
render
(
tokenValueContainer
,
tokenValueElement
);
...
@@ -350,7 +372,7 @@ describe('Filtered Search Visual Tokens', () => {
...
@@ -350,7 +372,7 @@ describe('Filtered Search Visual Tokens', () => {
it
(
'
does not update label token color for `any` filter
'
,
()
=>
{
it
(
'
does not update label token color for `any` filter
'
,
()
=>
{
const
{
subject
,
tokenValueContainer
,
tokenValueElement
}
=
findElements
(
bugLabelToken
);
const
{
subject
,
tokenValueContainer
,
tokenValueElement
}
=
findElements
(
bugLabelToken
);
subject
.
token
Typ
e
=
'
any
'
;
subject
.
token
Valu
e
=
'
any
'
;
const
{
updateLabelTokenColorSpy
}
=
setupSpies
(
subject
);
const
{
updateLabelTokenColorSpy
}
=
setupSpies
(
subject
);
subject
.
render
(
tokenValueContainer
,
tokenValueElement
);
subject
.
render
(
tokenValueContainer
,
tokenValueElement
);
...
...
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