openedx / openedx/frontend-plugin-framework

Write unit tests for plugin scenarios not already tested for

Open
#73 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
13
Forks
28
PR merge metrics
No merged PRs in 30d

Description

Some unit tests have already been written to test for iFrame-based Plugins, PluginContainer, and ideally by this point the Direct Plugin and mixed Plugin Slots.

There are definitely some areas of the library that could use unit tests to confirm our assumptions.

Things worth testing include:

  • Plugin Slot
    • it should return nothing if there’s no configuration and no default component
    • it should only return default component if there’s no configuration
    • it should return a React component given a config for one plugin
    • it should only return plugins that have a valid configuration (ie. missing key attributes for iFrame or Direct plugin)
  • Plugin Container iFrame
    • it should return an iFrame with a React component when given a config
  • Consolidate any mock objects (i.e. iframeConfig, directConfig) where possible

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing unit tests for iFrame-based Plugins, PluginContainer, Direct Plugin, and mixed Plugin Slots. Add coverage for the listed Plugin Slot configurations and Plugin Container iFrame behavior, then consolidate shared mock objects such as iframeConfig and directConfig. Done means the specified scenarios are covered and the test suite passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.