Remove TestAppContext::add_view
Instead, we now call this on window handles.
This commit is contained in:
parent
0f332238b3
commit
f0da6b05fd
9 changed files with 35 additions and 93 deletions
|
@ -850,12 +850,9 @@ mod tests {
|
|||
)
|
||||
});
|
||||
let window = cx.add_window(|_| EmptyView);
|
||||
let editor = window.add_view(cx, |cx| Editor::for_buffer(buffer.clone(), None, cx));
|
||||
|
||||
let editor = cx.add_view(window.id(), |cx| {
|
||||
Editor::for_buffer(buffer.clone(), None, cx)
|
||||
});
|
||||
|
||||
let search_bar = cx.add_view(window.id(), |cx| {
|
||||
let search_bar = window.add_view(cx, |cx| {
|
||||
let mut search_bar = BufferSearchBar::new(cx);
|
||||
search_bar.set_active_pane_item(Some(&editor), cx);
|
||||
search_bar.show(cx);
|
||||
|
@ -1234,9 +1231,9 @@ mod tests {
|
|||
let window = cx.add_window(|_| EmptyView);
|
||||
let window_id = window.id();
|
||||
|
||||
let editor = cx.add_view(window_id, |cx| Editor::for_buffer(buffer.clone(), None, cx));
|
||||
let editor = window.add_view(cx, |cx| Editor::for_buffer(buffer.clone(), None, cx));
|
||||
|
||||
let search_bar = cx.add_view(window_id, |cx| {
|
||||
let search_bar = window.add_view(cx, |cx| {
|
||||
let mut search_bar = BufferSearchBar::new(cx);
|
||||
search_bar.set_active_pane_item(Some(&editor), cx);
|
||||
search_bar.show(cx);
|
||||
|
@ -1421,11 +1418,9 @@ mod tests {
|
|||
let buffer = cx.add_model(|cx| Buffer::new(0, buffer_text, cx));
|
||||
let window = cx.add_window(|_| EmptyView);
|
||||
|
||||
let editor = cx.add_view(window.id(), |cx| {
|
||||
Editor::for_buffer(buffer.clone(), None, cx)
|
||||
});
|
||||
let editor = window.add_view(cx, |cx| Editor::for_buffer(buffer.clone(), None, cx));
|
||||
|
||||
let search_bar = cx.add_view(window.id(), |cx| {
|
||||
let search_bar = window.add_view(cx, |cx| {
|
||||
let mut search_bar = BufferSearchBar::new(cx);
|
||||
search_bar.set_active_pane_item(Some(&editor), cx);
|
||||
search_bar.show(cx);
|
||||
|
|
|
@ -1874,7 +1874,6 @@ pub mod tests {
|
|||
let project = Project::test(fs.clone(), ["/dir".as_ref()], cx).await;
|
||||
let window = cx.add_window(|cx| Workspace::test_new(project, cx));
|
||||
let workspace = window.root(cx);
|
||||
let window_id = window.id();
|
||||
workspace.update(cx, |workspace, cx| {
|
||||
ProjectSearchView::deploy(workspace, &workspace::NewSearch, cx)
|
||||
});
|
||||
|
@ -1889,7 +1888,7 @@ pub mod tests {
|
|||
.expect("Search view expected to appear after new search event trigger")
|
||||
});
|
||||
|
||||
let search_bar = cx.add_view(window_id, |cx| {
|
||||
let search_bar = window.add_view(cx, |cx| {
|
||||
let mut search_bar = ProjectSearchBar::new();
|
||||
search_bar.set_active_pane_item(Some(&search_view), cx);
|
||||
// search_bar.show(cx);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue