Commit Graph
10 Commits
Author SHA1 Message Date
objz 130661f144 feat(content): manage discovery installs incrementally 2026-07-26 14:05:49 +02:00
objz a05b030862 feat(content): install Modrinth project versions 2026-07-23 00:29:05 +02:00
objz 19c47cdf7b feat(content): refine Modrinth discovery streaming 2026-07-22 22:22:00 +02:00
objz a58e6fb76d style: apply rustfmt 2026-06-16 09:58:34 +02:00
objz 0d1b7984fc added: deferred tests-only items (extra wizard snapshots + library/asset downloads)
Closes the "zero production touches" subset of the deferred coverage
items the audit had flagged.

- src/tui/widgets/popups/new_instance/render.rs: three new snapshots
  for the Version, LoaderVersion, and Confirm steps. Each pre-populates
  WIZARD_STATE so ensure_versions_loaded and ensure_loader_versions_loaded
  short-circuit on LoadState::Loaded and never spawn a network task. The
  TEST_SERIAL mutex established in the earlier batch serialises against
  the existing Name/Loader snapshots.

- src/tui/widgets/popups/import_modpack/render.rs: two new snapshots
  for the Version step (synthetic VersionInfo entries) and the Confirm
  step (synthetic ImportSummary). Same serialisation pattern.

- tests/net_mojang.rs: three new wiremock tests.
  download_libraries_writes_artifact_to_meta_dir constructs a synthetic
  VersionMeta whose single library points at the wiremock server, then
  asserts the bytes land at meta_dir/libraries/<artifact.path>.
  download_libraries_skips_when_destination_exists verifies the cache
  hit path via wiremock's expect(0).
  download_assets_writes_index_when_objects_is_empty exercises the
  index fetch+write code path with an empty objects map so the per-asset
  download loop never fires.

  Zero production touches. download_libraries already takes a
  VersionMeta whose libraries carry their own URLs; download_assets'
  index fetch reads from meta.asset_index.url (also configurable
  per-call), so the empty-objects path doesn't need ASSETS_BASE_URL
  overridable. Full per-asset coverage lands in a separate commit.
2026-05-27 18:03:57 +02:00
objz 41d6da8008 added: ratatui snapshots for instance_list and wizard popups
Phase E added snapshots for the ErrorPopup; this extends the same
pattern to the three other high-value widgets the audit flagged.

- src/tui/widgets/instances.rs: two snapshots covering the instance
  list with three synthetic instances (verifies layout, "Never played"
  rendering, scrollbar gutter) and the empty list. State is passed in
  via the existing State::with_instances constructor; no global state
  involved.

- src/tui/widgets/popups/new_instance/render.rs: two snapshots covering
  the Name step (default) and Loader step (hardcoded loader list, no
  network). WIZARD_STATE is global, so the tests reset it under its
  mutex and serialise via a per-module TEST_SERIAL mutex to prevent
  cross-test races. The Version and LoaderVersion steps are skipped
  here because their render path calls ensure_versions_loaded which
  tokio::spawns a network task; covering them would need a fully
  pre-populated state and is deferred.

- src/tui/widgets/popups/import_modpack/render.rs: two snapshots
  covering the Input step (default) and the Fetching step (just a
  spinner + label, no network triggered by render). Same global-state
  serialisation pattern as new_instance.

Snapshots live next to each widget under snapshots/ as plain text and
are committed to git.
2026-05-27 17:22:33 +02:00
objz 1feb1679ff fix: clippy errors 2026-04-26 21:27:14 +02:00
objz 5dbb2be873 no-mistakes(lint): fix(lint): rustfmt formatting in mods.rs 2026-04-25 14:25:04 +02:00
objz 52787b57c7 fix: switch default profile to terminal and fixed some comments 2026-04-18 19:44:59 +02:00
objz 47dad69321 refactor: upgrade crates and restructure project 2026-04-18 16:59:27 +02:00