Skip to content

Commit 69bad2c

Browse files
committed
test(datepicker): Ignore unimportant lines
1 parent 086ea50 commit 69bad2c

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

src/components/DateInput.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,14 @@ export default {
160160
* Toggles the calendar (unless `show-calendar-on-button-click` is true)
161161
*/
162162
handleInputClick() {
163+
/* istanbul ignore next */
163164
const isFocusedUsed = this.showCalendarOnFocus && !this.isFocusedUsed
164165
165166
if (!this.showCalendarOnButtonClick && !isFocusedUsed) {
166167
this.toggle()
167168
}
168169
170+
/* istanbul ignore next */
169171
if (this.showCalendarOnFocus) {
170172
this.isFocusedUsed = true
171173
}

src/components/PickerHeader.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,15 @@ export default {
4444
* Is the left hand navigation button disabled?
4545
* @return {Boolean}
4646
*/
47+
/* istanbul ignore next */
4748
isLeftNavDisabled() {
4849
return this.isRtl ? this.isNextDisabled : this.isPreviousDisabled
4950
},
5051
/**
5152
* Is the right hand navigation button disabled?
5253
* @return {Boolean}
5354
*/
55+
/* istanbul ignore next */
5456
isRightNavDisabled() {
5557
return this.isRtl ? this.isPreviousDisabled : this.isNextDisabled
5658
},

src/mixins/inputProps.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export default {
6161
type: [String, Date, Number],
6262
default: null,
6363
validator: (val) =>
64+
/* istanbul ignore next */
6465
val === null ||
6566
val instanceof Date ||
6667
typeof val === 'string' ||

src/utils/DateUtils.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import en from '~/locale/translations/en'
22

33
// eslint-disable-next-line complexity,max-statements
44
const getParsedDate = ({ formatStr, dateStr, translation }) => {
5+
/* istanbul ignore next */
56
const splitter = formatStr.match(/-|\/|\s|\./) || ['-']
67
const df = formatStr.split(splitter[0])
78
const ds = dateStr.split(splitter[0])
@@ -21,6 +22,7 @@ const getParsedDate = ({ formatStr, dateStr, translation }) => {
2122
ymd[2] = ds[i]
2223
} else if (/d/i.test(df[i])) {
2324
const tmp = ds[i].replace(/st|rd|nd|th/g, '')
25+
/* istanbul ignore next */
2426
ymd[2] = tmp < 10 ? `0${tmp}` : `${tmp}`
2527
}
2628
}
@@ -274,6 +276,7 @@ const utils = {
274276
}
275277

276278
const REGEX_FORMAT = /y{4}|y{2}|M{1,4}(?![aäe])|d{1,2}|o{1}|E{1}(?![eéi])/g
279+
/* istanbul ignore next */
277280
return formatStr.replace(REGEX_FORMAT, (match) => matches[match] || match)
278281
},
279282

0 commit comments

Comments
 (0)