style: trim redundant snapshot fixture comments

This commit is contained in:
objz committed 2026-10-01 22:58:09 +02:00
1 parent 260ad39c03
commit 7ea4860202
4 files changed
+4 -35

No files matched your search

@@ -6,10 +6,7 @@ use crate::tests::TEST_LOCK;
use ratatui::Terminal;
use ratatui::backend::TestBackend;
// WIZARD_STATE is a process-global static; without serialisation, parallel
// tests would race when each test sets the step and then renders, since
// render re-acquires the WIZARD_STATE mutex internally. this guard mutex
// ensures only one wizard snapshot test runs at a time.
// Render re-acquires WIZARD_STATE, so TEST_LOCK guards setup and rendering together.
fn reset_wizard_state(step: WizardStep) {
let mut guard = WIZARD_STATE.lock().expect("WIZARD_STATE lock");
*guard = WizardState::default();
@@ -19,7 +16,6 @@ fn reset_wizard_state(step: WizardStep) {
#[test]
fn new_instance_renders_name_step() {
let _serial = TEST_LOCK.lock().unwrap_or_else(|e| e.into_inner());
// Name is the default step; render touches no network helpers.
reset_wizard_state(WizardStep::Name);
let backend = TestBackend::new(60, 12);
@@ -33,8 +29,6 @@ fn new_instance_renders_name_step() {
#[test]
fn new_instance_renders_loader_step() {
let _serial = TEST_LOCK.lock().unwrap_or_else(|e| e.into_inner());
// Loader step is reached after Name; render just paints the hardcoded
// loader list, no network.
reset_wizard_state(WizardStep::Loader);
let backend = TestBackend::new(60, 12);
@@ -45,10 +39,7 @@ fn new_instance_renders_loader_step() {
insta::assert_snapshot!(terminal.backend());
}
// Version step: pre-populate versions as LoadState::Loaded so
// ensure_versions_loaded short-circuits and never spawns a network task.
// the three synthetic versions are marked stable=true so they show with
// show_snapshots=false (the default).
// Loaded fixtures keep rendering from spawning network tasks.
#[test]
fn new_instance_renders_version_step() {
use crate::instance::loader::GameVersion;
@@ -82,9 +73,6 @@ fn new_instance_renders_version_step() {
insta::assert_snapshot!(terminal.backend());
}
// LoaderVersion step: needs both versions and loader_versions pre-loaded.
// pick a non-Vanilla loader (loader_idx=2 = Forge) so the step doesn't
// skip itself to Confirm.
#[test]
fn new_instance_renders_loader_version_step() {
use crate::instance::loader::GameVersion;
@@ -111,8 +99,6 @@ fn new_instance_renders_loader_version_step() {
insta::assert_snapshot!(terminal.backend());
}
// Confirm step: paints a summary, no network, no list. requires
// versions + loader_versions Loaded so selected_*() return Some.
#[test]
fn new_instance_renders_confirm_step() {
use crate::instance::loader::GameVersion;
@@ -129,8 +115,6 @@ fn new_instance_renders_confirm_step() {
stable: true,
}]);
guard.loader_versions = LoadState::Loaded(vec!["0.15.0".into()]);
// TextState exposes only constructors; rebuilding with the
// desired initial value is the supported path.
guard.name_state = TextState::new().with_value("MyPack");
}