Skip to content

Commit

Permalink
Add E2E tests for quoted-message-refresh fix (#3554)
Browse files Browse the repository at this point in the history
  • Loading branch information
testableapple authored Jan 9, 2025
1 parent 4c92873 commit ea4373b
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 3 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/smoke-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ env:
jobs:
build-test-app-and-frameworks:
name: Build Test App and Frameworks
runs-on: macos-14
runs-on: macos-15
if: ${{ github.event_name != 'push' }}
steps:
- uses: actions/checkout@v4.1.1
Expand All @@ -35,8 +35,6 @@ jobs:
- name: Build
run: bundle exec fastlane build_test_app_and_frameworks
timeout-minutes: 60
env:
XCODE_VERSION: "15.0.1" # Should match the minimum version in dependent jobs
- uses: actions/upload-artifact@v4
if: success()
with:
Expand Down
90 changes: 90 additions & 0 deletions StreamChatUITestsAppUITests/Tests/QuotedReply_Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//

import XCTest
@testable import StreamChatUI

final class QuotedReply_Tests: StreamTestCase {

Expand Down Expand Up @@ -217,6 +218,29 @@ final class QuotedReply_Tests: StreamTestCase {
userRobot.assertDeletedMessage()
}
}

func test_originalQuoteIsDeletedByParticipant_deletedMessageIsShown() {
linkToScenario(withId: 6643)

GIVEN("user opens the channel") {
userRobot.login().openChannel()
}
AND("participant sends a message") {
participantRobot.sendMessage("1")
}
AND("user adds a quoted reply") {
userRobot.quoteMessage(replyText)
}
WHEN("participant deletes an original message") {
participantRobot.deleteMessage()
}
THEN("deleted message is shown") {
userRobot.assertDeletedMessage(at: 1)
}
AND("deleted message is shown in quoted reply bubble") {
userRobot.assertQuotedMessage(L10n.Message.deletedMessagePlaceholder)
}
}

func test_quotedReplyIsDeletedByUser_deletedMessageIsShown() {
linkToScenario(withId: 109)
Expand All @@ -235,6 +259,27 @@ final class QuotedReply_Tests: StreamTestCase {
userRobot.assertDeletedMessage()
}
}

func test_originalQuoteIsDeletedByUser_deletedMessageIsShown() {
linkToScenario(withId: 6644)

GIVEN("user opens the channel") {
backendRobot.generateChannels(count: 1, messagesCount: 1)
userRobot.login().openChannel()
}
AND("user adds a quoted reply") {
userRobot.quoteMessage(replyText)
}
WHEN("user deletes an original message") {
userRobot.deleteMessage(messageCellIndex: 1)
}
THEN("deleted message is shown") {
userRobot.assertDeletedMessage(at: 1)
}
AND("deleted message is shown in quoted reply bubble") {
userRobot.assertQuotedMessage(L10n.Message.deletedMessagePlaceholder)
}
}

func test_unreadCount_whenUserSendsInvalidCommand_and_jumpingOnQuotedMessage() {
linkToScenario(withId: 1676)
Expand Down Expand Up @@ -537,6 +582,30 @@ final class QuotedReply_Tests: StreamTestCase {
userRobot.openThread().assertDeletedMessage()
}
}

func test_originalQuoteIsDeletedByParticipant_deletedMessageIsShown_InThread() {
linkToScenario(withId: 6645)

GIVEN("user opens the channel") {
backendRobot.generateChannels(count: 1, messageText: parentText, messagesCount: 1)
userRobot.login().openChannel()
}
AND("participant sends a message") {
participantRobot.replyToMessageInThread("1")
}
AND("user adds a quoted reply") {
userRobot.openThread().quoteMessage(replyText)
}
WHEN("participant deletes an original message") {
participantRobot.deleteMessage()
}
THEN("deleted message is shown") {
userRobot.assertDeletedMessage(at: 1)
}
AND("deleted message is shown in quoted reply bubble") {
userRobot.assertQuotedMessage(L10n.Message.deletedMessagePlaceholder)
}
}

func test_quotedReplyIsDeletedByUser_deletedMessageIsShown_InThread() {
linkToScenario(withId: 1965)
Expand All @@ -555,6 +624,27 @@ final class QuotedReply_Tests: StreamTestCase {
userRobot.assertDeletedMessage()
}
}

func test_originalQuoteIsDeletedByUser_deletedMessageIsShown_InThread() {
linkToScenario(withId: 6646)

GIVEN("user opens the channel") {
backendRobot.generateChannels(count: 1, messagesCount: 1)
userRobot.login().openChannel()
}
AND("user adds a quoted reply") {
userRobot.openThread().quoteMessage(replyText)
}
WHEN("user deletes an original message") {
userRobot.deleteMessage(messageCellIndex: 1)
}
THEN("deleted message is shown") {
userRobot.assertDeletedMessage(at: 1)
}
AND("deleted message is shown in quoted reply bubble") {
userRobot.assertQuotedMessage(L10n.Message.deletedMessagePlaceholder)
}
}

func test_rootMessageShouldOnlyBeVisibleInTheLastPageInThread() {
linkToScenario(withId: 1997)
Expand Down

0 comments on commit ea4373b

Please sign in to comment.