Chore: add test case

This commit is contained in:
Pieter Vander Vennet 2025-06-13 01:14:24 +02:00
parent cd9901d701
commit fee79a198e

View file

@ -179,6 +179,13 @@ export class AddQuestionBox extends DesugaringStep<LayerConfigJson> {
* const tagRenderings = [{id:"questions", render: {"*": "{questions()}" } }]
* const conv = action.convert({tagRenderings}, ConversionContext.construct(["test"], []))
* conv.tagRenderings // => [{id:"questions", render: {"*": "{questions()}" } }]
*
*
* // If a partial questionbox is added, should not add "hidden" to the blacklist
* const action = new AddQuestionBox()
* const tagRenderings = [{id:"questions-some-category", render: {"*": "{questions(whitelist,blacklist,)}" } },{id:"questions-black", render: {"*": "{questions(blacklist)}" } }]
* const conv = action.convert({tagRenderings}, ConversionContext.construct(["test"], []))
* conv.tagRenderings // => [{id:"questions-some-category", render: {"*": "{questions(whitelist,blacklist,)}" } },{id:"questions-black", render: {"*": "{questions(blacklist)}" } }, {id:"leftover-questions",labels: ["ignore-docs","added_by_default"], render: {"*": "{questions( ,hidden;blacklist;whitelist)}" } }]
*/
convert(json: LayerConfigJson, context: ConversionContext): LayerConfigJson {
if (