| 155 | |
| 156 | #[test] |
| 157 | fn matching_topics() { |
| 158 | let f = Fixtures::copy("simple"); |
| 159 | |
| 160 | let matches = search(&f, &ExternalId::root_topic(), "exist non root topic", true); |
| 161 | assert!(!matches.is_empty()); |
| 162 | let row = matches.iter().next().unwrap(); |
| 163 | |
| 164 | let SearchMatch { |
| 165 | sort_key, object, .. |
| 166 | } = row; |
| 167 | |
| 168 | assert_eq!( |
| 169 | sort_key, |
| 170 | &SortKey( |
| 171 | Kind::Topic, |
| 172 | true, |
| 173 | "Existing non-root topic".to_owned(), |
| 174 | object.id().to_owned() |
| 175 | ) |
| 176 | ); |
| 177 | |
| 178 | assert_eq!(object.display_string(Locale::EN), "Existing non-root topic"); |
| 179 | } |
| 180 | |
| 181 | // Relevant structure of /wiki repo in the simple fixture: |
| 182 | // |