Uploaded image for project: 'Red Hat Internal Developer Platform'
  1. Red Hat Internal Developer Platform
  2. RHIDP-9551

Upstream: Add mockApis support for appLanguageApi to @backstage/test-utils

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Normal Normal
    • 1.9.0
    • None
    • Localization, Upstream
    • None

      Story

      As a plugin developer I want use the appLanguageApi as a simple mock solution, similar to other mocks from @backstage/test-utils.

      This should simplify and streamline the unit test effort of plugins. It should allow us to use it like this:

      <TestApiProvider
        apis={[
          [appLanguageApiRef, mockApis.appLanguage({ defaultLanguage: "en", availableLanguages: ["en", "fr" ] })],
        ]}
      >
      

      Background

      1. https://github.com/redhat-developer/rhdh-plugins/blob/main/workspaces/adoption-insights/plugins/adoption-insights/src/components/CatalogEntities/__tests__/CatalogEntities.test.tsx#L22-L36
        #https://github.com/redhat-developer/rhdh-plugins/blob/main/workspaces/lightspeed/plugins/lightspeed/src/components/__tests__/LightspeedChat.test.tsx#L104-L124

      Dependencies and Blockers

      • No QE impact but helps with unit tests.
      • No docs impact

      Acceptance Criteria

      • Upstream contribution might require additional unit tests and documentation
      • The appLanguage mock might need some optional configuration like the default/initial language and the available languages.

              Unassigned Unassigned
              cjerolim Christoph Jerolimov
              RHIDP - Frontend Plugins & UI
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: