Skip to content

Commit

Permalink
refactor!: Rename data-test to data-test-id attribute (resolves #987
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Jasenkoo committed Oct 31, 2024
1 parent 5ffb954 commit 06529e6
Show file tree
Hide file tree
Showing 17 changed files with 97 additions and 98 deletions.
2 changes: 1 addition & 1 deletion src/VueDatePicker/components/ActionRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
type="button"
class="dp__action_button dp__action_select"
:disabled="disabled"
data-test="select-button"
data-test-id="select-button"
@keydown="checkKeyDown($event, () => selectDate())"
@click="selectDate"
>
Expand Down
2 changes: 1 addition & 1 deletion src/VueDatePicker/components/Common/SelectionOverlay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
:aria-selected="col.active || undefined"
:aria-disabled="col.disabled || undefined"
tabindex="0"
:data-test="col.text"
:data-test-id="col.text"
@click.prevent="onClick(col)"
@keydown="checkKeyDown($event, () => onClick(col), true)"
@mouseover="setHoverValue(col.value)"
Expand Down
4 changes: 2 additions & 2 deletions src/VueDatePicker/components/DatePicker/DpCalendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
:key="i"
class="dp__calendar_header_item"
role="gridcell"
data-test="calendar-header"
data-test-id="calendar-header"
:aria-label="defaultedAriaLabels?.weekDay?.(i)"
>
<slot v-if="$slots['calendar-header']" name="calendar-header" :day="dayVal" :index="i" />
Expand Down Expand Up @@ -44,7 +44,7 @@
:aria-disabled="dayVal.classData.dp__cell_disabled || undefined"
:aria-label="defaultedAriaLabels?.day?.(dayVal)"
:tabindex="!dayVal.current && hideOffsetDates ? undefined : 0"
:data-test="dayVal.value"
:data-test-id="dayVal.value"
@click.prevent="onDateSelect($event, dayVal)"
@touchend="onDateSelect($event, dayVal, false)"
@keydown="checkKeyDown($event, () => $emit('select-date', dayVal))"
Expand Down
2 changes: 1 addition & 1 deletion src/VueDatePicker/components/DatePicker/DpHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
class="dp__btn dp__month_year_select"
:class="{ 'dp--hidden-el': overlayOpen }"
:aria-label="`${type.text}-${type.ariaLabel}`"
:data-test="`${type.type}-toggle-overlay-${instance}`"
:data-test-id="`${type.type}-toggle-overlay-${instance}`"
@click="type.toggle"
@keydown="checkKeyDown($event, () => type.toggle(), true)"
>
Expand Down
4 changes: 2 additions & 2 deletions src/VueDatePicker/components/DatepickerInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
v-if="!$slots['dp-input']"
:id="uid ? `dp-input-${uid}` : undefined"
ref="inputRef"
data-test="dp-input"
data-test-id="dp-input"
:name="name"
:class="inputClass"
:inputmode="defaultedTextInput.enabled ? 'text' : 'none'"
Expand Down Expand Up @@ -69,7 +69,7 @@
@keydown="checkKeyDown($event, () => onClear($event), true, onClearKeydown)"
@click.prevent="onClear($event)"
>
<CancelIcon class="dp__input_icons" data-test="clear-icon" />
<CancelIcon class="dp__input_icons" data-test-id="clear-icon" />
</button>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/VueDatePicker/components/DatepickerMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
:style="preset.style || {}"
class="dp__btn dp--preset-range"
:class="{ 'dp--preset-range-collapsed': collapse }"
:data-test="preset.testId ?? undefined"
:data-test-id="preset.testId ?? undefined"
@click.prevent="presetDate(preset.value, preset.noTz)"
@keydown="checkKeyDown($event, () => presetDate(preset.value, preset.noTz), true)"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
'dp--qr-btn-disabled': quarter.disabled,
'dp--highlighted': quarter.highlighted,
}"
:data-test="quarter.value"
:data-test-id="quarter.value"
:disabled="quarter.disabled"
@click="selectQuarter(quarter.value, instance, quarter.disabled)"
@mouseover="setHoverDate(quarter.value)"
Expand Down
6 changes: 3 additions & 3 deletions src/VueDatePicker/components/TimePicker/TimeInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
dp__inc_dec_button_disabled: disabledArrowUpBtn(timeInput.type),
'dp--hidden-el': timeOverlayOpen,
}"
:data-test="`${timeInput.type}-time-inc-btn-${props.order}`"
:data-test-id="`${timeInput.type}-time-inc-btn-${props.order}`"
:aria-label="defaultedAriaLabels?.incrementValue(timeInput.type)"
tabindex="0"
@keydown="
Expand Down Expand Up @@ -60,7 +60,7 @@
}"
:disabled="checkOverlayDisabled(timeInput.type)"
tabindex="0"
:data-test="`${timeInput.type}-toggle-overlay-btn-${props.order}`"
:data-test-id="`${timeInput.type}-toggle-overlay-btn-${props.order}`"
@keydown="checkKeyDown($event, () => toggleOverlay(timeInput.type), true)"
@click="toggleOverlay(timeInput.type)"
>
Expand All @@ -83,7 +83,7 @@
dp__inc_dec_button_disabled: disabledArrowDownBtn(timeInput.type),
'dp--hidden-el': timeOverlayOpen,
}"
:data-test="`${timeInput.type}-time-dec-btn-${props.order}`"
:data-test-id="`${timeInput.type}-time-dec-btn-${props.order}`"
:aria-label="defaultedAriaLabels?.decrementValue(timeInput.type)"
tabindex="0"
@keydown="
Expand Down
2 changes: 1 addition & 1 deletion src/VueDatePicker/components/TimePicker/TimePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
:class="{ ...toggleButtonClass, 'dp--hidden-el': showTimePicker }"
:aria-label="defaultedAriaLabels?.openTimePicker"
:tabindex="noOverlayFocus ? undefined : 0"
data-test="open-time-picker-btn"
data-test-id="open-time-picker-btn"
@keydown="checkKeyDown($event, () => toggleTimePicker(true))"
@click="toggleTimePicker(true)"
>
Expand Down
2 changes: 1 addition & 1 deletion src/VueDatePicker/components/shared/YearModePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class="dp__btn dp--year-select"
type="button"
:aria-label="`${year}-${defaultedAriaLabels?.openYearsOverlay}`"
:data-test="`year-mode-btn-${instance}`"
:data-test-id="`year-mode-btn-${instance}`"
@click="() => toggleYearPicker(false)"
@keydown.enter="() => toggleYearPicker(false)"
>
Expand Down
Loading

0 comments on commit 06529e6

Please sign in to comment.