Make text and href correctly render default values when a falsy value is passed to the component, and add some tests checking this for undefined/null and different kinds of falsy values 0,'', false.
Why
The use of the default filter means only undefined values are replaced by the default value provided to the filter. This means a '' string as text would make the button render with no content, causing both visual and accessibility issues.
Who needs to work on this
Developers
Who needs to review this
Developers
Done when
[ ] Default values for text and href render when passed a 'falsy' value
[ ] Tests have been added for undefined/null and different kinds of falsy values 0,'', false
What
Make
text
andhref
correctly render default values when a falsy value is passed to the component, and add some tests checking this forundefined
/null
and different kinds of falsy values0
,''
,false
.Why
The use of the
default
filter means onlyundefined
values are replaced by the default value provided to the filter. This means a''
string astext
would make the button render with no content, causing both visual and accessibility issues.Who needs to work on this
Developers
Who needs to review this
Developers
Done when
text
andhref
render when passed a 'falsy' valueundefined
/null
and different kinds of falsy values0
,''
,false