Uploaded image for project: 'Camunda Optimize'
  1. Camunda Optimize
  2. OPT-668

Improve test stability

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • L3 - Default
    • 2.0.0, 2.0-alpha1
    • 2.0.0
    • frontend
    • None

    Description

      Many tests in our codebase test for the existence of an element by checking if the node contains a string of text.

      This is fine to test whether a component renders a string of text based on properties or as a result of in-component calculations, but not just to test whether an element exists.

      This is not good practice for several reasons:

      • the string to test for is not defined in the test itself/not part of the test set-up
      • the text contained might change anytime, the test would fail although the functionality is actually fine
      • as a result, tests are extremely brittle

      Instead, we should test for the existence of the node itself by an appropriate selector (which can be used specifically for this purpose, but using the main class name as derived formt he component name is good enough:

      expect(node.find('.Component')).toBePresent();
      

      mgm-controller-panel

        This is the controller panel for Smart Panels app

        Attachments

          Activity

            People

              Unassigned Unassigned
              franz.heidl Franz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Salesforce