Skip to content

Commit

Permalink
fix: potentially flaky snapshot tests - WPB-16078 (#2581)
Browse files Browse the repository at this point in the history
Co-authored-by: Christoph Aldrian <[email protected]>
Co-authored-by: Christoph Aldrian <[email protected]>
  • Loading branch information
3 people authored Feb 21, 2025
1 parent 9e40f49 commit 9580a5a
Show file tree
Hide file tree
Showing 17 changed files with 37 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ struct SetBackupPasswordView: View {

@StateObject var viewModel: SetBackupPasswordViewModel

var focusPasswordFieldOnAppear = true

@Environment(\.wireAccentColor) private var wireAccentColor
@Environment(\.wireAccentColorMapping) private var wireAccentColorMapping

Expand Down Expand Up @@ -98,7 +100,7 @@ struct SetBackupPasswordView: View {
password: $viewModel.password,
placeholder: Strings.ExportBackup.SetBackupPassword.placeholder,
placeholderColor: passwordFieldPlaceholderColor,
focusOnAppear: true
focusOnAppear: focusPasswordFieldOnAppear
)
.tint(passwordFieldBorderColor)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ final class SetBackupPasswordViewSnapshotTests: XCTestCase {
setPasswordAction: { _ in }
)
viewModel.password = "invalid"
let sut = SetBackupPasswordView(viewModel: viewModel)
let sut = SetBackupPasswordView(viewModel: viewModel, focusPasswordFieldOnAppear: false)
.frame(width: screenBounds.width, height: screenBounds.height)

snapshotHelper
Expand All @@ -66,7 +66,7 @@ final class SetBackupPasswordViewSnapshotTests: XCTestCase {
setPasswordAction: { _ in }
)
viewModel.password = "G00dPassword"
let sut = SetBackupPasswordView(viewModel: viewModel)
let sut = SetBackupPasswordView(viewModel: viewModel, focusPasswordFieldOnAppear: false)
.frame(width: screenBounds.width, height: screenBounds.height)

snapshotHelper
Expand All @@ -84,7 +84,7 @@ final class SetBackupPasswordViewSnapshotTests: XCTestCase {
cancelAction: {},
setPasswordAction: { _ in }
)
let sut = SetBackupPasswordView(viewModel: viewModel)
let sut = SetBackupPasswordView(viewModel: viewModel, focusPasswordFieldOnAppear: false)
.frame(width: screenBounds.width, height: screenBounds.height)

snapshotHelper
Expand All @@ -99,7 +99,7 @@ final class SetBackupPasswordViewSnapshotTests: XCTestCase {
cancelAction: {},
setPasswordAction: { _ in }
)
let sut = SetBackupPasswordView(viewModel: viewModel)
let sut = SetBackupPasswordView(viewModel: viewModel, focusPasswordFieldOnAppear: false)
.frame(width: screenBounds.width, height: screenBounds.height)

for dynamicTypeSize in DynamicTypeSize.allCases {
Expand Down
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.
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.
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.
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.

0 comments on commit 9580a5a

Please sign in to comment.