Skip to content

Commit

Permalink
fix(KtStandardTable): add data-test attributes to buttons in kt-stand…
Browse files Browse the repository at this point in the history
…ard-table
  • Loading branch information
Isokaeder committed Jan 14, 2025
1 parent c68987f commit ed8d395
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/kotti-ui/source/kotti-table/KtStandardTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<div v-if="!hideTableActions" class="kt-standard-table__table-actions">
<TableSearch
v-if="!options?.hideControls?.search"
data-test="table-search-field"
:isLoading="isLoadingAndEmpty"
:placeholder="options?.searchPlaceholder"
:value="searchValue"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
:trigger="isLoading ? 'manual' : 'click'"
>
<KtButton
data-test="table-column-edit-button"
:disabled="isLoading"
:icon="Yoco.Icon.CHEVRON_DOWN"
:isLoading="isLoading"
Expand All @@ -20,6 +21,7 @@
/>
<!-- FIXME: ideally this button shoud not be behind the fold -->
<KtButton
data-test="table-column-show-all-button"
:disabled="isShowAllDisabled"
:label="translations.showAll"
type="text"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
:trigger="isLoading ? 'manual' : 'click'"
>
<KtButton
data-test="table-filter-edit-button"
:disabled="isLoading"
:icon="Yoco.Icon.CHEVRON_DOWN"
:isLoading="isLoading"
Expand All @@ -22,6 +23,7 @@
@input="$emit('input', $event)"
/>
<KtButton
data-test="table-filter-clear-all-button"
:disabled="isLoading"
:label="translations.clearAll"
type="text"
Expand Down Expand Up @@ -53,8 +55,8 @@ export default defineComponent({
type: Array as PropType<KottiStandardTable.FilterInternal[]>,
},
isLoading: { default: false, type: Boolean },
size: { default: 'md', type: String },
tableId: { required: true, type: String },
value: {
default: () => [],
type: Array as PropType<KottiStandardTable.AppliedFilter[]>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default defineComponent({
return {
options: computed<KottiFieldSingleSelect.Props['options']>(() =>
props.pageSizeOptions.map((value) => ({
dataTest: `table-page-size-options-${value}`,
label: String(value),
value,
})),
Expand Down

0 comments on commit ed8d395

Please sign in to comment.