tech: mobx tests

This commit is contained in:
Torkel Ödegaard
2017-12-21 08:27:47 +01:00
parent 354913a704
commit 444240dffc
3 changed files with 18 additions and 6 deletions
@@ -15,6 +15,8 @@ export class SearchResult extends React.Component<SearchResultProps, any> {
this.state = {
search: store.search
};
store.search.query();
}
render() {
@@ -22,12 +22,11 @@
<div class="search-dropdown__col_1">
<div class="search-results-container" grafana-scrollbar>
<h6 ng-show="!ctrl.isLoading && ctrl.results.length === 0">No dashboards matching your query were found.</h6>
<search-result />
<!-- <dashboard&#45;search&#45;results -->
<!-- results="ctrl.results" -->
<!-- on&#45;tag&#45;selected="ctrl.filterByTag($tag)" -->
<!-- on&#45;folder&#45;expanding="ctrl.folderExpanding()" -->
<!-- on&#45;folder&#45;expanded="ctrl.folderExpanded($folder)" /> -->
<dashboard-search-results
results="ctrl.results"
on-tag-selected="ctrl.filterByTag($tag)"
on-folder-expanding="ctrl.folderExpanding()"
on-folder-expanded="ctrl.folderExpanded($folder)" />
</div>
</div>
+11
View File
@@ -20,6 +20,17 @@ export const SearchResultSection = types
.actions(self => ({
toggle() {
self.expanded = !self.expanded;
for (let i = 0; i < 100; i++) {
self.items.push(
ResultItem.create({
id: i,
title: "Dashboard " + self.items.length,
icon: "gicon gicon-dashboard",
url: "asd"
})
);
}
}
}));