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

@@ -5,11 +5,11 @@ mod helpers;
use helpers::fake_tdclient::FakeTdClient;
use helpers::test_data::create_test_chat;
use tele_tui::tdlib::ProfileInfo;
use tele_tui::types::ChatId;
use tele_tui::types::{ChatId, MessageId};
/// Test: Открытие профиля в личном чате (i)
#[test]
fn test_open_profile_in_private_chat() {
#[tokio::test]
async fn test_open_profile_in_private_chat() {
let client = FakeTdClient::new();
let chat = create_test_chat("Alice", 123);
@@ -24,8 +24,8 @@ fn test_open_profile_in_private_chat() {
}
/// Test: Профиль показывает имя, username, телефон
#[test]
fn test_profile_shows_user_info() {
#[tokio::test]
async fn test_profile_shows_user_info() {
let profile = ProfileInfo {
chat_id: ChatId::new(123),
title: "Alice Johnson".to_string(),
@@ -47,8 +47,8 @@ fn test_profile_shows_user_info() {
}
/// Test: Профиль в группе показывает количество участников
#[test]
fn test_profile_shows_group_member_count() {
#[tokio::test]
async fn test_profile_shows_group_member_count() {
let profile = ProfileInfo {
chat_id: ChatId::new(456),
title: "Work Team".to_string(),
@@ -70,8 +70,8 @@ fn test_profile_shows_group_member_count() {
}
/// Test: Профиль в канале
#[test]
fn test_profile_shows_channel_info() {
#[tokio::test]
async fn test_profile_shows_channel_info() {
let profile = ProfileInfo {
chat_id: ChatId::new(789),
title: "News Channel".to_string(),
@@ -93,8 +93,8 @@ fn test_profile_shows_channel_info() {
}
/// Test: Закрытие профиля (Esc)
#[test]
fn test_close_profile_with_esc() {
#[tokio::test]
async fn test_close_profile_with_esc() {
// Профиль открыт
let profile_mode = true;
@@ -105,8 +105,8 @@ fn test_close_profile_with_esc() {
}
/// Test: Профиль без username и phone
#[test]
fn test_profile_without_optional_fields() {
#[tokio::test]
async fn test_profile_without_optional_fields() {
let profile = ProfileInfo {
chat_id: ChatId::new(999),
title: "Anonymous User".to_string(),