Initial public release of Warp.
Repo-Sync-Origin: warpdotdev/warp-internal@12af1d983b
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
use warpui::{async_assert_eq, integration::AssertionCallback};
|
||||
|
||||
use crate::integration_testing::view_getters::workspace_view;
|
||||
|
||||
pub fn assert_focused_tab_index(tab_index: usize) -> AssertionCallback {
|
||||
Box::new(move |app, window_id| {
|
||||
let workspace = workspace_view(app, window_id);
|
||||
workspace.read(app, |view, _ctx| {
|
||||
async_assert_eq!(view.active_tab_index(), tab_index)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/// Assert that there are a particular number of tabs in the workspace.
|
||||
pub fn assert_tab_count(tab_count: usize) -> AssertionCallback {
|
||||
Box::new(move |app, window_id| {
|
||||
let workspace = workspace_view(app, window_id);
|
||||
workspace.read(app, |view, _ctx| {
|
||||
let actual_tab_count = view.tab_count();
|
||||
async_assert_eq!(
|
||||
actual_tab_count,
|
||||
tab_count,
|
||||
"Expected {} tabs, but there were {}",
|
||||
tab_count,
|
||||
actual_tab_count
|
||||
)
|
||||
})
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user