Skip to content

Commit

Permalink
updating error message class
Browse files Browse the repository at this point in the history
  • Loading branch information
htmlandbacon committed Nov 28, 2017
1 parent 049f3bb commit 4b327fa
Show file tree
Hide file tree
Showing 16 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ exports[`gov-checkBoxes should add a form hint using the hint attribute 1`] = `
`;

exports[`gov-checkBoxes should add error message and classes when passed an error object 1`] = `
<div class="form-group error" id="my-id-form">
<div class="form-group form-group-error" id="my-id-form">
<fieldset>
<legend>
<span class="form-label">Select a checkbox</span>
Expand Down
2 changes: 1 addition & 1 deletion components/gov-checkboxes/__tests__/gov-checkboxes.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ describe('gov-checkBoxes', () => {
const formGroupClasses = $('.form-group').attr('class');
const errorMsg = $('legend span.error-message').text();

expect(formGroupClasses).toBe('form-group error');
expect(formGroupClasses).toBe('form-group form-group-error');
expect(errorMsg).toBe(error);
expect(output).toMatchSnapshot();
});
Expand Down
2 changes: 1 addition & 1 deletion components/gov-checkboxes/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% set id="input-" + name %}
{% endif %}

<div class="form-group{% if error %} error{% endif %}" id="{{id}}-form">
<div class="form-group{% if error %} form-group-error{% endif %}" id="{{id}}-form">
<fieldset>
<legend>
<span class="form-label{% if classes.legend %} {{ classes.legend }}{% endif %}">{{legend}}</span>
Expand Down
2 changes: 1 addition & 1 deletion components/gov-date-input/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% set id="input-" + name %}
{% endif %}

<div id="{{id}}-form" class="form-group{% if error %} error{% endif %}">
<div id="{{id}}-form" class="form-group{% if error %} form-group-error{% endif %}">
<fieldset>
<div class="form-date">
<legend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ exports[`gov-input should add a form hint using the hint attribute 1`] = `
`;

exports[`gov-input should add error message and classes when passed an error object 1`] = `
<div id="input-full-name-form" class="form-group error">
<div id="input-full-name-form" class="form-group form-group-error">
<label for="input-full-name">
<span class="form-label-bold">Full name</span>
<span class="error-message">Name is wrong</span>
Expand Down
2 changes: 1 addition & 1 deletion components/gov-input/__tests__/gov-input.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ describe('gov-input', () => {
const formGroupClasses = $('.form-group').attr('class');
const errorMsg = $('label span.error-message').text();

expect(formGroupClasses).toBe('form-group error');
expect(formGroupClasses).toBe('form-group form-group-error');
expect(errorMsg).toBe(error);
expect(output).toMatchSnapshot();
});
Expand Down
2 changes: 1 addition & 1 deletion components/gov-input/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% set id="input-" + name %}
{% endif %}

<div id="{{id}}-form" class="form-group{% if error %} error{% endif %}">
<div id="{{id}}-form" class="form-group{% if error %} form-group-error{% endif %}">
<label for="{{ id }}">
<span class="{% if classes.label %}{{ classes.label }}{% else %}form-label-bold{% endif %}">{{ label }}</span>
{% if hint %}<span class="form-hint">{{hint}}</span>{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ exports[`gov-radios should add a form hint using the hint attribute 1`] = `
`;

exports[`gov-radios should add error message and classes when passed an error object 1`] = `
<div class="form-group error" id="my-id-form">
<div class="form-group form-group-error" id="my-id-form">
<fieldset class="inline">
<legend>
<span class="form-label">Select a radio button</span>
Expand Down
2 changes: 1 addition & 1 deletion components/gov-radios/__tests__/gov-radios.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ describe('gov-radios', () => {
const formGroupClasses = $('.form-group').attr('class');
const errorMsg = $('legend span.error-message').text();

expect(formGroupClasses).toBe('form-group error');
expect(formGroupClasses).toBe('form-group form-group-error');
expect(errorMsg).toBe(error);
expect(output).toMatchSnapshot();
});
Expand Down
2 changes: 1 addition & 1 deletion components/gov-radios/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% set id="input-" + name %}
{% endif %}

<div class="form-group{% if error %} error{% endif %}" id="{{id}}-form">
<div class="form-group{% if error %} form-group-error{% endif %}" id="{{id}}-form">
<fieldset{% if radioButtons.length < 3 %} class="inline"{% endif %}>
<legend>
<span class="form-label{% if classes.legend %} {{ classes.legend }}{% endif %}">{{legend}}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ exports[`gov-select should add a form hint using the hint attribute 1`] = `
`;

exports[`gov-select should add error message and classes when passed an error object 1`] = `
<div id="my-id-form" class="form-group error">
<div id="my-id-form" class="form-group form-group-error">
<label for="my-id">
<span class="form-label-bold">select an option</span>
<span class="error-message">Select an option</span>
Expand Down
2 changes: 1 addition & 1 deletion components/gov-select/__tests__/gov-select.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe('gov-select', () => {
const formGroupClasses = $('.form-group').attr('class');
const errorMsg = $('label span.error-message').text();

expect(formGroupClasses).toBe('form-group error');
expect(formGroupClasses).toBe('form-group form-group-error');
expect(errorMsg).toBe(error);
expect(output).toMatchSnapshot();
});
Expand Down
2 changes: 1 addition & 1 deletion components/gov-select/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% set id="select-" + name %}
{% endif %}

<div id="{{id}}-form" class="form-group{% if classes.fromGroup %} {{classes.fromGroup}}{% endif %}{% if error %} error{% endif %}">
<div id="{{id}}-form" class="form-group{% if classes.fromGroup %} {{classes.fromGroup}}{% endif %}{% if error %} form-group-error{% endif %}">
<label for="{{ id }}">
<span class="{% if classes.label %}{{ classes.label }}{% else %}form-label-bold{% endif %}">{{ label }}</span>
{% if hint %}<span class="form-hint">{{hint}}</span>{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ exports[`gov-textarea should add a form hint using the hint attribute 1`] = `
`;

exports[`gov-textarea should add error message and classes when passed an error object 1`] = `
<div id="textarea-more-details-form" class="form-group error">
<div id="textarea-more-details-form" class="form-group form-group-error">
<label for="textarea-more-details">
<span class="form-label-bold">More details</span>
<span class="error-message">Put something in the box</span>
Expand Down
2 changes: 1 addition & 1 deletion components/gov-textarea/__tests__/gov-textarea.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ describe('gov-textarea', () => {
const formGroupClasses = $('.form-group').attr('class');
const errorMsg = $('label .form-label-bold + span.error-message').text();

expect(formGroupClasses).toBe('form-group error');
expect(formGroupClasses).toBe('form-group form-group-error');
expect(errorMsg).toBe(error);
expect(output).toMatchSnapshot();
});
Expand Down
2 changes: 1 addition & 1 deletion components/gov-textarea/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% set rows=8 %}
{% endif %}

<div id="{{id}}-form" class="form-group{% if error %} error{% endif %}">
<div id="{{id}}-form" class="form-group{% if error %} form-group-error{% endif %}">
<label for="{{ id }}">
<span class="{% if classes.label %}{{ classes.label }}{% else %}form-label-bold{% endif %}">{{ label }}</span>
{% if hint %}<span class="form-hint">{{hint}}</span>{% endif %}
Expand Down

0 comments on commit 4b327fa

Please sign in to comment.