This commit is contained in:
Mikhail Kilin
2026-01-30 15:07:13 +03:00
parent 126c7482af
commit 4deb0fbe00
32 changed files with 1049 additions and 697 deletions

View File

@@ -2,9 +2,9 @@
mod helpers;
use helpers::test_data::{TestChatBuilder, create_test_chat};
use helpers::app_builder::TestAppBuilder;
use helpers::snapshot_utils::{render_to_buffer, buffer_to_string};
use helpers::snapshot_utils::{buffer_to_string, render_to_buffer};
use helpers::test_data::{create_test_chat, TestChatBuilder};
use insta::assert_snapshot;
#[test]
@@ -44,9 +44,7 @@ fn snapshot_chat_with_unread_count() {
.last_message("Привет, как дела?")
.build();
let mut app = TestAppBuilder::new()
.with_chat(chat)
.build();
let mut app = TestAppBuilder::new().with_chat(chat).build();
let buffer = render_to_buffer(80, 24, |f| {
tele_tui::ui::chat_list::render(f, f.area(), &mut app);
@@ -63,9 +61,7 @@ fn snapshot_chat_with_pinned() {
.last_message("Pinned message")
.build();
let mut app = TestAppBuilder::new()
.with_chat(chat)
.build();
let mut app = TestAppBuilder::new().with_chat(chat).build();
let buffer = render_to_buffer(80, 24, |f| {
tele_tui::ui::chat_list::render(f, f.area(), &mut app);
@@ -83,9 +79,7 @@ fn snapshot_chat_with_muted() {
.last_message("Too many messages")
.build();
let mut app = TestAppBuilder::new()
.with_chat(chat)
.build();
let mut app = TestAppBuilder::new().with_chat(chat).build();
let buffer = render_to_buffer(80, 24, |f| {
tele_tui::ui::chat_list::render(f, f.area(), &mut app);
@@ -103,9 +97,7 @@ fn snapshot_chat_with_mentions() {
.last_message("@me check this out")
.build();
let mut app = TestAppBuilder::new()
.with_chat(chat)
.build();
let mut app = TestAppBuilder::new().with_chat(chat).build();
let buffer = render_to_buffer(80, 24, |f| {
tele_tui::ui::chat_list::render(f, f.area(), &mut app);
@@ -139,9 +131,7 @@ fn snapshot_chat_long_title() {
.last_message("Test message")
.build();
let mut app = TestAppBuilder::new()
.with_chat(chat)
.build();
let mut app = TestAppBuilder::new().with_chat(chat).build();
let buffer = render_to_buffer(80, 24, |f| {
tele_tui::ui::chat_list::render(f, f.area(), &mut app);