Skip to content

Commit

Permalink
fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
precious-onyenaucheya-ons committed Dec 19, 2024
1 parent 12506cb commit 32b2240
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 7 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion src/components/hero/_hero.scss
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,6 @@
display: grid;
align-items: start;
justify-content: space-between;
gap: 1rem;

&.ons-hero__title-badge {
grid-template-columns: 1fr auto;
Expand Down
7 changes: 3 additions & 4 deletions src/components/hero/_macro.njk
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@
"classes": 'ons-u-pt-no ' ~ params.breadcrumbs.classes
})
}}

{% if params.topic %}
<h2 class="ons-hero--topic">{{ params.topic | safe }}</h2>
{% endif %}
{% endif %}
{% if params.topic %}
<h2 class="ons-hero--topic">{{ params.topic | safe }}</h2>
{% endif %}
<div class="ons-hero__title-container {% if params.badge %}ons-hero__title-badge{% endif %}">
<header>
Expand Down
4 changes: 2 additions & 2 deletions src/components/hero/_macro.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ describe('macro: hero', () => {
it('outputs the official statistics badge when badge is set to true', () => {
const $ = cheerio.load(renderComponent('hero', { ...EXAMPLE_HERO, badge: true }));

expect($('svg').hasClass('ons-hero__badge')).toBe(true);
expect($('title').text().trim()).toBe('ons-official-statistics-badge');
expect($('.ons-hero__badge').length).toBe(1);
expect($('.ons-hero__badge svg title').text().trim()).toBe('Offical Statistics Badge');
});

it('renders curved gradient when variant is `grey`', () => {
Expand Down

0 comments on commit 32b2240

Please sign in to comment.