#![cfg(all(feature = "plugins", feature = "embed-plugins"))]
use crate::common::harness::{EditorTestHarness, HarnessOptions};
use crossterm::event::{KeyCode, KeyModifiers};
use std::fs;
use tempfile::TempDir;
#[test]
fn test_empty_plugins_dir_in_working_dir_does_not_hide_embedded_plugins() {
let temp_dir = TempDir::new().unwrap();
let working_dir = temp_dir.path().to_path_buf();
let user_plugins_dir = working_dir.join("plugins");
fs::create_dir_all(&user_plugins_dir).unwrap();
let mut harness = EditorTestHarness::create(
140,
40,
HarnessOptions::new()
.with_working_dir(working_dir.clone())
.with_forced_embedded_plugins(),
)
.unwrap();
harness
.send_key(KeyCode::Char('p'), KeyModifiers::CONTROL)
.unwrap();
harness.wait_for_prompt().unwrap();
harness.type_text("Packages").unwrap();
harness
.wait_until(|h| {
h.screen_to_string()
.contains("Browse and manage installed and available packages")
})
.unwrap();
}