mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-06 02:37:21 +00:00
Added toggle dock test
This commit is contained in:
parent
4c07dc9553
commit
6af7b7f600
1 changed files with 15 additions and 0 deletions
|
@ -472,6 +472,17 @@ mod tests {
|
|||
cx.assert_workspace_pane_inactive();
|
||||
}
|
||||
|
||||
#[gpui::test]
|
||||
async fn test_toggle_dock_focus(cx: &mut TestAppContext) {
|
||||
let cx = DockTestContext::new(cx).await;
|
||||
|
||||
cx.move_dock(DockAnchor::Right);
|
||||
cx.assert_dock_pane_active();
|
||||
cx.toggle_dock();
|
||||
cx.move_dock(DockAnchor::Right);
|
||||
cx.assert_dock_pane_active();
|
||||
}
|
||||
|
||||
struct DockTestContext<'a> {
|
||||
pub cx: &'a mut TestAppContext,
|
||||
pub window_id: usize,
|
||||
|
@ -589,6 +600,10 @@ mod tests {
|
|||
self.cx.dispatch_action(self.window_id, MoveDock(anchor));
|
||||
}
|
||||
|
||||
pub fn toggle_dock(&self) {
|
||||
self.cx.dispatch_action(self.window_id, ToggleDock);
|
||||
}
|
||||
|
||||
pub fn open_sidebar(&mut self, sidebar_side: SidebarSide) {
|
||||
if !self.sidebar(sidebar_side, |sidebar, _| sidebar.is_open()) {
|
||||
self.update_workspace(|workspace, cx| workspace.toggle_sidebar(sidebar_side, cx));
|
||||
|
|
Loading…
Reference in a new issue