This commit is contained in:
Mikhail Kilin
2026-01-31 23:02:53 +03:00
parent af3c36b9a1
commit c5896b7f14
17 changed files with 1899 additions and 567 deletions

View File

@@ -159,3 +159,36 @@ fn snapshot_chat_search_mode() {
let output = buffer_to_string(&buffer);
assert_snapshot!("chat_list_search_mode", output);
}
#[test]
fn snapshot_chat_with_online_status() {
use tele_tui::tdlib::UserOnlineStatus;
use tele_tui::types::ChatId;
let chat = TestChatBuilder::new("Alice", 123)
.last_message("Hey there!")
.build();
let mut app = TestAppBuilder::new()
.with_chat(chat)
.selected_chat(123)
.build();
// Устанавливаем онлайн-статус для чата напрямую
let chat_id = ChatId::new(123);
let user_id = tele_tui::types::UserId::new(123);
// Регистрируем чат как приватный
app.td_client.user_cache.register_private_chat(chat_id, user_id);
// Устанавливаем онлайн-статус
app.td_client.user_cache.user_statuses.insert(user_id, UserOnlineStatus::Online);
let buffer = render_to_buffer(80, 24, |f| {
tele_tui::ui::chat_list::render(f, f.area(), &mut app);
});
let output = buffer_to_string(&buffer);
assert_snapshot!("chat_with_online_status", output);
}