mirror of
https://github.com/openai/codex.git
synced 2026-11-13 06:45:07 +00:00
## What changed - Detect and import supported Cursor settings, sandbox permissions, MCP servers, project instructions, hooks, agents, commands, plugins, and recent chat sessions. - Update the `/import` flow to check Claude Code and Cursor, prompting for a source when both have importable data. - Add `migrationSource` to the app-server detect and import requests so each operation uses the selected adapter, while retaining `source` for import attribution and backwards compatibility. ## Testing - Add coverage for Cursor config conversion, hooks, plugins, session discovery and conversion, app-server imports, and TUI source selection. GitOrigin-RevId: a65a1511b6c1c2f9e3e0cfe4f816bb435807282e
43 lines
1.3 KiB
Rust
43 lines
1.3 KiB
Rust
use super::*;
|
|
use crate::test_backend::VT100Backend;
|
|
use crossterm::event::KeyEvent;
|
|
use crossterm::event::KeyModifiers;
|
|
use pretty_assertions::assert_eq;
|
|
use ratatui::Terminal;
|
|
|
|
fn new_screen() -> ExternalAgentConfigSourceScreen {
|
|
ExternalAgentConfigSourceScreen::new(
|
|
FrameRequester::test_dummy(),
|
|
&ExternalAgentConfigMigrationSource::ALL,
|
|
)
|
|
}
|
|
|
|
#[test]
|
|
fn external_agent_config_source_prompt_snapshot() {
|
|
let screen = new_screen();
|
|
let mut terminal =
|
|
Terminal::new(VT100Backend::new(/*width*/ 80, /*height*/ 12)).expect("terminal");
|
|
terminal
|
|
.draw(|frame| frame.render_widget_ref(&screen, frame.area()))
|
|
.expect("render source prompt");
|
|
insta::assert_snapshot!("external_agent_config_source_prompt", terminal.backend());
|
|
}
|
|
|
|
#[test]
|
|
fn external_agent_config_source_prompt_selects_highlighted_source() {
|
|
let mut screen = new_screen();
|
|
screen.handle_key(KeyEvent::new(KeyCode::Down, KeyModifiers::NONE));
|
|
screen.handle_key(KeyEvent::new(KeyCode::Enter, KeyModifiers::NONE));
|
|
assert_eq!(
|
|
screen.selection(),
|
|
Some(ExternalAgentConfigMigrationSource::Cur)
|
|
);
|
|
}
|
|
|
|
#[test]
|
|
fn external_agent_config_source_prompt_can_cancel() {
|
|
let mut screen = new_screen();
|
|
screen.handle_key(KeyEvent::new(KeyCode::Esc, KeyModifiers::NONE));
|
|
assert_eq!(screen.selection(), None);
|
|
}
|