Skip to content

Commit 2ccb564

Browse files
committed
test(TextInput): Test for required input
1 parent 7fcea55 commit 2ccb564

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/components/TextInput/TextInput.spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,21 @@ describe('TextInput', () => {
264264
});
265265
});
266266

267+
it('renders a required input', () => {
268+
// Arrange
269+
const wrapper = shallowMount(JTextInput, {
270+
props: {
271+
id: 'test-id',
272+
},
273+
attrs: {
274+
required: 'true'
275+
}
276+
});
277+
278+
// Assert
279+
expect(wrapper.find('label').text()).toContain('* (required)');
280+
});
281+
267282
it('renders an error message', () => {
268283
// Arrange
269284
const wrapper = shallowMount(JTextInput, {

0 commit comments

Comments
 (0)