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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
026fe78e
Commit
026fe78e
authored
Oct 22, 2021
by
Zack Cuddy
Committed by
Andrew Fontaine
Oct 22, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Global Search - Fix reset filters button
parent
483126f9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
app/assets/javascripts/search/sidebar/components/app.vue
app/assets/javascripts/search/sidebar/components/app.vue
+2
-2
spec/frontend/search/sidebar/components/app_spec.js
spec/frontend/search/sidebar/components/app_spec.js
+14
-4
No files found.
app/assets/javascripts/search/sidebar/components/app.vue
View file @
026fe78e
...
...
@@ -13,9 +13,9 @@ export default {
ConfidentialityFilter
,
},
computed
:
{
...
mapState
([
'
q
uery
'
,
'
sidebarDirty
'
]),
...
mapState
([
'
urlQ
uery
'
,
'
sidebarDirty
'
]),
showReset
()
{
return
this
.
query
.
state
||
this
.
q
uery
.
confidential
;
return
this
.
urlQuery
.
state
||
this
.
urlQ
uery
.
confidential
;
},
},
methods
:
{
...
...
spec/frontend/search/sidebar/components/app_spec.js
View file @
026fe78e
...
...
@@ -20,7 +20,7 @@ describe('GlobalSearchSidebar', () => {
const
createComponent
=
(
initialState
)
=>
{
const
store
=
new
Vuex
.
Store
({
state
:
{
q
uery
:
MOCK_QUERY
,
urlQ
uery
:
MOCK_QUERY
,
...
initialState
,
},
actions
:
actionSpies
,
...
...
@@ -84,7 +84,7 @@ describe('GlobalSearchSidebar', () => {
describe
(
'
ResetLinkButton
'
,
()
=>
{
describe
(
'
with no filter selected
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
({
q
uery
:
{}
});
createComponent
({
urlQ
uery
:
{}
});
});
it
(
'
does not render
'
,
()
=>
{
...
...
@@ -94,10 +94,20 @@ describe('GlobalSearchSidebar', () => {
describe
(
'
with filter selected
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
();
createComponent
({
urlQuery
:
MOCK_QUERY
});
});
it
(
'
does render
'
,
()
=>
{
expect
(
findResetLinkButton
().
exists
()).
toBe
(
true
);
});
});
describe
(
'
with filter selected and user updated query back to default
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
({
urlQuery
:
MOCK_QUERY
,
query
:
{}
});
});
it
(
'
does render
when a filter selected
'
,
()
=>
{
it
(
'
does render
'
,
()
=>
{
expect
(
findResetLinkButton
().
exists
()).
toBe
(
true
);
});
});
...
...
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