make tests match new behavior
the last stage of the test checks for the behavior that we are removing
This commit is contained in:
parent
879b552175
commit
b924f57f23
1 changed files with 3 additions and 35 deletions
|
@ -2748,15 +2748,15 @@ mod tests {
|
||||||
search_bar.deploy(&deploy, window, cx);
|
search_bar.deploy(&deploy, window, cx);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
search_bar.search_options,
|
search_bar.search_options,
|
||||||
SearchOptions::NONE,
|
SearchOptions::WHOLE_WORD,
|
||||||
"After hiding and showing the search bar, default options should be used"
|
"After hiding and showing the search bar, options should be preserved"
|
||||||
);
|
);
|
||||||
|
|
||||||
search_bar.toggle_search_option(SearchOptions::REGEX, window, cx);
|
search_bar.toggle_search_option(SearchOptions::REGEX, window, cx);
|
||||||
search_bar.toggle_search_option(SearchOptions::WHOLE_WORD, window, cx);
|
search_bar.toggle_search_option(SearchOptions::WHOLE_WORD, window, cx);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
search_bar.search_options,
|
search_bar.search_options,
|
||||||
SearchOptions::REGEX | SearchOptions::WHOLE_WORD,
|
SearchOptions::REGEX,
|
||||||
"Should enable the options toggled"
|
"Should enable the options toggled"
|
||||||
);
|
);
|
||||||
assert!(
|
assert!(
|
||||||
|
@ -2764,38 +2764,6 @@ mod tests {
|
||||||
"Search bar should be present and visible"
|
"Search bar should be present and visible"
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
update_search_settings(
|
|
||||||
SearchSettings {
|
|
||||||
button: true,
|
|
||||||
whole_word: false,
|
|
||||||
case_sensitive: true,
|
|
||||||
include_ignored: false,
|
|
||||||
regex: false,
|
|
||||||
},
|
|
||||||
cx,
|
|
||||||
);
|
|
||||||
search_bar.update_in(cx, |search_bar, window, cx| {
|
|
||||||
assert_eq!(
|
|
||||||
search_bar.search_options,
|
|
||||||
SearchOptions::REGEX | SearchOptions::WHOLE_WORD,
|
|
||||||
"Should have no search options enabled by default"
|
|
||||||
);
|
|
||||||
|
|
||||||
search_bar.deploy(&deploy, window, cx);
|
|
||||||
assert_eq!(
|
|
||||||
search_bar.search_options,
|
|
||||||
SearchOptions::REGEX | SearchOptions::WHOLE_WORD,
|
|
||||||
"Toggling a non-dismissed search bar with custom options should not change the default options"
|
|
||||||
);
|
|
||||||
search_bar.dismiss(&Dismiss, window, cx);
|
|
||||||
search_bar.deploy(&deploy, window, cx);
|
|
||||||
assert_eq!(
|
|
||||||
search_bar.search_options,
|
|
||||||
SearchOptions::CASE_SENSITIVE,
|
|
||||||
"After hiding and showing the search bar, default options should be used"
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update_search_settings(search_settings: SearchSettings, cx: &mut TestAppContext) {
|
fn update_search_settings(search_settings: SearchSettings, cx: &mut TestAppContext) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue