Skip to content

test(e2e): implement generator option scenarios #322

Description

@LayZeeDK

Parent: #319

Title: Implement generator option scenarios for move-file suite

Summary
Create scenario modules exercising all move-file generator option pathways: projectDirectory, deriveProjectDirectory, skipExport, skipFormat, allowUnicode, removeEmptyProject. Each scenario asserts critical invariants (file relocation, import/export rewrite behavior, project removal where applicable).

Objectives

  • Ensure option flags produce expected side effects without regressions.
  • Provide isolated, minimal fixtures per scenario (2 libs; optional app where needed).

Scope / Scenario Details

  1. MOVE-PROJECT-DIR
    • Input: projectDirectory explicitly set.
    • Assert: Target project created at specified path; exports updated; no duplicate entries.
  2. MOVE-DERIVE-DIR
    • Input: deriveProjectDirectory=true (mutually exclusive with projectDirectory).
    • Assert: Derived path matches derivation algorithm (based on original path segments); imports updated.
  3. MOVE-SKIP-EXPORT
    • Input: skipExport=true for exported file.
    • Assert: Index file unchanged; no dangling exports.
  4. MOVE-SKIP-FORMAT
    • Input: skipFormat=true.
    • Assert: Target file exists unformatted (detect via simple heuristic: presence of intentionally mis-spaced content) while move succeeds.
  5. MOVE-UNICODE
    • Input: allowUnicode=true with source file containing Unicode characters in filename.
    • Assert: Move succeeds; path sanitized only per security rules; imports updated.
  6. MOVE-REMOVE-EMPTY
    • Input: last remaining source files moved out.
    • Assert: Original project removed (project.json deletion) or marked empty per generator behavior.

Tasks

  • Implement run() for each scenario with workspace scaffold via harness.
  • Add focused assertions (avoid broad tree diffs).
  • Reuse publish/install pre-check from orchestrator.
  • Add minimal helper for import path validation.
  • Add scenario registration in orchestrator catalogue.

Acceptance Criteria

  • All six scenarios pass.
  • Each scenario fails if its core invariant regresses (e.g., skipped export incorrectly updated).
  • Unicode scenario validated on Windows & Linux locally (path length + characters) without errors.

Dependencies

  • Harness utilities; orchestrator target.

Out of Scope

  • Performance measurements; non-option scenarios.

Definition of Done
Scenario files merged; orchestrator executes them; docs list option coverage; linked in #319.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions