Skip to content

Commit

Permalink
BC-6551 - Assign [data-testid] on Board Columns Element & Test Implem…
Browse files Browse the repository at this point in the history
…entation (#3121)

* added data test ids
  • Loading branch information
MartinSchuhmacher authored Feb 27, 2024
1 parent 9ace252 commit 5e5f8de
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/components/feature-board/board/BoardColumn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
:columnId="column.id"
:title="column.title"
:titlePlaceholder="titlePlaceholder"
:index="index"
@delete:column="onColumnDelete"
@move:column-left="onMoveColumnLeft"
@move:column-right="onMoveColumnRight"
Expand Down
10 changes: 9 additions & 1 deletion src/components/feature-board/board/BoardColumnHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,19 @@
<div class="d-flex align-center py-2 px-2">
<BoardAnyTitleInput
:value="title"
:data-testid="`column-title-${index}`"
scope="column"
:isEditMode="isEditMode"
:placeholder="titlePlaceholder"
@update:value="onUpdateTitle"
class="w-100"
:isFocused="isFocusedById"
/>
<BoardMenu v-if="hasDeletePermission" scope="column">
<BoardMenu
v-if="hasDeletePermission"
scope="column"
:data-testid="`column-menu-btn-${index}`"
>
<BoardMenuActionEdit v-if="!isEditMode" @click="onStartEditMode" />
<BoardMenuActionMoveLeft @click="onMoveColumnLeft" />
<BoardMenuActionMoveRight @click="onMoveColumnRight" />
Expand Down Expand Up @@ -75,6 +80,9 @@ export default defineComponent({
type: String,
required: true,
},
index: {
type: Number,
},
},
emits: [
"delete:column",
Expand Down
4 changes: 4 additions & 0 deletions src/components/ui-board/BoardMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ export default defineComponent({
type: String as PropType<BoardMenuScope>,
required: true,
},
dataTestid: {
type: String,
default: "board-menu-button",
},
},
setup(props) {
const scope = toRef(props, "scope");
Expand Down
6 changes: 5 additions & 1 deletion src/components/ui-board/BoardMenuActionDelete.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<template>
<BoardMenuAction :icon="mdiTrashCanOutline" @click="onClick">
<BoardMenuAction
:icon="mdiTrashCanOutline"
@click="onClick"
data-testid="board-menu-action-delete"
>
{{ $t("components.board.action.delete") }}
</BoardMenuAction>
</template>
Expand Down
6 changes: 5 additions & 1 deletion src/components/ui-board/BoardMenuActionEdit.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<template>
<BoardMenuAction :icon="mdiPencilOutline" @click="onClick">
<BoardMenuAction
:icon="mdiPencilOutline"
@click="onClick"
data-testid="board-menu-action-edit"
>
{{ $t("common.actions.edit") }}
</BoardMenuAction>
</template>
Expand Down
7 changes: 6 additions & 1 deletion src/components/ui-board/BoardMenuActionMoveDown.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<template>
<BoardMenuAction :icon="mdiArrowDown" @click="onClick" v-if="isVisible">
<BoardMenuAction
:icon="mdiArrowDown"
@click="onClick"
v-if="isVisible"
data-testid="board-menu-action-move-down"
>
{{ $t("components.board.action.moveDown") }}
</BoardMenuAction>
</template>
Expand Down
7 changes: 6 additions & 1 deletion src/components/ui-board/BoardMenuActionMoveLeft.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<template>
<BoardMenuAction :icon="mdiArrowLeft" @click="onClick" v-if="isVisible">
<BoardMenuAction
:icon="mdiArrowLeft"
@click="onClick"
v-if="isVisible"
data-testid="board-menu-action-move-left"
>
{{ $t("components.board.action.moveLeft") }}
</BoardMenuAction>
</template>
Expand Down
7 changes: 6 additions & 1 deletion src/components/ui-board/BoardMenuActionMoveRight.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<template>
<BoardMenuAction :icon="mdiArrowRight" @click="onClick" v-if="isVisible">
<BoardMenuAction
:icon="mdiArrowRight"
@click="onClick"
v-if="isVisible"
data-testid="board-menu-action-move-right"
>
{{ $t("components.board.action.moveRight") }}
</BoardMenuAction>
</template>
Expand Down
7 changes: 6 additions & 1 deletion src/components/ui-board/BoardMenuActionMoveUp.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<template>
<BoardMenuAction :icon="mdiArrowUp" @click="onClick" v-if="isVisible">
<BoardMenuAction
:icon="mdiArrowUp"
@click="onClick"
v-if="isVisible"
data-testid="board-menu-action-move-up"
>
{{ $t("components.board.action.moveUp") }}
</BoardMenuAction>
</template>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/rooms/RoomDetails.page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export default defineComponent({
icon: mdiPlus,
title: this.$t("common.actions.add"),
ariaLabel: this.$t("common.actions.add"),
testId: "add-tool-button",
dataTestId: "add-tool-button",
href: `/tools/context/tool-configuration?contextId=${this.courseId}&contextType=course`,
};
Expand Down Expand Up @@ -263,7 +263,7 @@ export default defineComponent({
icon: mdiPlus,
title: this.$t("common.actions.create"),
ariaLabel: this.$t("common.actions.create"),
testId: "add-content-button",
dataTestId: "add-content-button",
actions: actions,
};
return items;
Expand Down

0 comments on commit 5e5f8de

Please sign in to comment.