DEV: Fix number of chars for chat message content in fabricator (#22454)

Why this change?

`Faker::Lorem.paragraph` generates a differrent length of string
every time. When a string happens to be long, it can change the UI
across system test runs making it harder to reason about our system
tests across multiple runs since the state is never really consistent.

We will just generate a paragraph with a fixed length going forward so
that the UI remains consistent. This should make certain tests which
relies on the UI being in a certain state to become less flaky.
This commit is contained in:
Alan Guo Xiang Tan 2023-07-06 10:34:57 +08:00 committed by GitHub
parent 7b40ec859f
commit ff38bccb80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -66,7 +66,7 @@ Fabricator(:chat_message, class_name: "Chat::MessageCreator") do
resolved_class.create(
chat_channel: channel,
user: user,
content: transients[:message] || Faker::Lorem.paragraph,
content: transients[:message] || Faker::Lorem.paragraph_by_chars(number: 500),
thread_id: transients[:thread]&.id,
in_reply_to_id: transients[:in_reply_to]&.id,
upload_ids: transients[:upload_ids],