Skip to content

Commit

Permalink
update example
Browse files Browse the repository at this point in the history
  • Loading branch information
precious-onyenaucheya-ons committed Sep 28, 2023
1 parent 0d57d60 commit f158fa7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 52 deletions.
2 changes: 1 addition & 1 deletion src/components/error/_macro.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('macro: error', () => {
expect($('.ons-panel__error').text().trim()).toBe('Example error text.');
});

it('has the provided `text` if an array was provided', () => {
it('has the provided error messages when the `text` param is set to an array type', () => {
const $ = cheerio.load(
renderComponent(
'error',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,58 +4,30 @@
{% from "components/list/_macro.njk" import onsList %}

{% call
onsPanel({
title: "There is a problem with this page",
type: "error"
})
%}

{{
onsList({
"element": "ol",
"itemsList": [
{
"text": "Enter a number between 1 to 12",
"url": "#month-error",
"variants": "inPageLink"
},
{
"text": "Enter a date that is after 1 January 2019",
"url": "#year-error",
"variants": "inPageLink"
}
]
})
}}
{% endcall %}
{{
onsDateInput({
"id": "period-from-date",
"legendOrLabel": "Period from:",
"description": "For example, 31 3 2019",
"day": {
"label": {
"text": "Day"
},
"name": "day",
"value": "31"
},
"month": {
"label": {
"text": "Month"
},
"name": "month",
"value": "13"
},
"year": {
"label": {
"text": "Year"
},
"name": "year",
"value": "2018"
}
onsPanel({
title: "There is a problem with this page",
type: "error"
})
}}
%}

{{
onsList({
"element": "ol",
"itemsList": [
{
"text": "Enter a number between 1 to 12",
"url": "#date-input-error",
"variants": "inPageLink"
},
{
"text": "Enter a date that is after 1 January 2019",
"url": "#date-input-error",
"variants": "inPageLink"
}
]
})
}}
{% endcall %}

{{
onsDateInput({
Expand Down

0 comments on commit f158fa7

Please sign in to comment.