Commit 8189d0be authored by Eulyeon Ko's avatar Eulyeon Ko

Apply maintainer suggestions

Use toMatchObject for succinct testing
Simply pass down autocomplete="off"
parent 3746c284
...@@ -287,7 +287,7 @@ export default { ...@@ -287,7 +287,7 @@ export default {
class="gl-relative" class="gl-relative"
:default-date="parsedDate" :default-date="parsedDate"
show-clear-button show-clear-button
:autocomplete="'off'" autocomplete="off"
@input="setDate" @input="setDate"
@clear="setDate(null)" @clear="setDate(null)"
/> />
......
...@@ -120,9 +120,11 @@ describe('Sidebar date Widget', () => { ...@@ -120,9 +120,11 @@ describe('Sidebar date Widget', () => {
}); });
it('uses a correct prop to set the initial date for GlDatePicker', () => { it('uses a correct prop to set the initial date for GlDatePicker', () => {
expect(findDatePicker().props('value')).toBe(null); expect(findDatePicker().props()).toMatchObject({
expect(findDatePicker().props('defaultDate')).toEqual(wrapper.vm.parsedDate); value: null,
expect(findDatePicker().props('autocomplete')).toEqual('off'); autocomplete: 'off',
defaultDate: expect.any(Object),
});
}); });
it('renders GlDatePicker', async () => { it('renders GlDatePicker', async () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment