diff --git a/BitwardenShared/UI/Auth/Landing/SelfHosted/SelfHostedView.swift b/BitwardenShared/UI/Auth/Landing/SelfHosted/SelfHostedView.swift index 81f994a9c..5adeac08a 100644 --- a/BitwardenShared/UI/Auth/Landing/SelfHosted/SelfHostedView.swift +++ b/BitwardenShared/UI/Auth/Landing/SelfHosted/SelfHostedView.swift @@ -16,7 +16,6 @@ struct SelfHostedView: View { VStack(spacing: 16) { selfHostedEnvironment customEnvironment - saveButton } .textFieldConfiguration(.url) .navigationBar(title: Localizations.settings, titleDisplayMode: .inline) @@ -25,6 +24,10 @@ struct SelfHostedView: View { cancelToolbarItem { store.send(.dismiss) } + + saveToolbarItem { + await store.perform(.saveEnvironment) + } } } @@ -77,18 +80,6 @@ struct SelfHostedView: View { .padding(.top, 8) } - /// The save button. - private var saveButton: some View { - AsyncButton { - await store.perform(.saveEnvironment) - } label: { - Text(Localizations.save) - } - .accessibilityIdentifier("SaveButton") - .buttonStyle(.primary()) - .padding(.top, 8) - } - /// The self-hosted environment section. private var selfHostedEnvironment: some View { section( diff --git a/BitwardenShared/UI/Auth/Landing/SelfHosted/SelfHostedViewTests.swift b/BitwardenShared/UI/Auth/Landing/SelfHosted/SelfHostedViewTests.swift index 70ffdcf53..84cd2e30a 100644 --- a/BitwardenShared/UI/Auth/Landing/SelfHosted/SelfHostedViewTests.swift +++ b/BitwardenShared/UI/Auth/Landing/SelfHosted/SelfHostedViewTests.swift @@ -4,10 +4,47 @@ import XCTest @testable import BitwardenShared class SelfHostedViewTests: BitwardenTestCase { - let subject = SelfHostedView(store: Store(processor: StateProcessor(state: SelfHostedState()))) + // MARK: Properties + + var processor: MockProcessor! + var subject: SelfHostedView! + + // MARK: Setup & Teardown + + override func setUp() { + super.setUp() + + processor = MockProcessor(state: SelfHostedState()) + + subject = SelfHostedView(store: Store(processor: processor)) + } + + override func tearDown() { + super.tearDown() + + subject = nil + } + + // MARK: Tests + + /// Tapping the cancel button dispatches the `.dismiss` action. + func test_cancelButton_tap() throws { + let button = try subject.inspect().find(button: Localizations.cancel) + try button.tap() + XCTAssertEqual(processor.dispatchedActions.last, .dismiss) + } + + /// Tapping the save button dispatches the `.saveEnvironment` action. + func test_saveButton_tap() async throws { + let button = try subject.inspect().find(asyncButton: Localizations.save) + try await button.tap() + XCTAssertEqual(processor.effects.last, .saveEnvironment) + } + + // MARK: Snapshots /// Tests that the view renders correctly. func test_viewRender() { - assertSnapshot(of: subject, as: .defaultPortrait) + assertSnapshot(of: subject.navStackWrapped, as: .defaultPortrait) } } diff --git a/BitwardenShared/UI/Auth/Landing/SelfHosted/__Snapshots__/SelfHostedViewTests/test_viewRender.1.png b/BitwardenShared/UI/Auth/Landing/SelfHosted/__Snapshots__/SelfHostedViewTests/test_viewRender.1.png index ed6133b97..df8fc205c 100644 Binary files a/BitwardenShared/UI/Auth/Landing/SelfHosted/__Snapshots__/SelfHostedViewTests/test_viewRender.1.png and b/BitwardenShared/UI/Auth/Landing/SelfHosted/__Snapshots__/SelfHostedViewTests/test_viewRender.1.png differ diff --git a/BitwardenShared/UI/Platform/Application/Extensions/View+Toolbar.swift b/BitwardenShared/UI/Platform/Application/Extensions/View+Toolbar.swift index 97b1a051e..9849554c7 100644 --- a/BitwardenShared/UI/Platform/Application/Extensions/View+Toolbar.swift +++ b/BitwardenShared/UI/Platform/Application/Extensions/View+Toolbar.swift @@ -48,6 +48,16 @@ extension View { .accessibilityIdentifier("EditItemButton") } + /// Returns a toolbar button configured for saving an item. + /// + /// - Parameter action: The action to perform when the save button is tapped. + /// - Returns: A `Button` configured for saving an item. + /// + func saveToolbarButton(action: @escaping () async -> Void) -> some View { + toolbarButton(Localizations.save, action: action) + .accessibilityIdentifier("SaveButton") + } + /// Returns a `Button` that displays an image for use in a toolbar. /// /// - Parameters: @@ -140,4 +150,15 @@ extension View { optionsToolbarMenu(content: content) } } + + /// A `ToolbarItem` for views with a save button. + /// + /// - Parameter action: The action to perform when the save button is tapped. + /// - Returns: A `ToolbarItem` with a save button. + /// + func saveToolbarItem(_ action: @escaping () async -> Void) -> some ToolbarContent { + ToolbarItem(placement: .topBarTrailing) { + saveToolbarButton(action: action) + } + } } diff --git a/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/AddEditFolderView.swift b/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/AddEditFolderView.swift index becd41f2e..c89c2425d 100644 --- a/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/AddEditFolderView.swift +++ b/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/AddEditFolderView.swift @@ -31,6 +31,10 @@ struct AddEditFolderView: View { cancelToolbarItem { store.send(.dismiss) } + + saveToolbarItem { + await store.perform(.saveTapped) + } } } @@ -39,15 +43,21 @@ struct AddEditFolderView: View { content .navigationBar(title: Localizations.editFolder, titleDisplayMode: .inline) .toolbar { - optionsToolbarItem { - AsyncButton(Localizations.delete, role: .destructive) { - await store.perform(.deleteTapped) - } - } - cancelToolbarItem { store.send(.dismiss) } + + ToolbarItemGroup(placement: .topBarTrailing) { + saveToolbarButton { + await store.perform(.saveTapped) + } + + optionsToolbarMenu { + AsyncButton(Localizations.delete, role: .destructive) { + await store.perform(.deleteTapped) + } + } + } } } @@ -55,8 +65,6 @@ struct AddEditFolderView: View { private var content: some View { VStack(alignment: .leading, spacing: 20) { nameEntryTextField - - saveButton } .scrollView() } @@ -71,13 +79,4 @@ struct AddEditFolderView: View { ) ) } - - /// The save button. - private var saveButton: some View { - AsyncButton(Localizations.save) { - await store.perform(.saveTapped) - } - .accessibilityIdentifier("SaveButton") - .buttonStyle(.primary()) - } } diff --git a/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/AddEditFolderViewTests.swift b/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/AddEditFolderViewTests.swift index 5ef5650f7..0894a23ac 100644 --- a/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/AddEditFolderViewTests.swift +++ b/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/AddEditFolderViewTests.swift @@ -61,31 +61,48 @@ class AddEditFolderViewTests: BitwardenTestCase { XCTAssertEqual(processor.dispatchedActions.last, .folderNameTextChanged("text")) } - /// Tapping the save button performs the `.saveTapped` effect. - func test_saveButton_tap() async throws { + /// Tapping the save button in add mode performs the `.saveTapped` effect. + func test_saveButton_tapAdd() async throws { let button = try subject.inspect().find(asyncButton: Localizations.save) try await button.tap() XCTAssertEqual(processor.effects.last, .saveTapped) } + /// Tapping the save button in edit mode performs the `.saveTapped` effect. + func test_saveButton_tapEdit() async throws { + processor.state.mode = .edit(.fixture()) + let button = try subject.inspect().find(asyncButton: Localizations.save) + try await button.tap() + XCTAssertEqual(processor.effects.last, .saveTapped) + } + // MARK: Snapshots /// Tests the view renders correctly when the text field is empty. func test_snapshot_add_empty() { - assertSnapshots(matching: subject, as: [.defaultPortrait, .defaultPortraitDark, .defaultPortraitAX5]) + assertSnapshots( + matching: subject.navStackWrapped, + as: [.defaultPortrait, .defaultPortraitDark, .defaultPortraitAX5] + ) } /// Tests the view renders correctly when the text field is populated. func test_snapshot_add_populated() { processor.state.folderName = "Super cool folder name" - assertSnapshots(matching: subject, as: [.defaultPortrait, .defaultPortraitDark, .defaultPortraitAX5]) + assertSnapshots( + matching: subject.navStackWrapped, + as: [.defaultPortrait, .defaultPortraitDark, .defaultPortraitAX5] + ) } /// Tests the view renders correctly when the text field is populated. func test_snapshot_edit_populated() { processor.state.mode = .edit(.fixture()) processor.state.folderName = "Super cool folder name" - assertSnapshots(matching: subject, as: [.defaultPortrait, .defaultPortraitDark, .defaultPortraitAX5]) + assertSnapshots( + matching: subject.navStackWrapped, + as: [.defaultPortrait, .defaultPortraitDark, .defaultPortraitAX5] + ) } } diff --git a/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_add_empty.1.png b/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_add_empty.1.png index a2add31e1..9c484dee2 100644 Binary files a/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_add_empty.1.png and b/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_add_empty.1.png differ diff --git a/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_add_empty.2.png b/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_add_empty.2.png index fec48ef8a..54331f41e 100644 Binary files a/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_add_empty.2.png and b/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_add_empty.2.png differ diff --git a/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_add_empty.3.png b/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_add_empty.3.png index 4d0161730..3c3506031 100644 Binary files a/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_add_empty.3.png and b/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_add_empty.3.png differ diff --git a/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_add_populated.1.png b/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_add_populated.1.png index 21b64ae3d..389a83a6e 100644 Binary files a/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_add_populated.1.png and b/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_add_populated.1.png differ diff --git a/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_add_populated.2.png b/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_add_populated.2.png index 02f8e2ed3..781b3bac6 100644 Binary files a/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_add_populated.2.png and b/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_add_populated.2.png differ diff --git a/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_add_populated.3.png b/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_add_populated.3.png index 73d1c5372..6c0a072d5 100644 Binary files a/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_add_populated.3.png and b/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_add_populated.3.png differ diff --git a/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_edit_populated.1.png b/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_edit_populated.1.png index 21b64ae3d..1c3ff668e 100644 Binary files a/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_edit_populated.1.png and b/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_edit_populated.1.png differ diff --git a/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_edit_populated.2.png b/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_edit_populated.2.png index 02f8e2ed3..3bfd07b90 100644 Binary files a/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_edit_populated.2.png and b/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_edit_populated.2.png differ diff --git a/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_edit_populated.3.png b/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_edit_populated.3.png index 73d1c5372..d7bd10a09 100644 Binary files a/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_edit_populated.3.png and b/BitwardenShared/UI/Platform/Settings/Settings/Vault/Folders/AddEditFolder/__Snapshots__/AddEditFolderViewTests/test_snapshot_edit_populated.3.png differ diff --git a/BitwardenShared/UI/Tools/Generator/Generator/GeneratorState.swift b/BitwardenShared/UI/Tools/Generator/Generator/GeneratorState.swift index 4981c89fa..5e95adc71 100644 --- a/BitwardenShared/UI/Tools/Generator/Generator/GeneratorState.swift +++ b/BitwardenShared/UI/Tools/Generator/Generator/GeneratorState.swift @@ -47,6 +47,14 @@ struct GeneratorState: Equatable { } } + /// A flag indicating if the options toolbar button is visible. + var isOptionsButtonVisible: Bool { + switch self { + case .tab: true + case .inPlace: false + } + } + /// A flag indicating if the select button is visible. var isSelectButtonVisible: Bool { switch self { diff --git a/BitwardenShared/UI/Tools/Generator/Generator/GeneratorView.swift b/BitwardenShared/UI/Tools/Generator/Generator/GeneratorView.swift index 32d121e27..27badf248 100644 --- a/BitwardenShared/UI/Tools/Generator/Generator/GeneratorView.swift +++ b/BitwardenShared/UI/Tools/Generator/Generator/GeneratorView.swift @@ -25,19 +25,11 @@ struct GeneratorView: View { ForEach(store.state.formSections) { section in sectionView(section) } - - if store.state.presentationMode.isSelectButtonVisible { - Button(Localizations.select) { - store.send(.selectButtonPressed) - } - .buttonStyle(.primary()) - .accessibilityIdentifier("SelectButton") - } } .padding(16) } .background(Asset.Colors.backgroundSecondary.swiftUIColor) - .navigationBarTitleDisplayMode(.large) + .navigationBarTitleDisplayMode(store.state.presentationMode == .inPlace ? .inline : .large) .navigationTitle(Localizations.generator) .task { await store.perform(.appeared) } .onChange(of: focusedFieldKeyPath) { newValue in @@ -56,10 +48,19 @@ struct GeneratorView: View { } } - ToolbarItem(placement: .topBarTrailing) { - optionsToolbarMenu { - Button(Localizations.passwordHistory) { - store.send(.showPasswordHistory) + ToolbarItemGroup(placement: .topBarTrailing) { + if store.state.presentationMode.isSelectButtonVisible { + toolbarButton(Localizations.select) { + store.send(.selectButtonPressed) + } + .accessibilityIdentifier("SelectButton") + } + + if store.state.presentationMode.isOptionsButtonVisible { + optionsToolbarMenu { + Button(Localizations.passwordHistory) { + store.send(.showPasswordHistory) + } } } } diff --git a/BitwardenShared/UI/Tools/Generator/Generator/GeneratorViewTests.swift b/BitwardenShared/UI/Tools/Generator/Generator/GeneratorViewTests.swift index 5161638f0..f73efbfcb 100644 --- a/BitwardenShared/UI/Tools/Generator/Generator/GeneratorViewTests.swift +++ b/BitwardenShared/UI/Tools/Generator/Generator/GeneratorViewTests.swift @@ -96,10 +96,10 @@ class GeneratorViewTests: BitwardenTestCase { } /// Tapping the select button dispatches the `.selectButtonPressed` action. - func test_selectButton_tap() throws { + func test_selectButton_tap() async throws { processor.state.presentationMode = .inPlace - let button = try subject.inspect().find(button: Localizations.select) - try button.tap() + let button = try subject.inspect().find(asyncButton: Localizations.select) + try await button.tap() XCTAssertEqual(processor.dispatchedActions.last, .selectButtonPressed) } @@ -180,7 +180,7 @@ class GeneratorViewTests: BitwardenTestCase { processor.state.generatedValue = "pa11w0rd" processor.state.showCopiedValueToast() assertSnapshot( - matching: subject, + matching: subject.navStackWrapped, as: .defaultPortrait ) } @@ -189,7 +189,7 @@ class GeneratorViewTests: BitwardenTestCase { func test_snapshot_generatorViewPassphrase() { processor.state.passwordState.passwordGeneratorType = .passphrase assertSnapshot( - matching: subject, + matching: subject.navStackWrapped, as: .defaultPortrait ) } @@ -198,7 +198,7 @@ class GeneratorViewTests: BitwardenTestCase { func test_snapshot_generatorViewPassword() { processor.state.passwordState.passwordGeneratorType = .password assertSnapshot( - matching: subject, + matching: subject.navStackWrapped, as: .defaultPortrait ) } @@ -207,14 +207,14 @@ class GeneratorViewTests: BitwardenTestCase { func test_snapshot_generatorViewPassword_inPlace() { processor.state.passwordState.passwordGeneratorType = .password processor.state.presentationMode = .inPlace - assertSnapshot(of: subject, as: .tallPortrait) + assertSnapshot(of: subject.navStackWrapped, as: .tallPortrait) } /// Test a snapshot of the password generation view with a policy in effect. func test_snapshot_generatorViewPassword_policyInEffect() { processor.state.isPolicyInEffect = true assertSnapshot( - matching: subject, + matching: subject.navStackWrapped, as: .defaultPortrait ) } @@ -224,7 +224,7 @@ class GeneratorViewTests: BitwardenTestCase { processor.state.generatorType = .username processor.state.usernameState.usernameGeneratorType = .catchAllEmail assertSnapshot( - matching: subject, + matching: subject.navStackWrapped, as: .defaultPortrait ) } @@ -234,7 +234,7 @@ class GeneratorViewTests: BitwardenTestCase { processor.state.generatorType = .username processor.state.usernameState.usernameGeneratorType = .forwardedEmail assertSnapshot( - matching: subject, + matching: subject.navStackWrapped, as: .defaultPortrait ) } @@ -244,7 +244,7 @@ class GeneratorViewTests: BitwardenTestCase { processor.state.generatorType = .username processor.state.usernameState.usernameGeneratorType = .plusAddressedEmail assertSnapshot( - matching: subject, + matching: subject.navStackWrapped, as: .defaultPortrait ) } @@ -254,7 +254,7 @@ class GeneratorViewTests: BitwardenTestCase { processor.state.generatorType = .username processor.state.usernameState.usernameGeneratorType = .plusAddressedEmail processor.state.presentationMode = .inPlace - assertSnapshot(matching: subject, as: .defaultPortrait) + assertSnapshot(matching: subject.navStackWrapped, as: .defaultPortrait) } /// Test a snapshot of the random word username generation view. @@ -262,7 +262,7 @@ class GeneratorViewTests: BitwardenTestCase { processor.state.generatorType = .username processor.state.usernameState.usernameGeneratorType = .randomWord assertSnapshot( - matching: subject, + matching: subject.navStackWrapped, as: .defaultPortrait ) } diff --git a/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewPassphrase.1.png b/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewPassphrase.1.png index 18f5ed5ab..da6a8c84b 100644 Binary files a/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewPassphrase.1.png and b/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewPassphrase.1.png differ diff --git a/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewPassword.1.png b/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewPassword.1.png index daf66ae5b..e5e0fab65 100644 Binary files a/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewPassword.1.png and b/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewPassword.1.png differ diff --git a/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewPassword_inPlace.1.png b/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewPassword_inPlace.1.png index 453d7c975..f24d394f8 100644 Binary files a/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewPassword_inPlace.1.png and b/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewPassword_inPlace.1.png differ diff --git a/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewPassword_policyInEffect.1.png b/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewPassword_policyInEffect.1.png index 2002ed11a..014e1e6ae 100644 Binary files a/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewPassword_policyInEffect.1.png and b/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewPassword_policyInEffect.1.png differ diff --git a/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewToast.1.png b/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewToast.1.png index d7d6508fd..2c805a9f0 100644 Binary files a/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewToast.1.png and b/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewToast.1.png differ diff --git a/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewUsernameCatchAll.1.png b/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewUsernameCatchAll.1.png index 4d15692fa..4fb23aac3 100644 Binary files a/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewUsernameCatchAll.1.png and b/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewUsernameCatchAll.1.png differ diff --git a/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewUsernameForwarded.1.png b/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewUsernameForwarded.1.png index 371105883..58415f7fe 100644 Binary files a/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewUsernameForwarded.1.png and b/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewUsernameForwarded.1.png differ diff --git a/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewUsernamePlusAddressed.1.png b/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewUsernamePlusAddressed.1.png index 49202b7d2..cfdfc312c 100644 Binary files a/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewUsernamePlusAddressed.1.png and b/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewUsernamePlusAddressed.1.png differ diff --git a/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewUsernamePlusAddressed_inPlace.1.png b/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewUsernamePlusAddressed_inPlace.1.png index 3a8577c2c..334f992f5 100644 Binary files a/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewUsernamePlusAddressed_inPlace.1.png and b/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewUsernamePlusAddressed_inPlace.1.png differ diff --git a/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewUsernameRandomWord.1.png b/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewUsernameRandomWord.1.png index 97629059e..0ac11c1f8 100644 Binary files a/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewUsernameRandomWord.1.png and b/BitwardenShared/UI/Tools/Generator/Generator/__Snapshots__/GeneratorViewTests/test_snapshot_generatorViewUsernameRandomWord.1.png differ diff --git a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/AddEditSendItemView.swift b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/AddEditSendItemView.swift index bedffb4c3..991ade439 100644 --- a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/AddEditSendItemView.swift +++ b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/AddEditSendItemView.swift @@ -42,8 +42,6 @@ struct AddEditSendItemView: View { // swiftlint:disable:this type_body_length if store.state.isOptionsExpanded { options } - - saveButton } .padding(16) .disabled(store.state.isSendDisabled) @@ -84,8 +82,12 @@ struct AddEditSendItemView: View { // swiftlint:disable:this type_body_length } ToolbarItemGroup(placement: .navigationBarTrailing) { - switch store.state.mode { - case .edit: + saveToolbarButton { + await store.perform(.savePressed) + } + .disabled(store.state.isSendDisabled) + + if store.state.mode == .edit { optionsToolbarMenu { if !store.state.isSendDisabled { AsyncButton(Localizations.shareLink) { @@ -105,9 +107,6 @@ struct AddEditSendItemView: View { // swiftlint:disable:this type_body_length await store.perform(.deletePressed) } } - case .add, - .shareExtension: - EmptyView() } } } @@ -458,15 +457,6 @@ struct AddEditSendItemView: View { // swiftlint:disable:this type_body_length } } - /// The save button. - @ViewBuilder private var saveButton: some View { - AsyncButton(Localizations.save) { - await store.perform(.savePressed) - } - .accessibilityIdentifier("SaveButton") - .buttonStyle(.primary()) - } - /// The attributes for a text type send. @ViewBuilder private var textSendAttributes: some View { BitwardenMultilineTextField( diff --git a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/AddEditSendItemViewTests.swift b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/AddEditSendItemViewTests.swift index 65a4073f7..5c2d742d4 100644 --- a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/AddEditSendItemViewTests.swift +++ b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/AddEditSendItemViewTests.swift @@ -164,7 +164,7 @@ class AddEditSendItemViewTests: BitwardenTestCase { func test_snapshot_file_empty() { processor.state.type = .file - assertSnapshot(of: subject, as: .defaultPortrait) + assertSnapshot(of: subject.navStackWrapped, as: .defaultPortrait) } func test_snapshot_file_withValues() { @@ -172,7 +172,7 @@ class AddEditSendItemViewTests: BitwardenTestCase { processor.state.name = "Name" processor.state.fileName = "example_file.txt" processor.state.fileData = Data("example".utf8) - assertSnapshot(of: subject, as: .defaultPortrait) + assertSnapshot(of: subject.navStackWrapped, as: .defaultPortrait) } func test_snapshot_file_withValues_prefilled() { @@ -181,13 +181,13 @@ class AddEditSendItemViewTests: BitwardenTestCase { processor.state.fileName = "example_file.txt" processor.state.fileData = Data("example".utf8) processor.state.mode = .shareExtension(.empty()) - assertSnapshot(of: subject, as: .defaultPortrait) + assertSnapshot(of: subject.navStackWrapped, as: .defaultPortrait) } func test_snapshot_file_withOptions_empty() { processor.state.type = .file processor.state.isOptionsExpanded = true - assertSnapshot(of: subject, as: .tallPortrait) + assertSnapshot(of: subject.navStackWrapped, as: .tallPortrait) } func test_snapshot_file_withOptions_withValues() { @@ -207,7 +207,7 @@ class AddEditSendItemViewTests: BitwardenTestCase { processor.state.notes = "Notes" processor.state.isHideMyEmailOn = true processor.state.isDeactivateThisSendOn = true - assertSnapshot(of: subject, as: .tallPortrait) + assertSnapshot(of: subject.navStackWrapped, as: .tallPortrait) } func test_snapshot_file_edit_withOptions_withValues() { @@ -228,33 +228,33 @@ class AddEditSendItemViewTests: BitwardenTestCase { processor.state.notes = "Notes" processor.state.isHideMyEmailOn = true processor.state.isDeactivateThisSendOn = true - assertSnapshot(of: subject, as: .tallPortrait) + assertSnapshot(of: subject.navStackWrapped, as: .tallPortrait) } func test_snapshot_sendDisabled() { processor.state.isSendDisabled = true - assertSnapshot(of: subject, as: .defaultPortrait) + assertSnapshot(of: subject.navStackWrapped, as: .defaultPortrait) } func test_snapshot_sendHideEmailDisabled() { processor.state.isSendHideEmailDisabled = true - assertSnapshot(of: subject, as: .defaultPortrait) + assertSnapshot(of: subject.navStackWrapped, as: .defaultPortrait) } func test_snapshot_text_empty() { - assertSnapshot(of: subject, as: .defaultPortrait) + assertSnapshot(of: subject.navStackWrapped, as: .defaultPortrait) } func test_snapshot_text_withValues() { processor.state.name = "Name" processor.state.text = "Text" processor.state.isHideTextByDefaultOn = true - assertSnapshot(of: subject, as: .defaultPortrait) + assertSnapshot(of: subject.navStackWrapped, as: .defaultPortrait) } func test_snapshot_text_withOptions_empty() { processor.state.isOptionsExpanded = true - assertSnapshot(of: subject, as: .tallPortrait) + assertSnapshot(of: subject.navStackWrapped, as: .tallPortrait) } func test_snapshot_text_withOptions_withValues() { @@ -272,7 +272,7 @@ class AddEditSendItemViewTests: BitwardenTestCase { processor.state.notes = "Notes with lots of text that wraps to new lines when displayed." processor.state.isHideMyEmailOn = true processor.state.isDeactivateThisSendOn = true - assertSnapshot(of: subject, as: .tallPortrait) + assertSnapshot(of: subject.navStackWrapped, as: .tallPortrait) } func test_snapshot_text_edit_withOptions_withValues() { @@ -292,7 +292,7 @@ class AddEditSendItemViewTests: BitwardenTestCase { processor.state.notes = "Notes" processor.state.isHideMyEmailOn = true processor.state.isDeactivateThisSendOn = true - assertSnapshot(of: subject, as: .tallPortrait) + assertSnapshot(of: subject.navStackWrapped, as: .tallPortrait) } func test_snapshot_text_extension_withValues() { diff --git a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_file_edit_withOptions_withValues.1.png b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_file_edit_withOptions_withValues.1.png index da10d2a9a..db24fe533 100644 Binary files a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_file_edit_withOptions_withValues.1.png and b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_file_edit_withOptions_withValues.1.png differ diff --git a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_file_empty.1.png b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_file_empty.1.png index decaad2d6..8a5bead36 100644 Binary files a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_file_empty.1.png and b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_file_empty.1.png differ diff --git a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_file_withOptions_empty.1.png b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_file_withOptions_empty.1.png index b6ee60381..3c5b73fcc 100644 Binary files a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_file_withOptions_empty.1.png and b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_file_withOptions_empty.1.png differ diff --git a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_file_withOptions_withValues.1.png b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_file_withOptions_withValues.1.png index 862d0d247..5b606f07b 100644 Binary files a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_file_withOptions_withValues.1.png and b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_file_withOptions_withValues.1.png differ diff --git a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_file_withValues.1.png b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_file_withValues.1.png index 78f6fa79a..9f0a0ddbf 100644 Binary files a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_file_withValues.1.png and b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_file_withValues.1.png differ diff --git a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_file_withValues_prefilled.1.png b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_file_withValues_prefilled.1.png index 51ebc5882..c243804e9 100644 Binary files a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_file_withValues_prefilled.1.png and b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_file_withValues_prefilled.1.png differ diff --git a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_sendDisabled.1.png b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_sendDisabled.1.png index 889969225..e15a722d9 100644 Binary files a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_sendDisabled.1.png and b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_sendDisabled.1.png differ diff --git a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_sendHideEmailDisabled.1.png b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_sendHideEmailDisabled.1.png index 3d7b01279..0071116eb 100644 Binary files a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_sendHideEmailDisabled.1.png and b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_sendHideEmailDisabled.1.png differ diff --git a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_text_edit_withOptions_withValues.1.png b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_text_edit_withOptions_withValues.1.png index 580bd6e87..d65f9deff 100644 Binary files a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_text_edit_withOptions_withValues.1.png and b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_text_edit_withOptions_withValues.1.png differ diff --git a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_text_empty.1.png b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_text_empty.1.png index 0eb01cc79..53abbf124 100644 Binary files a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_text_empty.1.png and b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_text_empty.1.png differ diff --git a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_text_extension_withValues.1.png b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_text_extension_withValues.1.png index 19468db4f..3abdf8924 100644 Binary files a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_text_extension_withValues.1.png and b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_text_extension_withValues.1.png differ diff --git a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_text_withOptions_empty.1.png b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_text_withOptions_empty.1.png index 4cc9e2129..a2f849a08 100644 Binary files a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_text_withOptions_empty.1.png and b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_text_withOptions_empty.1.png differ diff --git a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_text_withOptions_withValues.1.png b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_text_withOptions_withValues.1.png index 38a75dfb1..a534f01a0 100644 Binary files a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_text_withOptions_withValues.1.png and b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_text_withOptions_withValues.1.png differ diff --git a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_text_withValues.1.png b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_text_withValues.1.png index 8e06fb76d..67e787427 100644 Binary files a/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_text_withValues.1.png and b/BitwardenShared/UI/Tools/Send/SendItem/AddEditSendItem/__Snapshots__/AddEditSendItemViewTests/test_snapshot_text_withValues.1.png differ diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditItemView.swift b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditItemView.swift index a8ba49806..be39bbd53 100644 --- a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditItemView.swift +++ b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditItemView.swift @@ -47,6 +47,10 @@ struct AddEditItemView: View { cancelToolbarItem { store.send(.dismissPressed) } + + saveToolbarItem { + await store.perform(.savePressed) + } } } @@ -63,7 +67,6 @@ struct AddEditItemView: View { notesSection customSection ownershipSection - saveButton } .padding(16) } @@ -105,13 +108,15 @@ struct AddEditItemView: View { content .navigationTitle(Localizations.editItem) .toolbar { - ToolbarItem(placement: .navigationBarLeading) { - cancelToolbarButton { - store.send(.dismissPressed) - } + cancelToolbarItem { + store.send(.dismissPressed) } - ToolbarItem(placement: .navigationBarTrailing) { + ToolbarItemGroup(placement: .navigationBarTrailing) { + saveToolbarButton { + await store.perform(.savePressed) + } + VaultItemManagementMenuView( isCloneEnabled: false, isCollectionsEnabled: store.state.cipher.organizationId != nil, @@ -281,14 +286,6 @@ private extension AddEditItemView { } } } - - var saveButton: some View { - AsyncButton(Localizations.save) { - await store.perform(.savePressed) - } - .accessibilityIdentifier("SaveButton") - .buttonStyle(.primary()) - } } #if DEBUG diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditItemViewTests.swift b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditItemViewTests.swift index 565f8359c..59ce6e4a7 100644 --- a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditItemViewTests.swift +++ b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditItemViewTests.swift @@ -186,8 +186,17 @@ class AddEditItemViewTests: BitwardenTestCase { // swiftlint:disable:this type_b XCTAssertEqual(processor.dispatchedActions.last, .togglePasswordVisibilityChanged(false)) } - /// Tapping the save button performs the `.savePressed` effect. - func test_saveButton_tap() async throws { + /// Tapping the save button performs the `.savePressed` effect when adding a new cipher. + func test_saveButton_tapAdd() async throws { + let button = try subject.inspect().find(asyncButton: Localizations.save) + try await button.tap() + + XCTAssertEqual(processor.effects.last, .savePressed) + } + + /// Tapping the save button performs the `.savePressed` effect when editing an existing cipher. + func test_saveButton_tapEdit() async throws { + processor.state = CipherItemState(existing: .fixture(), hasPremium: false)! let button = try subject.inspect().find(asyncButton: Localizations.save) try await button.tap() @@ -418,7 +427,7 @@ class AddEditItemViewTests: BitwardenTestCase { // swiftlint:disable:this type_b // MARK: Snapshots func test_snapshot_add_empty() { - assertSnapshot(of: subject, as: .tallPortrait) + assertSnapshot(of: subject.navStackWrapped, as: .tallPortrait) } /// Tests the add state with identity item empty. @@ -431,7 +440,7 @@ class AddEditItemViewTests: BitwardenTestCase { // swiftlint:disable:this type_b processor.state.notes = "" processor.state.folderId = nil - assertSnapshot(of: subject, as: .tallPortrait2) + assertSnapshot(of: subject.navStackWrapped, as: .tallPortrait2) } /// Tests the add state with identity item filled. @@ -464,7 +473,7 @@ class AddEditItemViewTests: BitwardenTestCase { // swiftlint:disable:this type_b processor.state.folderId = "1" processor.state.folders = [.custom(.fixture(id: "1", name: "Folder"))] - assertSnapshot(of: subject, as: .tallPortrait2) + assertSnapshot(of: subject.navStackWrapped, as: .tallPortrait2) } /// Tests the add state with identity item filled with large text. @@ -497,7 +506,7 @@ class AddEditItemViewTests: BitwardenTestCase { // swiftlint:disable:this type_b processor.state.folderId = "1" processor.state.folders = [.custom(.fixture(id: "1", name: "Folder"))] - assertSnapshot(of: subject, as: .tallPortraitAX5(heightMultiple: 7)) + assertSnapshot(of: subject.navStackWrapped, as: .tallPortraitAX5(heightMultiple: 7)) } /// Tests the add state with the password field not visible. @@ -520,7 +529,7 @@ class AddEditItemViewTests: BitwardenTestCase { // swiftlint:disable:this type_b processor.state.folderId = "1" processor.state.folders = [.custom(.fixture(id: "1", name: "Folder"))] - assertSnapshot(of: subject, as: .tallPortrait) + assertSnapshot(of: subject.navStackWrapped, as: .tallPortrait) } /// Tests the add state with all fields. @@ -540,7 +549,7 @@ class AddEditItemViewTests: BitwardenTestCase { // swiftlint:disable:this type_b processor.state.loginState.isPasswordVisible = true - assertSnapshot(of: subject, as: .tallPortrait) + assertSnapshot(of: subject.navStackWrapped, as: .tallPortrait) } func test_snapshot_add_login_collections() { @@ -552,14 +561,14 @@ class AddEditItemViewTests: BitwardenTestCase { // swiftlint:disable:this type_b processor.state.owner = .organization(id: "1", name: "Organization") processor.state.collectionIds = ["2"] - assertSnapshot(of: subject, as: .tallPortrait) + assertSnapshot(of: subject.navStackWrapped, as: .tallPortrait) } func test_snapshot_add_login_collectionsNone() { processor.state.ownershipOptions.append(.organization(id: "1", name: "Organization")) processor.state.owner = .organization(id: "1", name: "Organization") - assertSnapshot(of: subject, as: .tallPortrait) + assertSnapshot(of: subject.navStackWrapped, as: .tallPortrait) } func test_snapshot_edit_full_fieldsNotVisible() { @@ -585,12 +594,12 @@ class AddEditItemViewTests: BitwardenTestCase { // swiftlint:disable:this type_b processor.state.folders = [.custom(.fixture(id: "1", name: "Folder"))] processor.state.ownershipOptions = [.personal(email: "user@bitwarden.com")] - assertSnapshot(of: subject, as: .tallPortrait) + assertSnapshot(of: subject.navStackWrapped, as: .tallPortrait) } func test_snapshot_add_personalOwnershipPolicy() { processor.state.isPersonalOwnershipDisabled = true - assertSnapshot(of: subject, as: .defaultPortrait) + assertSnapshot(of: subject.navStackWrapped, as: .defaultPortrait) } func test_snapshot_add_secureNote_full_fieldsVisible() { @@ -602,7 +611,7 @@ class AddEditItemViewTests: BitwardenTestCase { // swiftlint:disable:this type_b processor.state.folderId = "1" processor.state.folders = [.custom(.fixture(id: "1", name: "Folder"))] - assertSnapshot(of: subject, as: .tallPortrait) + assertSnapshot(of: subject.navStackWrapped, as: .tallPortrait) } func test_snapshot_edit_full_disabledViewPassword() { @@ -629,7 +638,7 @@ class AddEditItemViewTests: BitwardenTestCase { // swiftlint:disable:this type_b processor.state.folders = [.custom(.fixture(id: "1", name: "Folder"))] processor.state.ownershipOptions = [.personal(email: "user@bitwarden.com")] - assertSnapshot(of: subject, as: .tallPortrait) + assertSnapshot(of: subject.navStackWrapped, as: .tallPortrait) } func test_snapshot_edit_full_fieldsNotVisible_largeText() { @@ -655,7 +664,7 @@ class AddEditItemViewTests: BitwardenTestCase { // swiftlint:disable:this type_b processor.state.folders = [.custom(.fixture(id: "1", name: "Folder"))] processor.state.ownershipOptions = [.personal(email: "user@bitwarden.com")] - assertSnapshot(of: subject, as: .tallPortraitAX5()) + assertSnapshot(of: subject.navStackWrapped, as: .tallPortraitAX5()) } func test_snapshot_edit_full_fieldsVisible() { @@ -681,7 +690,7 @@ class AddEditItemViewTests: BitwardenTestCase { // swiftlint:disable:this type_b processor.state.folders = [.custom(.fixture(id: "1", name: "Folder"))] processor.state.ownershipOptions = [.personal(email: "user@bitwarden.com")] - assertSnapshot(of: subject, as: .tallPortrait) + assertSnapshot(of: subject.navStackWrapped, as: .tallPortrait) } func test_snapshot_edit_full_fieldsVisible_largeText() { @@ -707,7 +716,7 @@ class AddEditItemViewTests: BitwardenTestCase { // swiftlint:disable:this type_b processor.state.folders = [.custom(.fixture(id: "1", name: "Folder"))] processor.state.ownershipOptions = [.personal(email: "user@bitwarden.com")] - assertSnapshot(of: subject, as: .tallPortraitAX5()) + assertSnapshot(of: subject.navStackWrapped, as: .tallPortraitAX5()) } /// Test a snapshot of the AddEditView previews. diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_empty.1.png b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_empty.1.png index ea7407c76..5278bb1bd 100644 Binary files a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_empty.1.png and b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_empty.1.png differ diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_identity_full_fieldsEmpty.1.png b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_identity_full_fieldsEmpty.1.png index 647baf6ca..f2fab691b 100644 Binary files a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_identity_full_fieldsEmpty.1.png and b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_identity_full_fieldsEmpty.1.png differ diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_identity_full_fieldsFilled.1.png b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_identity_full_fieldsFilled.1.png index cc8ccf00f..bae5cfa5a 100644 Binary files a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_identity_full_fieldsFilled.1.png and b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_identity_full_fieldsFilled.1.png differ diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_identity_full_fieldsFilled_largeText.1.png b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_identity_full_fieldsFilled_largeText.1.png index 7b3be7ff9..eb9a7f03f 100644 Binary files a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_identity_full_fieldsFilled_largeText.1.png and b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_identity_full_fieldsFilled_largeText.1.png differ diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_login_collections.1.png b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_login_collections.1.png index a66430085..a110e1ed0 100644 Binary files a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_login_collections.1.png and b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_login_collections.1.png differ diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_login_collectionsNone.1.png b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_login_collectionsNone.1.png index 6da70ae0a..aa849475b 100644 Binary files a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_login_collectionsNone.1.png and b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_login_collectionsNone.1.png differ diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_login_full_fieldsNotVisible.1.png b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_login_full_fieldsNotVisible.1.png index acdcbcb67..ce515945c 100644 Binary files a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_login_full_fieldsNotVisible.1.png and b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_login_full_fieldsNotVisible.1.png differ diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_login_full_fieldsVisible.1.png b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_login_full_fieldsVisible.1.png index 953c354dc..cff9fae08 100644 Binary files a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_login_full_fieldsVisible.1.png and b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_login_full_fieldsVisible.1.png differ diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_personalOwnershipPolicy.1.png b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_personalOwnershipPolicy.1.png index e881c2720..bace265e2 100644 Binary files a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_personalOwnershipPolicy.1.png and b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_personalOwnershipPolicy.1.png differ diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_secureNote_full_fieldsVisible.1.png b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_secureNote_full_fieldsVisible.1.png index 5b76a8369..6e53a4460 100644 Binary files a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_secureNote_full_fieldsVisible.1.png and b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_secureNote_full_fieldsVisible.1.png differ diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_edit_full_disabledViewPassword.1.png b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_edit_full_disabledViewPassword.1.png index 4d35e2190..207dc8172 100644 Binary files a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_edit_full_disabledViewPassword.1.png and b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_edit_full_disabledViewPassword.1.png differ diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_edit_full_fieldsNotVisible.1.png b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_edit_full_fieldsNotVisible.1.png index e9f70dac8..48139c19f 100644 Binary files a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_edit_full_fieldsNotVisible.1.png and b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_edit_full_fieldsNotVisible.1.png differ diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_edit_full_fieldsNotVisible_largeText.1.png b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_edit_full_fieldsNotVisible_largeText.1.png index ee0b96160..d2614d844 100644 Binary files a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_edit_full_fieldsNotVisible_largeText.1.png and b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_edit_full_fieldsNotVisible_largeText.1.png differ diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_edit_full_fieldsVisible.1.png b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_edit_full_fieldsVisible.1.png index 9566b4332..a921c94f4 100644 Binary files a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_edit_full_fieldsVisible.1.png and b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_edit_full_fieldsVisible.1.png differ diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_edit_full_fieldsVisible_largeText.1.png b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_edit_full_fieldsVisible_largeText.1.png index f8d10efa7..f646d3c95 100644 Binary files a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_edit_full_fieldsVisible_largeText.1.png and b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_edit_full_fieldsVisible_largeText.1.png differ diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.1.png b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.1.png index b1f1bbadb..34c4571df 100644 Binary files a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.1.png and b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.1.png differ diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.10.png b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.10.png index 2403fa25d..e8af6302e 100644 Binary files a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.10.png and b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.10.png differ diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.11.png b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.11.png index 00ac30f10..421bc26b5 100644 Binary files a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.11.png and b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.11.png differ diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.12.png b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.12.png index 6c2848695..1acbfa6ac 100644 Binary files a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.12.png and b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.12.png differ diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.13.png b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.13.png index 32b885918..744fc9b66 100644 Binary files a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.13.png and b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.13.png differ diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.14.png b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.14.png index 77b286f2d..2fdb77032 100644 Binary files a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.14.png and b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.14.png differ diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.15.png b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.15.png index 99b78ca59..9e76a187e 100644 Binary files a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.15.png and b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.15.png differ diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.2.png b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.2.png index 5f5d7ac6a..4dd8663e9 100644 Binary files a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.2.png and b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.2.png differ diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.3.png b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.3.png index b7b7f3fa2..056bd8b8e 100644 Binary files a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.3.png and b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.3.png differ diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.4.png b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.4.png index e20bd285f..1ff79bb33 100644 Binary files a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.4.png and b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.4.png differ diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.5.png b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.5.png index c590d7732..28a29e836 100644 Binary files a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.5.png and b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.5.png differ diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.6.png b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.6.png index 604fd01c6..aea16f5c9 100644 Binary files a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.6.png and b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.6.png differ diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.7.png b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.7.png index d8130e2bb..afb8166e6 100644 Binary files a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.7.png and b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.7.png differ diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.8.png b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.8.png index 392ed3fc5..7942b7e7a 100644 Binary files a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.8.png and b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.8.png differ diff --git a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.9.png b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.9.png index 61e6d6c24..a011a4c2d 100644 Binary files a/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.9.png and b/BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_previews_addEditItemView.9.png differ diff --git a/BitwardenShared/UI/Vault/VaultItem/EditCollections/EditCollectionsView.swift b/BitwardenShared/UI/Vault/VaultItem/EditCollections/EditCollectionsView.swift index 4bd2731a3..8f657c416 100644 --- a/BitwardenShared/UI/Vault/VaultItem/EditCollections/EditCollectionsView.swift +++ b/BitwardenShared/UI/Vault/VaultItem/EditCollections/EditCollectionsView.swift @@ -23,11 +23,8 @@ struct EditCollectionsView: View { store.send(.dismissPressed) } - ToolbarItem(placement: .topBarTrailing) { - toolbarButton(Localizations.save) { - await store.perform(.save) - } - .accessibilityIdentifier("SaveButton") + saveToolbarItem { + await store.perform(.save) } } }