Skip to content

Testing Aggregate Components

Geoff Cox edited this page Dec 13, 2020 · 1 revision

The test-utils contains helper methods that you can use to test your actions. We recommend a test structure that:

  1. Uses compiler.newComponent() to instantiate the JS code from MSON
  2. Uses testUtils.mockComponentListeners() to mock the actions, globals, registrars, etc...
  3. Executes the .runListeners() method on the component
  4. Uses testUtils.expectActsToContain() to ensure that the proper actions were performed

See the should reset password test for a good example.