Skip to content

Commit

Permalink
fix: do not use test attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
raimund-schluessler committed Aug 4, 2024
1 parent b42d80d commit a9f71ae
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/components/EntityTable/EntityTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ export default {
'aria-label': label,
'model-value': this.allEntitiesSelected,
indeterminate: this.someEntitiesSelected,
'data-testid': 'select-all-checkbox',
title: label,
}
},
Expand Down
3 changes: 1 addition & 2 deletions src/components/EntityTable/Item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.

<template>
<div :class="{ 'row--has-status': entity.syncStatus }"
class="row handler"
class="row row--item handler"
@click.exact="() => {mode == 'selection' ? selectEntity() : ''}"
@click.ctrl="selectEntity">
<div class="column column--selection">
<NcCheckboxRadioSwitch v-if="showActions"
:aria-label="t('inventory', 'Select')"
:model-value="isSelected"
data-testid="item-checkbox"
@update:model-value="selectEntity" />
</div>
<div class="column">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ describe('EntityTable.vue', () => {
},
})
store.commit('setSearchString', '')
const itemCheckbox = wrapper.findAll('[data-testid="item-checkbox"] input')
const itemCheckbox = wrapper.findAll('.row--item .checkbox-radio-switch input')
itemCheckbox.at(0).setChecked()
itemCheckbox.at(1).setChecked()
itemCheckbox.at(2).setChecked()
Expand All @@ -160,7 +160,7 @@ describe('EntityTable.vue', () => {
},
})
store.commit('setSearchString', '')
const selectAll = wrapper.find('[data-testid="select-all-checkbox"] input')
const selectAll = wrapper.find('.row--header .checkbox-radio-switch input')
selectAll.setChecked()
let itemsFound = wrapper.vm.selectedItems
let allSelected = wrapper.vm.allEntitiesSelected
Expand Down Expand Up @@ -188,7 +188,7 @@ describe('EntityTable.vue', () => {
},
})
store.commit('setSearchString', '')
const itemCheckbox = wrapper.find('[data-testid="item-checkbox"] input')
const itemCheckbox = wrapper.find('.row--item .checkbox-radio-switch input')
itemCheckbox.setChecked()
let selectedItems = wrapper.vm.selectedItems
let allSelected = wrapper.vm.allEntitiesSelected
Expand Down

0 comments on commit a9f71ae

Please sign in to comment.