feat(slint): add NavEntry::Search history variant
The Search variant carries the query. apply_entry gets a stub arm that switches the view; Task 6 upgrades it to a full navigate_search call. cc
This commit is contained in:
2 files changed
+17
No files matched your search
@@ -16,6 +16,8 @@ pub enum NavEntry {
|
||||
Album(String),
|
||||
Artist(String),
|
||||
Settings,
|
||||
/// A search results page; the string is the query.
|
||||
Search(String),
|
||||
}
|
||||
|
||||
struct History {
|
||||
@@ -123,6 +125,15 @@ mod tests {
|
||||
assert_eq!(go_back(), Some(NavEntry::Album("1".into())));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn search_entry_round_trips_history() {
|
||||
reset();
|
||||
record(NavEntry::Search("metallica".into()));
|
||||
record(NavEntry::Album("5".into()));
|
||||
assert_eq!(go_back(), Some(NavEntry::Search("metallica".into())));
|
||||
assert_eq!(go_back(), Some(NavEntry::Home));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn record_dedupes_current_entry() {
|
||||
reset();
|
||||
|
||||
Reference in new issue
Block a user