diff --git a/BitwardenShared/UI/Auth/Landing/SelfHosted/SelfHostedView.swift b/BitwardenShared/UI/Auth/Landing/SelfHosted/SelfHostedView.swift index 81f994a9cf..5adeac08ac 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 70ffdcf536..84cd2e30a1 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 ed6133b97c..df8fc205cc 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 97b1a051ee..9849554c7c 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 becd41f2e0..c89c2425d9 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 5ef5650f7c..0894a23ac9 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 a2add31e19..9c484dee2f 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 fec48ef8ab..54331f41e4 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 4d01617307..3c3506031a 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 21b64ae3dc..389a83a6e3 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 02f8e2ed3b..781b3bac69 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 73d1c5372a..6c0a072d57 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 21b64ae3dc..1c3ff668ea 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 02f8e2ed3b..3bfd07b90e 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 73d1c5372a..d7bd10a09a 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 4981c89fa8..5e95adc71d 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 32d121e272..27badf2483 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 5161638f0a..f73efbfcb0 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 18f5ed5abc..da6a8c84b0 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 daf66ae5ba..e5e0fab65f 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 453d7c9750..f24d394f81 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 2002ed11a8..014e1e6aed 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 d7d6508fdd..2c805a9f09 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 4d15692fac..4fb23aac35 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 3711058839..58415f7fee 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 49202b7d2c..cfdfc312c9 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 3a8577c2c8..334f992f51 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 97629059ec..0ac11c1f82 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 bedffb4c3e..991ade4390 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 65a4073f78..5c2d742d47 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 da10d2a9a1..db24fe5336 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 decaad2d6e..8a5bead363 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 b6ee603812..3c5b73fcc9 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 862d0d2478..5b606f07b2 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 78f6fa79ab..9f0a0ddbfe 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 51ebc58820..c243804e91 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 8899692250..e15a722d90 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 3d7b01279e..0071116ebf 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 580bd6e871..d65f9deff8 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 0eb01cc79a..53abbf124f 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 19468db4f5..3abdf89247 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 4cc9e2129b..a2f849a085 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 38a75dfb17..a534f01a02 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 8e06fb76d5..67e7874276 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 a8ba498066..be39bbd53c 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 565f8359ca..59ce6e4a71 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 ea7407c76b..5278bb1bd4 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 647baf6caa..f2fab691be 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 cc8ccf00fe..bae5cfa5aa 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 7b3be7ff9a..eb9a7f03f3 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 a664300850..a110e1ed04 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 6da70ae0a5..aa849475b7 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 acdcbcb67a..ce515945c0 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 953c354dc9..cff9fae089 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 e881c2720f..bace265e25 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 5b76a83696..6e53a44601 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 4d35e21906..207dc8172d 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 e9f70dac84..48139c19f0 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 ee0b961607..d2614d8447 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 9566b43329..a921c94f4e 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 f8d10efa77..f646d3c952 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 b1f1bbadb0..34c4571df0 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 2403fa25d5..e8af6302ef 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 00ac30f10c..421bc26b5e 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 6c2848695b..1acbfa6ac2 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 32b8859189..744fc9b664 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 77b286f2db..2fdb770325 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 99b78ca59a..9e76a187ee 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 5f5d7ac6a0..4dd8663e9c 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 b7b7f3fa23..056bd8b8ec 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 e20bd285fb..1ff79bb331 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 c590d77323..28a29e836e 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 604fd01c68..aea16f5c97 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 d8130e2bbd..afb8166e6e 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 392ed3fc56..7942b7e7ab 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 61e6d6c249..a011a4c2da 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 4bd2731a3f..8f657c4168 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) } } }