File tree Expand file tree Collapse file tree 3 files changed +21
-6
lines changed
app/assets/javascripts/discourse
tests/integration/components/discovery Expand file tree Collapse file tree 3 files changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { TrackedObject } from "@ember-compat/tracked-built-ins";
10
10
import { eq } from " truth-helpers" ;
11
11
import DButton from " discourse/components/d-button" ;
12
12
import DropdownMenu from " discourse/components/dropdown-menu" ;
13
+ import categoryBadge from " discourse/helpers/category-badge" ;
13
14
import concatClass from " discourse/helpers/concat-class" ;
14
15
import icon from " discourse/helpers/d-icon" ;
15
16
import withEventValue from " discourse/helpers/with-event-value" ;
@@ -32,12 +33,17 @@ const FilterNavigationMenuList = <template>
32
33
}}
33
34
@ action ={{fn @ data.selectItem item }}
34
35
>
35
- <span class =" filter-navigation__tip-name" >
36
- {{item.name }}
37
- </span >
38
- {{#if item.description }}
39
- <span class =" filter-navigation__tip-description" >—
40
- {{item.description }} </span >
36
+ {{#if item.category }}
37
+ {{categoryBadge item.category allowUncategorized =true }}
38
+ {{else }}
39
+ <span class =" filter-navigation__tip-name" >
40
+ {{item.name }}
41
+ </span >
42
+
43
+ {{#if item.description }}
44
+ <span class =" filter-navigation__tip-description" >—
45
+ {{item.description }} </span >
46
+ {{/if }}
41
47
{{/if }}
42
48
</DButton >
43
49
</dropdown.item >
Original file line number Diff line number Diff line change @@ -106,6 +106,7 @@ export default class FilterSuggestions {
106
106
description : `${ category . name } ` ,
107
107
isSuggestion : true ,
108
108
term : category . slug ,
109
+ category,
109
110
} ) ) ;
110
111
}
111
112
Original file line number Diff line number Diff line change @@ -222,6 +222,14 @@ module(
222
222
await triggerEvent (" #topic-query-filter-input" , " focus" );
223
223
await fillIn (" #topic-query-filter-input" , " cat" );
224
224
225
+ assert
226
+ .dom (" .filter-navigation__tip-button" )
227
+ .exists (" category search results shown" );
228
+
229
+ assert
230
+ .dom (" .filter-navigation__tip-button" )
231
+ .exists (" .badge-category__wrapper" , " category badge HTML shown" );
232
+
225
233
await triggerKeyEvent (
226
234
" #topic-query-filter-input" ,
227
235
" keydown" ,
You can’t perform that action at this time.
0 commit comments