Skip to content

Commit

Permalink
refs #190: fixing the unit tests and missing spaces, found thanks to …
Browse files Browse the repository at this point in the history
…unit testing.
  • Loading branch information
PierrePaul committed Oct 29, 2024
1 parent bf246fe commit d53289e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
10 changes: 5 additions & 5 deletions templates/_sdc/component.twig
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ props:
{% if component_slots|length > 0 %}
slots:
{% for slot in component_slots %}
{{ slot.name }}:
title: {{ slot.title }}
{% if slot.description %}
description: {{ slot.description }}
{% endif %}
{{ slot.name }}:
title: {{ slot.title }}
{% if slot.description %}
description: {{ slot.description }}
{% endif %}
{% endfor %}
{% endif %}
3 changes: 1 addition & 2 deletions templates/_sdc/template.twig
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<div {{ '{{ attributes }}' }}>
{{ '{# ' }}Keep the outer div whenever possible it is a nice way to ensure the presence of "attributes" {{ '#}' }}
{% if component_slots|length > 0 %}
{% for slot in component_slots %}
{{ '{% block ' }}{{ slot.name }}{{ '%}' }}{{ '{% endblock %}' }}
{{ '{% block ' }}{{ slot.name }}{{ ' %}' }}{{ '{% endblock %}' }}
{% endfor %}
{% endif %}
</div>
8 changes: 3 additions & 5 deletions tests/functional/Generator/SingleDirectoryComponentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ public function testGenerator(): void {
–––––––––––––––––––––––––––
Theme machine name:
➤ foo
Theme name [Foo]:
Expand All @@ -65,7 +64,7 @@ public function testGenerator(): void {
Library dependencies (optional). [Example: core/once]:
core/drupal
Library dependencies (optional). [Example: core/once]:
Expand Down Expand Up @@ -95,8 +94,7 @@ public function testGenerator(): void {
[4] Array
[5] Object
[6] Always null
➤ String
Add another prop? [Yes]:
Expand Down

0 comments on commit d53289e

Please sign in to comment.