commit
This commit is contained in:
@@ -2,17 +2,17 @@
|
||||
|
||||
mod helpers;
|
||||
|
||||
use helpers::test_data::{TestChatBuilder, TestMessageBuilder, create_test_chat, create_test_profile};
|
||||
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, create_test_profile, TestChatBuilder, TestMessageBuilder,
|
||||
};
|
||||
use insta::assert_snapshot;
|
||||
|
||||
#[test]
|
||||
fn snapshot_delete_confirmation_modal() {
|
||||
let chat = create_test_chat("Mom", 123);
|
||||
let message = TestMessageBuilder::new("Delete me", 1)
|
||||
.outgoing()
|
||||
.build();
|
||||
let message = TestMessageBuilder::new("Delete me", 1).outgoing().build();
|
||||
|
||||
let app = TestAppBuilder::new()
|
||||
.with_chat(chat)
|
||||
@@ -32,8 +32,7 @@ fn snapshot_delete_confirmation_modal() {
|
||||
#[test]
|
||||
fn snapshot_emoji_picker_default() {
|
||||
let chat = create_test_chat("Mom", 123);
|
||||
let message = TestMessageBuilder::new("React to this", 1)
|
||||
.build();
|
||||
let message = TestMessageBuilder::new("React to this", 1).build();
|
||||
|
||||
let app = TestAppBuilder::new()
|
||||
.with_chat(chat)
|
||||
@@ -53,8 +52,7 @@ fn snapshot_emoji_picker_default() {
|
||||
#[test]
|
||||
fn snapshot_emoji_picker_with_selection() {
|
||||
let chat = create_test_chat("Mom", 123);
|
||||
let message = TestMessageBuilder::new("React to this", 1)
|
||||
.build();
|
||||
let message = TestMessageBuilder::new("React to this", 1).build();
|
||||
|
||||
let mut app = TestAppBuilder::new()
|
||||
.with_chat(chat)
|
||||
@@ -97,8 +95,7 @@ fn snapshot_profile_personal_chat() {
|
||||
|
||||
#[test]
|
||||
fn snapshot_profile_group_chat() {
|
||||
let chat = TestChatBuilder::new("Work Group", 456)
|
||||
.build();
|
||||
let chat = TestChatBuilder::new("Work Group", 456).build();
|
||||
|
||||
let mut profile = create_test_profile("Work Group", 456);
|
||||
profile.is_group = true;
|
||||
@@ -125,10 +122,8 @@ fn snapshot_profile_group_chat() {
|
||||
#[test]
|
||||
fn snapshot_pinned_message() {
|
||||
let chat = create_test_chat("Mom", 123);
|
||||
let message1 = TestMessageBuilder::new("Regular message", 1)
|
||||
.build();
|
||||
let pinned_msg = TestMessageBuilder::new("Important pinned message!", 2)
|
||||
.build();
|
||||
let message1 = TestMessageBuilder::new("Regular message", 1).build();
|
||||
let pinned_msg = TestMessageBuilder::new("Important pinned message!", 2).build();
|
||||
|
||||
let mut app = TestAppBuilder::new()
|
||||
.with_chat(chat)
|
||||
@@ -150,12 +145,9 @@ fn snapshot_pinned_message() {
|
||||
#[test]
|
||||
fn snapshot_search_in_chat() {
|
||||
let chat = create_test_chat("Mom", 123);
|
||||
let msg1 = TestMessageBuilder::new("Hello world", 1)
|
||||
.build();
|
||||
let msg2 = TestMessageBuilder::new("World is beautiful", 2)
|
||||
.build();
|
||||
let msg3 = TestMessageBuilder::new("Beautiful day", 3)
|
||||
.build();
|
||||
let msg1 = TestMessageBuilder::new("Hello world", 1).build();
|
||||
let msg2 = TestMessageBuilder::new("World is beautiful", 2).build();
|
||||
let msg3 = TestMessageBuilder::new("Beautiful day", 3).build();
|
||||
|
||||
let mut app = TestAppBuilder::new()
|
||||
.with_chat(chat)
|
||||
@@ -182,8 +174,7 @@ fn snapshot_forward_mode() {
|
||||
let chat2 = create_test_chat("Dad", 456);
|
||||
let chat3 = create_test_chat("Work Group", 789);
|
||||
|
||||
let message = TestMessageBuilder::new("Forward this message", 1)
|
||||
.build();
|
||||
let message = TestMessageBuilder::new("Forward this message", 1).build();
|
||||
|
||||
let mut app = TestAppBuilder::new()
|
||||
.with_chats(vec![chat1.clone(), chat2, chat3])
|
||||
|
||||
Reference in New Issue
Block a user