Skip to content

Check every module name in the Vue dropdown against Factorio #191

Open

Description

@wormeyman

Split out of #80, item 3. That item survived the Rust port.

src/vue/src/components/ModuleSelect.vue:12-23 hardcodes nine module names: efficiency-module, productivity-module and speed-module, at tiers 1 to 3. Only the three tier-3 names are checked against the captured Factorio fixture. They are in item_names::vanilla in rust/planner/src/data.rs:178-188, which rust/planner/tests/factorio_oracle.rs checks. The other six are checked against nothing. So the next module rename in Factorio would break the dropdown the same way effectivity-module did in 2.0, and no test would notice.

Fix

  • Generate the module list instead of typing it. The repo already does this for planner constants: rust/contract/tests/planner_defaults.rs writes src/vue/src/lib/plannerDefaults.verified.json and fails when the file is stale.
  • Add all nine module names to the Rust side, so the oracle test checks them. Emit them from that same test, and have ModuleSelect.vue read the list from the JSON.
  • Keep the display labels ("Speed module 2") in the Vue code, or generate them from the names.

Done when

  • A renamed or removed module name fails cargo test.
  • The dropdown shows the same nine options as today.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions