Skip to content

Commit

Permalink
Update StreamSwiftTestHelpers
Browse files Browse the repository at this point in the history
  • Loading branch information
testableapple committed Oct 5, 2023
1 parent 2e67149 commit fa11832
Show file tree
Hide file tree
Showing 605 changed files with 229 additions and 232 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/smoke-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:

env:
HOMEBREW_NO_INSTALL_CLEANUP: 1 # Disable cleanup for homebrew, we don't need it on CI
IOS_SIMULATOR_DEVICE: "iPhone 14 Pro (17.0)"
IOS_SIMULATOR_DEVICE: "iPhone 15 Pro (17.0)"

jobs:
automated-code-review:
Expand Down
152 changes: 72 additions & 80 deletions StreamChatSwiftUI.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// Copyright © 2023 Stream.io Inc. All rights reserved.
//

@testable import SnapshotTesting
@testable import StreamChat
@testable import StreamChatSwiftUI
@testable import StreamSwiftTestHelpers
import SwiftUI
import XCTest

Expand All @@ -25,6 +25,6 @@ class AddUsersView_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
AssertSnapshot(view)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// Copyright © 2023 Stream.io Inc. All rights reserved.
//

@testable import SnapshotTesting
@testable import StreamChat
@testable import StreamChatSwiftUI
@testable import StreamSwiftTestHelpers
import SwiftUI
import XCTest

Expand All @@ -26,7 +26,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
AssertSnapshot(view)
}

func test_chatChannelInfoView_directChannelOnlineSnapshot() {
Expand All @@ -46,7 +46,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
AssertSnapshot(view)
}

func test_chatChannelInfoView_directChannelMutedSnapshot() {
Expand All @@ -66,7 +66,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
AssertSnapshot(view)
}

func test_chatChannelInfoView_groupCollapsedSnapshot() {
Expand All @@ -89,7 +89,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
AssertSnapshot(view)
}

func test_chatChannelInfoView_smallGroupSnapshot() {
Expand All @@ -112,7 +112,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
AssertSnapshot(view)
}

func test_chatChannelInfoView_groupExpandedSnapshot() {
Expand All @@ -137,7 +137,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
AssertSnapshot(view)
}

func test_chatChannelInfoView_navBarSnapshot() {
Expand Down Expand Up @@ -166,7 +166,7 @@ class ChatChannelInfoView_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: navigationView, as: .image(perceptualPrecision: snapshotPrecision))
AssertSnapshot(navigationView)
}

func test_chatChannelInfoView_addUsersShownSnapshot() {
Expand All @@ -191,6 +191,6 @@ class ChatChannelInfoView_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
AssertSnapshot(view)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// Copyright © 2023 Stream.io Inc. All rights reserved.
//

@testable import SnapshotTesting
@testable import StreamChat
@testable import StreamChatSwiftUI
@testable import StreamSwiftTestHelpers
import SwiftUI
import XCTest

Expand All @@ -25,7 +25,7 @@ class FileAttachmentsView_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
AssertSnapshot(view)
}

func test_fileAttachmentsView_emptySnapshot() {
Expand All @@ -40,7 +40,7 @@ class FileAttachmentsView_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
AssertSnapshot(view)
}

func test_fileAttachmentsView_loadingSnapshot() {
Expand All @@ -55,7 +55,7 @@ class FileAttachmentsView_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
AssertSnapshot(view)
}

func test_fileAttachmentsPickerView_snapshot() {
Expand All @@ -64,6 +64,6 @@ class FileAttachmentsView_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
AssertSnapshot(view)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// Copyright © 2023 Stream.io Inc. All rights reserved.
//

@testable import SnapshotTesting
@testable import StreamChat
@testable import StreamChatSwiftUI
@testable import StreamSwiftTestHelpers
import SwiftUI
import XCTest

Expand All @@ -28,7 +28,7 @@ class MediaAttachmentsView_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
AssertSnapshot(view)
}

func test_mediaAttachmentsView_emptySnapshot() {
Expand All @@ -41,7 +41,7 @@ class MediaAttachmentsView_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
AssertSnapshot(view)
}

func test_mediaAttachmentsView_loading() {
Expand All @@ -54,6 +54,6 @@ class MediaAttachmentsView_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
AssertSnapshot(view)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// Copyright © 2023 Stream.io Inc. All rights reserved.
//

@testable import SnapshotTesting
@testable import StreamChat
@testable import StreamChatSwiftUI
@testable import StreamSwiftTestHelpers
import SwiftUI
import XCTest

Expand All @@ -27,7 +27,7 @@ class PinnedMessagesView_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
AssertSnapshot(view)
}

func test_pinnedMessagesView_emptySnapshot() {
Expand All @@ -39,7 +39,7 @@ class PinnedMessagesView_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
AssertSnapshot(view)
}
}

Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Copyright © 2023 Stream.io Inc. All rights reserved.
//

import SnapshotTesting
@testable import StreamChat
@testable import StreamChatSwiftUI
import SwiftUI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// Copyright © 2023 Stream.io Inc. All rights reserved.
//

import SnapshotTesting
@testable import StreamChat
@testable import StreamChatSwiftUI
@testable import StreamSwiftTestHelpers
import SwiftUI
import XCTest

Expand All @@ -23,7 +23,7 @@ class ChatChannelHeader_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
AssertSnapshot(view)
}

func test_chatChannelHeader_snapshot() {
Expand All @@ -41,7 +41,7 @@ class ChatChannelHeader_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
AssertSnapshot(view)
}

func test_channelTitleView_snapshot() {
Expand All @@ -53,6 +53,6 @@ class ChatChannelHeader_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
AssertSnapshot(view)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// Copyright © 2023 Stream.io Inc. All rights reserved.
//

@testable import SnapshotTesting
@testable import StreamChat
@testable import StreamChatSwiftUI
@testable import StreamSwiftTestHelpers
import SwiftUI
import XCTest

Expand Down Expand Up @@ -62,6 +62,6 @@ class ChatChannelViewDateOverlay_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
AssertSnapshot(view)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

@testable import StreamChat
@testable import StreamChatSwiftUI
@testable import StreamSwiftTestHelpers
import SwiftUI
import XCTest

Expand Down Expand Up @@ -358,7 +359,12 @@ class ChatChannelViewModel_Tests: StreamChatTestCase {
let channelController = makeChannelController()
let viewModel = ChatChannelViewModel(channelController: channelController)
let channel = ChatChannel.mockDMChannel()
let read = ChatChannelRead.mock(lastReadAt: Date(), lastReadMessageId: nil, unreadMessagesCount: 1, user: .mock(id: .unique))
let read = ChatChannelRead.mock(
lastReadAt: Date(),
lastReadMessageId: nil,
unreadMessagesCount: 1,
user: .mock(id: .unique)
)
let newChannel = ChatChannel.mockDMChannel(reads: [read])

// When
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// Copyright © 2023 Stream.io Inc. All rights reserved.
//

@testable import SnapshotTesting
@testable import StreamChat
@testable import StreamChatSwiftUI
@testable import StreamSwiftTestHelpers
import SwiftUI
import XCTest

Expand Down Expand Up @@ -51,7 +51,7 @@ class ChatChannelView_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
AssertSnapshot(view)
}

func test_chatChannelView_snapshotEmpty() {
Expand Down Expand Up @@ -82,7 +82,7 @@ class ChatChannelView_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
AssertSnapshot(view)
}

func test_chatChannelView_snapshotLoading() {
Expand All @@ -107,7 +107,7 @@ class ChatChannelView_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
AssertSnapshot(view)
}

func test_defaultChannelHeader_snapshot() {
Expand All @@ -126,6 +126,6 @@ class ChatChannelView_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
AssertSnapshot(view)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

@testable import StreamChat
@testable import StreamChatSwiftUI
@testable import StreamSwiftTestHelpers
import SwiftUI
import XCTest

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// Copyright © 2023 Stream.io Inc. All rights reserved.
//

import SnapshotTesting
@testable import StreamChat
@testable import StreamChatSwiftUI
@testable import StreamSwiftTestHelpers
import SwiftUI
import XCTest

Expand All @@ -30,7 +30,7 @@ class GalleryView_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
AssertSnapshot(view)
}

func test_galleryHeader_snapshot() {
Expand All @@ -43,7 +43,7 @@ class GalleryView_Tests: StreamChatTestCase {
.frame(width: defaultScreenSize.width, height: 44)

// Then
assertSnapshot(matching: header, as: .image(perceptualPrecision: snapshotPrecision))
AssertSnapshot(header)
}

func test_gridView_snapshotLoading() {
Expand All @@ -55,6 +55,6 @@ class GalleryView_Tests: StreamChatTestCase {
.applyDefaultSize()

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: snapshotPrecision))
AssertSnapshot(view)
}
}
Loading

0 comments on commit fa11832

Please sign in to comment.