fix(empty-states): properly render empty content warning and add e2e test config

This commit is contained in:
Benedikt Rötsch
2018-03-07 14:02:14 +01:00
committed by Khaled Garbaya
parent 005c8013f8
commit 1baef21340
5 changed files with 11 additions and 4 deletions

View File

@@ -7,4 +7,7 @@ CONTENTFUL_PREVIEW_API_HOST=preview.contentful.com
CONTENTFUL_QA_SPACE_ID=jnzexv31feqf CONTENTFUL_QA_SPACE_ID=jnzexv31feqf
CONTENTFUL_QA_DELIVERY_TOKEN=7c1c321a528a25c351c1ac5f53e6ddc6bcce0712ecebec60817f53b35dd3c42b CONTENTFUL_QA_DELIVERY_TOKEN=7c1c321a528a25c351c1ac5f53e6ddc6bcce0712ecebec60817f53b35dd3c42b
CONTENTFUL_QA_PREVIEW_TOKEN=4310226db935f0e9b6b34fb9ce6611e2061abe1aab5297fa25bd52af5caa531a CONTENTFUL_QA_PREVIEW_TOKEN=4310226db935f0e9b6b34fb9ce6611e2061abe1aab5297fa25bd52af5caa531a
CONTENTFUL_QA_EMPTY_STATES_SPACE_ID=85si70kq8sjj
CONTENTFUL_QA_EMPTY_STATES_DELIVERY_TOKEN=eecf609f1411e10439f95c7d89a86c2661476bc3f92f8f0ead0e303e8e4ce9f9
CONTENTFUL_QA_EMPTY_STATES_PREVIEW_TOKEN=f9d927308234f773f90be351e72010fa6ca8f0e36b94cb3cc0f84a40c43f2e4d
PORT=3007 PORT=3007

View File

@@ -10,6 +10,7 @@ const app = require('../app')
const { const {
CONTENTFUL_SPACE_ID, CONTENTFUL_DELIVERY_TOKEN, CONTENTFUL_PREVIEW_TOKEN, CONTENTFUL_SPACE_ID, CONTENTFUL_DELIVERY_TOKEN, CONTENTFUL_PREVIEW_TOKEN,
CONTENTFUL_QA_SPACE_ID, CONTENTFUL_QA_DELIVERY_TOKEN, CONTENTFUL_QA_PREVIEW_TOKEN, CONTENTFUL_QA_SPACE_ID, CONTENTFUL_QA_DELIVERY_TOKEN, CONTENTFUL_QA_PREVIEW_TOKEN,
CONTENTFUL_QA_EMPTY_STATES_SPACE_ID, CONTENTFUL_QA_EMPTY_STATES_DELIVERY_TOKEN, CONTENTFUL_QA_EMPTY_STATES_PREVIEW_TOKEN,
PORT PORT
} = process.env } = process.env
@@ -31,7 +32,10 @@ server.listen(TEST_PORT, function () {
`CONTENTFUL_PREVIEW_TOKEN=${CONTENTFUL_PREVIEW_TOKEN}`, `CONTENTFUL_PREVIEW_TOKEN=${CONTENTFUL_PREVIEW_TOKEN}`,
`CONTENTFUL_QA_SPACE_ID=${CONTENTFUL_QA_SPACE_ID}`, `CONTENTFUL_QA_SPACE_ID=${CONTENTFUL_QA_SPACE_ID}`,
`CONTENTFUL_QA_DELIVERY_TOKEN=${CONTENTFUL_QA_DELIVERY_TOKEN}`, `CONTENTFUL_QA_DELIVERY_TOKEN=${CONTENTFUL_QA_DELIVERY_TOKEN}`,
`CONTENTFUL_QA_PREVIEW_TOKEN=${CONTENTFUL_QA_PREVIEW_TOKEN}` `CONTENTFUL_QA_PREVIEW_TOKEN=${CONTENTFUL_QA_PREVIEW_TOKEN}`,
`CONTENTFUL_QA_EMPTY_STATES_SPACE_ID=${CONTENTFUL_QA_EMPTY_STATES_SPACE_ID}`,
`CONTENTFUL_QA_EMPTY_STATES_DELIVERY_TOKEN=${CONTENTFUL_QA_EMPTY_STATES_DELIVERY_TOKEN}`,
`CONTENTFUL_QA_EMPTY_STATES_PREVIEW_TOKEN=${CONTENTFUL_QA_EMPTY_STATES_PREVIEW_TOKEN}`
] ]
let command = [ let command = [
'run', 'run',

View File

@@ -14,7 +14,7 @@ block content
.layout-centered .layout-centered
+editorialFeatures(landingPage) +editorialFeatures(landingPage)
.modules-container .modules-container
if landingPage.fields.contentModules.length if landingPage.fields.contentModules && landingPage.fields.contentModules.length
each module in landingPage.fields.contentModules each module in landingPage.fields.contentModules
case module.sys.contentType.sys.id case module.sys.contentType.sys.id
when 'layoutCopy' when 'layoutCopy'

View File

@@ -9,7 +9,7 @@ mixin lesson(lesson, course, nextLesson)
h1.lesson__title #{lesson.fields.title} h1.lesson__title #{lesson.fields.title}
+editorialFeatures(lesson) +editorialFeatures(lesson)
.lesson__modules .lesson__modules
if lesson.fields.modules.length if lesson.fields.modules && lesson.fields.modules.length
each module in lesson.fields.modules each module in lesson.fields.modules
if module.sys.contentType if module.sys.contentType
case module.sys.contentType.sys.id case module.sys.contentType.sys.id
@@ -28,4 +28,3 @@ mixin lesson(lesson, course, nextLesson)
+emptyModule() +emptyModule()
if nextLesson if nextLesson
a.lesson__cta.cta(href=`/courses/${course.fields.slug}/lessons/${nextLesson.fields.slug}${queryString}`) #{translate('nextLessonLabel', currentLocale.code)} a.lesson__cta.cta(href=`/courses/${course.fields.slug}/lessons/${nextLesson.fields.slug}${queryString}`) #{translate('nextLessonLabel', currentLocale.code)}

View File

@@ -4,6 +4,7 @@ mixin moduleHighlightedCourse(module, course)
.module.module-highlighted-course .module.module-highlighted-course
if(!course) if(!course)
.module-highlighted-course__wrapper .module-highlighted-course__wrapper
.module-highlighted-course__overlay
.module-highlighted-course__content .module-highlighted-course__content
h2.module-highlighted-course__title #{translate('errorHighlightedCourse', currentLocale.code)} h2.module-highlighted-course__title #{translate('errorHighlightedCourse', currentLocale.code)}
else else