Skip to content

Commit 5fdd3fa

Browse files
committed
Add permanent snapshot for DateInput
1 parent 572a2b5 commit 5fdd3fa

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

src/components/date-input/__tests__/DateInput.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import DateInput from '../DateInput';
44

55
describe('DateInput', () => {
66
it('matches snapshot', () => {
7-
const component = mount(<DateInput />);
7+
const component = mount(<DateInput name="testInput" />);
88
expect(component).toMatchSnapshot();
99
component.unmount();
1010
});

src/components/date-input/__tests__/__snapshots__/DateInput.test.tsx.snap

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`DateInput matches snapshot 1`] = `
4-
<DateInput>
4+
<DateInput
5+
name="testInput"
6+
>
57
<LabelBlock />
68
<div
79
className="nhsuk-date-input"
10+
name="testInput"
811
onChange={[Function]}
912
>
1013
<DateInputDay>
@@ -21,15 +24,15 @@ exports[`DateInput matches snapshot 1`] = `
2124
>
2225
<label
2326
className="nhsuk-label nhsuk-date-input__label"
24-
htmlFor="dateinput_01p06-day"
27+
htmlFor="testInput-day"
2528
>
2629
Day
2730
</label>
2831
<input
29-
aria-label="dateinput_01p06-day input"
32+
aria-label="testInput-day input"
3033
className="nhsuk-input nhsuk-date-input__input nhsuk-input--width-2"
31-
id="dateinput_01p06-day"
32-
name="dateinput_01p06-day"
34+
id="testInput-day"
35+
name="testInput-day"
3336
pattern="[0-9]*"
3437
type="number"
3538
/>
@@ -51,15 +54,15 @@ exports[`DateInput matches snapshot 1`] = `
5154
>
5255
<label
5356
className="nhsuk-label nhsuk-date-input__label"
54-
htmlFor="dateinput_01p06-month"
57+
htmlFor="testInput-month"
5558
>
5659
Month
5760
</label>
5861
<input
59-
aria-label="dateinput_01p06-month input"
62+
aria-label="testInput-month input"
6063
className="nhsuk-input nhsuk-date-input__input nhsuk-input--width-2"
61-
id="dateinput_01p06-month"
62-
name="dateinput_01p06-month"
64+
id="testInput-month"
65+
name="testInput-month"
6366
pattern="[0-9]*"
6467
type="number"
6568
/>
@@ -81,15 +84,15 @@ exports[`DateInput matches snapshot 1`] = `
8184
>
8285
<label
8386
className="nhsuk-label nhsuk-date-input__label"
84-
htmlFor="dateinput_01p06-year"
87+
htmlFor="testInput-year"
8588
>
8689
Year
8790
</label>
8891
<input
89-
aria-label="dateinput_01p06-year input"
92+
aria-label="testInput-year input"
9093
className="nhsuk-input nhsuk-date-input__input nhsuk-input--width-4"
91-
id="dateinput_01p06-year"
92-
name="dateinput_01p06-year"
94+
id="testInput-year"
95+
name="testInput-year"
9396
pattern="[0-9]*"
9497
type="number"
9598
/>

0 commit comments

Comments
 (0)