1
0

fix: wrapped button

This somehow weirdly fixes the test. I have no clue why. Regardless it should be better than before, because a button  (DropdownItem) should never contain another interactive element (the setBucketLimit input and save button).

The test failed because I replaced a v-if with v-show. I do not know _why_ this made the test fail. When I reproduced the test step by step it worked for me…
This commit is contained in:
Dominik Pschenitschni 2024-07-08 21:15:48 +02:00 committed by konrad
parent faa797f461
commit af639a180c
3 changed files with 38 additions and 34 deletions

View File

@ -116,9 +116,9 @@ describe('Project View Kanban', () => {
cy.get('.kanban .bucket .bucket-header .dropdown.options .dropdown-menu .dropdown-item') cy.get('.kanban .bucket .bucket-header .dropdown.options .dropdown-menu .dropdown-item')
.contains('Limit: Not Set') .contains('Limit: Not Set')
.click() .click()
cy.get('.kanban .bucket .bucket-header .dropdown.options .dropdown-menu .dropdown-item .field input.input') cy.get('.kanban .bucket .bucket-header .dropdown.options .dropdown-menu .field input.input')
.first() .first()
.type(3) .type('3')
cy.get('[data-cy="setBucketLimit"]') cy.get('[data-cy="setBucketLimit"]')
.first() .first()
.click() .click()

View File

@ -2,6 +2,7 @@
<div <div
ref="dropdown" ref="dropdown"
class="dropdown" class="dropdown"
@pointerenter="initialMount = true"
> >
<slot <slot
name="trigger" name="trigger"
@ -22,6 +23,7 @@
<CustomTransition name="fade"> <CustomTransition name="fade">
<div <div
v-if="initialMount || open"
v-show="open" v-show="open"
class="dropdown-menu" class="dropdown-menu"
> >
@ -49,6 +51,8 @@ defineProps({
}) })
const emit = defineEmits(['close']) const emit = defineEmits(['close'])
const initialMount = ref(false)
const open = ref(false) const open = ref(false)
function close() { function close() {

View File

@ -71,9 +71,7 @@
trigger-icon="ellipsis-v" trigger-icon="ellipsis-v"
@close="() => showSetLimitInput = false" @close="() => showSetLimitInput = false"
> >
<DropdownItem
@click.stop="showSetLimitInput = true"
>
<div <div
v-if="showSetLimitInput" v-if="showSetLimitInput"
class="field has-addons" class="field has-addons"
@ -97,15 +95,17 @@
:disabled="bucket.limit < 0" :disabled="bucket.limit < 0"
:icon="['far', 'save']" :icon="['far', 'save']"
:shadow="false" :shadow="false"
@click="setBucketLimit(bucket.id, true)" @click="() => {setBucketLimit(bucket.id, true); showSetLimitInput = false}"
/> />
</div> </div>
</div> </div>
<template v-else> <DropdownItem
v-else
@click.stop="showSetLimitInput = true"
>
{{ {{
$t('project.kanban.limit', {limit: bucket.limit > 0 ? bucket.limit : $t('project.kanban.noLimit')}) $t('project.kanban.limit', {limit: bucket.limit > 0 ? bucket.limit : $t('project.kanban.noLimit')})
}} }}
</template>
</DropdownItem> </DropdownItem>
<DropdownItem <DropdownItem
v-tooltip="$t('project.kanban.doneBucketHintExtended')" v-tooltip="$t('project.kanban.doneBucketHintExtended')"