commit
This commit is contained in:
@@ -34,11 +34,13 @@ fn snapshot_emoji_picker_default() {
|
||||
let chat = create_test_chat("Mom", 123);
|
||||
let message = TestMessageBuilder::new("React to this", 1).build();
|
||||
|
||||
let reactions = vec!["👍".to_string(), "👎".to_string(), "❤️".to_string(), "🔥".to_string(), "😊".to_string(), "😢".to_string(), "😮".to_string(), "🎉".to_string()];
|
||||
|
||||
let app = TestAppBuilder::new()
|
||||
.with_chat(chat)
|
||||
.with_message(123, message)
|
||||
.selected_chat(123)
|
||||
.reaction_picker()
|
||||
.reaction_picker(1, reactions)
|
||||
.build();
|
||||
|
||||
let buffer = render_to_buffer(80, 24, |f| {
|
||||
@@ -54,15 +56,19 @@ fn snapshot_emoji_picker_with_selection() {
|
||||
let chat = create_test_chat("Mom", 123);
|
||||
let message = TestMessageBuilder::new("React to this", 1).build();
|
||||
|
||||
let reactions = vec!["👍".to_string(), "👎".to_string(), "❤️".to_string(), "🔥".to_string(), "😊".to_string(), "😢".to_string(), "😮".to_string(), "🎉".to_string()];
|
||||
|
||||
let mut app = TestAppBuilder::new()
|
||||
.with_chat(chat)
|
||||
.with_message(123, message)
|
||||
.selected_chat(123)
|
||||
.reaction_picker()
|
||||
.reaction_picker(1, reactions)
|
||||
.build();
|
||||
|
||||
// Выбираем 5-ю реакцию (индекс 4)
|
||||
app.selected_reaction_index = 4;
|
||||
if let tele_tui::app::ChatState::ReactionPicker { selected_index, .. } = &mut app.chat_state {
|
||||
*selected_index = 4;
|
||||
}
|
||||
|
||||
let buffer = render_to_buffer(80, 24, |f| {
|
||||
tele_tui::ui::messages::render(f, f.area(), &app);
|
||||
@@ -77,14 +83,12 @@ fn snapshot_profile_personal_chat() {
|
||||
let chat = create_test_chat("Alice", 123);
|
||||
let profile = create_test_profile("Alice", 123);
|
||||
|
||||
let mut app = TestAppBuilder::new()
|
||||
let app = TestAppBuilder::new()
|
||||
.with_chat(chat)
|
||||
.selected_chat(123)
|
||||
.profile_mode()
|
||||
.profile_mode(profile)
|
||||
.build();
|
||||
|
||||
app.profile_info = Some(profile);
|
||||
|
||||
let buffer = render_to_buffer(80, 24, |f| {
|
||||
tele_tui::ui::messages::render(f, f.area(), &app);
|
||||
});
|
||||
@@ -103,14 +107,12 @@ fn snapshot_profile_group_chat() {
|
||||
profile.member_count = Some(25);
|
||||
profile.description = Some("Work discussion group".to_string());
|
||||
|
||||
let mut app = TestAppBuilder::new()
|
||||
let app = TestAppBuilder::new()
|
||||
.with_chat(chat)
|
||||
.selected_chat(456)
|
||||
.profile_mode()
|
||||
.profile_mode(profile)
|
||||
.build();
|
||||
|
||||
app.profile_info = Some(profile);
|
||||
|
||||
let buffer = render_to_buffer(80, 24, |f| {
|
||||
tele_tui::ui::messages::render(f, f.area(), &app);
|
||||
});
|
||||
@@ -157,8 +159,10 @@ fn snapshot_search_in_chat() {
|
||||
.build();
|
||||
|
||||
// Устанавливаем результаты поиска
|
||||
app.message_search_results = vec![msg1, msg2];
|
||||
app.selected_search_result_index = 0;
|
||||
if let tele_tui::app::ChatState::SearchInChat { results, selected_index, .. } = &mut app.chat_state {
|
||||
*results = vec![msg1, msg2];
|
||||
*selected_index = 0;
|
||||
}
|
||||
|
||||
let buffer = render_to_buffer(80, 24, |f| {
|
||||
tele_tui::ui::messages::render(f, f.area(), &app);
|
||||
|
||||
Reference in New Issue
Block a user