Page MenuHomePhabricator

Test error handling when component not listed in codexComponents
Closed, ResolvedPublic

Description

While working on https://phabricator.wikimedia.org/T353187 we found that there are error scenarios where a Codex component is not listed in the module definition file that we would like to provide helpful custom error messages for. The scope of this ticket is to test those error handling scenarios in CodexModuleTest.php.

Example scenarios where a Codex component is required:

const { CdxButton } = require( './codex.js' );

And:

  1. The codexComponents key is defined, and there are other components listed, but not CdxButton
  2. The codexComponents key is defined, and there are no components listed (an empty array)
  3. The codexComponents key is not defined (This scenario is not handled because there is a valid case where a user may use themeStyles and not require codexComponents to be defined)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
CCiufo-WMF subscribed.

Hey @tyhopp I'm moving this to our tracking column, but as usual if you need support on this please let us know!

Change 991107 had a related patch set uploaded (by Tyhopp; author: Tyhopp):

[mediawiki/core@master] CodexModuleTest: Missing codex components definition

https://gerrit.wikimedia.org/r/991107

Change 991107 merged by jenkins-bot:

[mediawiki/core@master] CodexModuleTest: Missing codex components definition

https://gerrit.wikimedia.org/r/991107

Change 991467 had a related patch set uploaded (by Tyhopp; author: Tyhopp):

[mediawiki/core@master] CodexModuleTest: Invalid codex components definition

https://gerrit.wikimedia.org/r/991467

Change 991467 merged by jenkins-bot:

[mediawiki/core@master] CodexModuleTest: Invalid codex components definition

https://gerrit.wikimedia.org/r/991467