Skip to content

MerchantsNewPageTests.cs Skipped Tests #756

@StuartFerguson

Description

@StuartFerguson

Summary

Five tests in MerchantsNewPageTests.cs have been temporarily skipped due to challenges with testing form submission that requires interaction with the custom CountrySelector component.

Skipped Tests

  1. MerchantsNew_SuccessfulCreation_ShowsSuccessMessage
  2. MerchantsNew_SuccessfulCreation_NavigatesToMerchantsList
  3. MerchantsNew_FailedCreation_ShowsErrorMessage
  4. MerchantsNew_FailedCreation_DoesNotNavigate
  5. MerchantsNew_SavingState_ShowsLoadingIndicator

Problem

The form uses OnValidSubmit requiring all validation to pass. The Country field uses a custom CountrySelector component (button-based dropdown) that's difficult to interact with in Bunit tests.

Proposed Solutions

  1. Mock/Stub the CountrySelector component
  2. Add data-testid attributes for testing
  3. Move to integration tests
  4. Make Country optional for test scenarios
  5. Improve CountrySelector testability

Related PR

#755

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions