Skip to content

fix(tui): 3 leftover kcode/jcode decollision test mismatches in helpers + turn_notify #131

Open

Description

@KooshaPari

Summary

Three TUI test failures are simple kcode/jcode decollision leftovers
from the recent binary rename. The production code was already migrated
to kcode, but a few hardcoded "jcode" literals in tests and one
production fallback were missed.

Affected sites

1. crates/jcode-tui/src/tui/app/helpers.rs:191 (production bug)

.unwrap_or_else(|| PathBuf::from("jcode"))

This is the fallback for launch_client_executable(). If neither
client_update_candidate nor current_exe() resolves, the
production code falls back to the literal string "jcode". For the
KCode fork this should be "kcode".

Fix: PathBuf::from("kcode").

2. crates/jcode-tui/src/tui/app/helpers_tests.rs:358, 385 (test)

assert_eq!(
    program.file_name().and_then(|name| name.to_str()),
    Some("jcode")
);

Two tests in build_resume_command_uses_imported_jcode_session_for_*
assert the file_name is "jcode". After the rename, the production
returns "kcode". Note the test setup function (line ~340) already
creates a file called kcode in <KCODE_HOME>/builds/current/kcode,
so the test expectations are clearly stale.

Fix: Some("kcode").

3. crates/jcode-tui/src/tui/app/turn_notify.rs:228, 443, 455, 516, 545 (production + tests)

Production: let mut title = String::from("jcode"); (line 228) —
the title prefix for turn notifications.

Tests: 4 assertions checking for "jcode · ..." in the title and
2 occurrences of i=jcode-turn-sessionfox123 in the expected
kitty notification sequence.

After the rename, the code at line 176 already uses "kcode-turn-{}"
for the kitty notification identifier. The title at line 228 and the
corresponding test expectations were missed.

Fix: update production String::from("kcode") and update 4 test
title expectations + the 2 kitty identifier occurrences in line 545.

Evidence

The CI Build & Test failure log shows left: Some("kcode") (actual
production) vs right: Some("jcode") (stale test expectation) for
the helpers tests, and the analogous kcode vs jcode mismatch in
turn_notify.

Out of scope (separate issues)

The remaining 22 TUI test failures (tui::app::tests::test_fork_command_*,
tui::session_picker::*, tui::terminal_mode_tests::*,
tui::ui::messages::tests::render_system_message_*, etc.) are
real regressions from the TUI refactors (missing resume hints, ANSI
escape sequence drift, scrollbar glyph regressions, etc.). They
need their own focused fixes.

Resolution

Closed by PR (TBD).

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions