Uploaded image for project: 'OCMUI - OpenShift Cluster Manager UI'
  1. OCMUI - OpenShift Cluster Manager UI
  2. OCMUI-3119

Determine gaps in unit test coverage and create unit tests

    • Determine gaps in unit test coverage
    • False
    • Hide

      None

      Show
      None
    • False
    • Done
    • 0% To Do, 0% In Progress, 100% Done

      Description

      As a developer, I want to add/modify unit tests for files that have very low line coverage(under 20%) so that I can gain confidence when modifying the code base.

      Acceptance criteria

      • When running the full unit test suite, all (*.js, *.ts, *.tsx, *.js)) application files (inside the "src" directory) will have at least 20% line coverage except for the files listed in the "Out of scope"section.
      • Each modified/added unit test will have assertions (aka expects) that test for items/changes
        • For example a new test suite cannot only render the component or only test for accessibility
      • Each component that was modified as part of this work will have at least 75% test line coverage

      Out of scope

      Any feature additions or modifications.

      Any other code modifications, including other tech-debt items like converting to Typescript, converting to functional components, converting to React Query, etc.

       

      Certain files cannot be fully unit tested or contain very little logic so they do not need to be tested.  The following files do not need to meet the 20% coverage list:

      • /src/bootstrap.ts
      • /src/chrome-main.tsx
      • /src/i18n.ts /src/main.tsx
      • /src/components/App/App.tsx
      • and index.* file 

      Testing implications

      Since there will be little to no modification of the comments themselves, there will be very little (if component files needed to be modified in order to be tested) or no (only unit test files were modified) testing beyond the automated unit testing will be needed.

       

      ------------------------------------------------------------------------------------------------------------------------

      Implementation notes

      List of files that do not meet 20% line coverage: unitTestCoverage.txt (note that this may be out of date). Approximately 56 files.

      Any files that have little coverage but are not used by the application can be deleted.

              kdoberst Kim Doberstein
              kdoberst Kim Doberstein
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: