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::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;
use insta::assert_snapshot;
use tele_tui::tdlib::NetworkState;
@@ -12,9 +12,7 @@ use tele_tui::tdlib::NetworkState;
fn snapshot_footer_chat_list() {
let chat = create_test_chat("Mom", 123);
let app = TestAppBuilder::new()
.with_chat(chat)
.build();
let app = TestAppBuilder::new().with_chat(chat).build();
let buffer = render_to_buffer(80, 24, |f| {
tele_tui::ui::footer::render(f, f.area(), &app);
@@ -45,9 +43,7 @@ fn snapshot_footer_open_chat() {
fn snapshot_footer_network_waiting() {
let chat = create_test_chat("Mom", 123);
let mut app = TestAppBuilder::new()
.with_chat(chat)
.build();
let mut app = TestAppBuilder::new().with_chat(chat).build();
// Set network state to WaitingForNetwork
app.td_client.network_state = NetworkState::WaitingForNetwork;
@@ -64,9 +60,7 @@ fn snapshot_footer_network_waiting() {
fn snapshot_footer_network_connecting_proxy() {
let chat = create_test_chat("Mom", 123);
let mut app = TestAppBuilder::new()
.with_chat(chat)
.build();
let mut app = TestAppBuilder::new().with_chat(chat).build();
// Set network state to ConnectingToProxy
app.td_client.network_state = NetworkState::ConnectingToProxy;
@@ -83,9 +77,7 @@ fn snapshot_footer_network_connecting_proxy() {
fn snapshot_footer_network_connecting() {
let chat = create_test_chat("Mom", 123);
let mut app = TestAppBuilder::new()
.with_chat(chat)
.build();
let mut app = TestAppBuilder::new().with_chat(chat).build();
// Set network state to Connecting
app.td_client.network_state = NetworkState::Connecting;