From 086aa6325afc39512c45b5ab0a24869646c0c6b4 Mon Sep 17 00:00:00 2001 From: Richard McCarthy Date: Wed, 19 Jun 2024 12:47:44 +0100 Subject: [PATCH] fix tests --- src/components/card/_macro.spec.js | 4 ++-- src/components/question/_macro.njk | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/card/_macro.spec.js b/src/components/card/_macro.spec.js index ba6bf0261d..dc436f2dfd 100644 --- a/src/components/card/_macro.spec.js +++ b/src/components/card/_macro.spec.js @@ -190,7 +190,7 @@ describe('macro: card', () => { it('outputs an `img` element with the expected `srcset`', () => { const $ = cheerio.load(renderComponent('card', EXAMPLE_CARD_WITH_PLACEHOLDER_IMAGE)); - expect($('.ons-card__image').attr('srcset')).toBe('/img/small/placeholder-card.png 1x, /img/large/placeholder-card.png 2x'); + expect($('.ons-card__image').attr('srcset')).toBe('/img/small/placeholder-card.png 1x,/img/large/placeholder-card.png 2x'); }); it('outputs an `img` element with the expected `src`', () => { @@ -217,7 +217,7 @@ describe('macro: card', () => { const $ = cheerio.load(renderComponent('card', EXAMPLE_CARD_WITH_PLACEHOLDER_IMAGE_WITH_PATH)); expect($('.ons-card__image').attr('srcset')).toBe( - '/placeholder-image-url/img/small/placeholder-card.png 1x, /placeholder-image-url/img/large/placeholder-card.png 2x', + '/placeholder-image-url/img/small/placeholder-card.png 1x,/placeholder-image-url/img/large/placeholder-card.png 2x', ); }); diff --git a/src/components/question/_macro.njk b/src/components/question/_macro.njk index 435c620bae..c8487f74e3 100644 --- a/src/components/question/_macro.njk +++ b/src/components/question/_macro.njk @@ -1,9 +1,9 @@ {% macro onsQuestion(params) %} {%- set titleHtml -%} - {%- if params.readDescriptionFirst == true and params.description -%} + {% if params.readDescriptionFirst == true and params.description %}
{{- params.description | safe -}}
- {%- endif -%}{{- params.title | safe -}} + {% endif %}{{- params.title | safe -}} {%- endset -%} {%- set descHtml -%}