fix(tui): fit confirmation popups to content
This commit is contained in:
1 parent
992f15b082
commit
6527b24081
6 files changed
+31
-3
No files matched your search
@@ -44,6 +44,12 @@ fn discovery_version_rows_only_show_the_version_number() {
|
||||
assert_eq!(discovery_version_label(&version), "3.2.4-fabric-26.1");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn discovery_confirmation_popup_fits_its_summary() {
|
||||
assert_eq!(version_popup_height(false), VERSION_POPUP_HEIGHT);
|
||||
assert_eq!(version_popup_height(true), 6);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn discovery_version_popup_renders_over_a_project_page() {
|
||||
use crate::instance::ContentKind;
|
||||
|
||||
@@ -155,6 +155,14 @@ fn import_modpack_renders_confirm_step() {
|
||||
insta::assert_snapshot!(terminal.backend());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn modpack_confirmation_area_fits_its_summary() {
|
||||
let _serial = TEST_LOCK.lock().unwrap_or_else(|e| e.into_inner());
|
||||
reset_import_state(ImportStep::Confirm);
|
||||
|
||||
assert_eq!(popup_rect(Rect::new(0, 0, 100, 30)).height, 8);
|
||||
}
|
||||
|
||||
// Confirm step with loader_version=None: covers the branch where the
|
||||
// pack didn't declare a loader version (rare upstream, but happens for
|
||||
// older mmc packs). render_confirm_step has to handle the Option.
|
||||
|
||||
@@ -138,3 +138,11 @@ fn new_instance_renders_confirm_step() {
|
||||
.unwrap();
|
||||
insta::assert_snapshot!(terminal.backend());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn new_instance_confirmation_area_fits_its_summary() {
|
||||
let _serial = TEST_LOCK.lock().unwrap_or_else(|e| e.into_inner());
|
||||
reset_wizard_state(WizardStep::Confirm);
|
||||
|
||||
assert_eq!(popup_rect(Rect::new(0, 0, 100, 30)).height, 6);
|
||||
}
|
||||
Reference in new issue
Block a user