Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add E2E tests for quoted-message-refresh fix #3554

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/[email protected]
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
Loading