fix: make help button use subforum topics (#37741)

* fix: make help button use subforum topics

* fix: add test to check that block exists

Co-authored-by: ojeytonwilliams <ojeytonwilliams@gmail.com>

* fix: improve error message

* Update curriculum/test/test-challenges.js

Co-Authored-By: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
Tom
2019-11-15 11:33:08 -06:00
committed by mrugesh
parent 07b74ab70b
commit 5ca2d2467a
5 changed files with 68 additions and 11 deletions

View File

@@ -61,6 +61,7 @@ const getIntroIfRequired = (node, index, nodeArray) => {
exports.createChallengePages = createPage => ({ node }, index, thisArray) => {
const {
block,
fields: { slug },
required = [],
template,
@@ -76,6 +77,7 @@ exports.createChallengePages = createPage => ({ node }, index, thisArray) => {
component: getTemplateComponent(challengeType),
context: {
challengeMeta: {
block: block,
introPath: getIntroIfRequired(node, index, thisArray),
template,
required,