Skip to content

Commit

Permalink
PM-17961: Hide generator action card while creating a new login item. (
Browse files Browse the repository at this point in the history
  • Loading branch information
ezimet-livefront authored Feb 4, 2025
1 parent 004c0da commit 1f24f39
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ struct GeneratorView: View {
)
) {
VStack(alignment: .leading, spacing: 24) {
if store.state.isLearnGeneratorActionCardEligible {
if store.state.isLearnGeneratorActionCardEligible,
store.state.presentationMode == .tab {
ActionCard(
title: Localizations.exploreTheGenerator,
message: Localizations.learnMoreAboutGeneratingSecureLoginCredentialsWithAGuidedTour,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@ class GeneratorViewTests: BitwardenTestCase { // swiftlint:disable:this type_bod
XCTAssertEqual(processor.effects, [.showLearnGeneratorGuidedTour])
}

/// Tests that the generator action card is not present when `.presentationMode` is `.inPlace`.
@MainActor
func test_learnGeneratorActionCard_inVisible() throws {
processor.state.isLearnGeneratorActionCardEligible = true
processor.state.presentationMode = .inPlace
let actionCard = try? subject.inspect().find(actionCard: Localizations.exploreTheGenerator)
XCTAssertNil(actionCard)
}

/// Updating the email type dispatches the `.emailTypeChanged` action.
@MainActor
func test_menuEmailTypeChanged() throws {
Expand Down Expand Up @@ -323,7 +332,7 @@ class GeneratorViewTests: BitwardenTestCase { // swiftlint:disable:this type_bod
)
}

/// Tests the snapshot with the add state with the learn generator action card.
/// Tests the snapshot with the learn generator action card.
@MainActor
func test_snapshot_generatorView_learnGeneratorActionCard() throws {
processor.state.isLearnGeneratorActionCardEligible = true
Expand Down

0 comments on commit 1f24f39

Please sign in to comment.