Skip to content

Commit

Permalink
Re-enable snapshot tests that work for Xcode 15.4 (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-livefront authored Sep 12, 2024
1 parent e05354e commit cd4432d
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 73 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ import XCTest
class ItemListCardViewTests: AuthenticatorTestCase {
// MARK: Tests

// /// Test a snapshot of the ItemListView previews.
// func test_snapshot_ItemListCardView_previews() {
// for preview in ItemListCardView_Previews._allPreviews {
// let name = preview.displayName ?? "Unknown"
// assertSnapshots(
// of: preview.content,
// as: [
// "\(name)-portrait": .defaultPortrait,
// "\(name)-portraitDark": .defaultPortraitDark,
// "\(name)-portraitAX5": .defaultPortraitAX5,
// ]
// )
// }
// }
/// Test a snapshot of the ItemListView previews.
func test_snapshot_ItemListCardView_previews() {
for preview in ItemListCardView_Previews._allPreviews {
let name = preview.displayName ?? "Unknown"
assertSnapshots(
of: preview.content,
as: [
"\(name)-portrait": .defaultPortrait,
"\(name)-portraitDark": .defaultPortraitDark,
"\(name)-portraitAX5": .defaultPortraitAX5,
]
)
}
}

/// Test the actions are properly wired up in the ItemListCardView.
func test_snapshot_ItemListCardView_actions() throws {
Expand Down
118 changes: 59 additions & 59 deletions AuthenticatorShared/UI/Vault/ItemList/ItemList/ItemListViewTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,63 +53,63 @@ class ItemListViewTests: AuthenticatorTestCase {
}
}

// /// Test a snapshot of the ItemListView showing the download card with an empty result.
// func test_snapshot_ItemListView_card_download_empty() {
// let state = ItemListState(
// itemListCardState: .passwordManagerDownload,
// loadingState: .data([])
// )
// processor = MockProcessor(state: state)
// subject = ItemListView(
// store: Store(processor: processor),
// timeProvider: timeProvider
// )
//
// assertSnapshot(matching: NavigationView { subject }, as: .defaultPortrait)
// }
//
// /// Test a snapshot of the ItemListView showing the download card with results.
// func test_snapshot_ItemListView_card_download_with_items() {
// let state = ItemListState(
// itemListCardState: .passwordManagerDownload,
// loadingState: .data([ItemListSection.fixture()])
// )
// processor = MockProcessor(state: state)
// subject = ItemListView(
// store: Store(processor: processor),
// timeProvider: timeProvider
// )
//
// assertSnapshot(matching: NavigationView { subject }, as: .defaultPortrait)
// }
//
// /// Test a snapshot of the ItemListView showing the sync card with an empty result.
// func test_snapshot_ItemListView_card_sync_empty() {
// let state = ItemListState(
// itemListCardState: .passwordManagerSync,
// loadingState: .data([])
// )
// processor = MockProcessor(state: state)
// subject = ItemListView(
// store: Store(processor: processor),
// timeProvider: timeProvider
// )
//
// assertSnapshot(matching: NavigationView { subject }, as: .defaultPortrait)
// }
//
// /// Test a snapshot of the ItemListView showing the sync card with results.
// func test_snapshot_ItemListView_card_sync_with_items() {
// let state = ItemListState(
// itemListCardState: .passwordManagerSync,
// loadingState: .data([ItemListSection.fixture()])
// )
// processor = MockProcessor(state: state)
// subject = ItemListView(
// store: Store(processor: processor),
// timeProvider: timeProvider
// )
//
// assertSnapshot(matching: NavigationView { subject }, as: .defaultPortrait)
// }
/// Test a snapshot of the ItemListView showing the download card with an empty result.
func test_snapshot_ItemListView_card_download_empty() {
let state = ItemListState(
itemListCardState: .passwordManagerDownload,
loadingState: .data([])
)
processor = MockProcessor(state: state)
subject = ItemListView(
store: Store(processor: processor),
timeProvider: timeProvider
)

assertSnapshot(matching: NavigationView { subject }, as: .defaultPortrait)
}

/// Test a snapshot of the ItemListView showing the download card with results.
func test_snapshot_ItemListView_card_download_with_items() {
let state = ItemListState(
itemListCardState: .passwordManagerDownload,
loadingState: .data([ItemListSection.fixture()])
)
processor = MockProcessor(state: state)
subject = ItemListView(
store: Store(processor: processor),
timeProvider: timeProvider
)

assertSnapshot(matching: NavigationView { subject }, as: .defaultPortrait)
}

/// Test a snapshot of the ItemListView showing the sync card with an empty result.
func test_snapshot_ItemListView_card_sync_empty() {
let state = ItemListState(
itemListCardState: .passwordManagerSync,
loadingState: .data([])
)
processor = MockProcessor(state: state)
subject = ItemListView(
store: Store(processor: processor),
timeProvider: timeProvider
)

assertSnapshot(matching: NavigationView { subject }, as: .defaultPortrait)
}

/// Test a snapshot of the ItemListView showing the sync card with results.
func test_snapshot_ItemListView_card_sync_with_items() {
let state = ItemListState(
itemListCardState: .passwordManagerSync,
loadingState: .data([ItemListSection.fixture()])
)
processor = MockProcessor(state: state)
subject = ItemListView(
store: Store(processor: processor),
timeProvider: timeProvider
)

assertSnapshot(matching: NavigationView { subject }, as: .defaultPortrait)
}
}

0 comments on commit cd4432d

Please sign in to comment.