Skip to content

Commit

Permalink
add data-testids + move ariaLabel on room tiles
Browse files Browse the repository at this point in the history
  • Loading branch information
odalys-dataport committed Sep 17, 2024
1 parent 83e5c13 commit b437ee7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
14 changes: 12 additions & 2 deletions src/modules/feature/room/RoomGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,18 @@
</template>
<template v-else>
<v-row>
<v-col v-for="room in rooms" :key="room.id" cols="6" md="4" lg="3">
<RoomTile :room="room" class="px-5 mb-5" />
<v-col
v-for="(room, index) in rooms"
:key="room.id"
cols="6"
md="4"
lg="3"
>
<RoomTile
:room="room"
class="px-5 mb-5"
:data-testid="`room-tile-${index}`"
/>
</v-col>
</v-row>
</template>
Expand Down
24 changes: 10 additions & 14 deletions src/modules/feature/room/RoomTile.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
<template>
<div>
<RouterLink :to="roomPath" class="room-link">
<div
class="room-avatar"
:class="avatarColor"
:aria-label="avatarAriaLabel"
>
<span class="text-h3 text-white" data-testid="room-short-title">
{{ room.shortTitle }}
</span>
</div>
<div class="room-title mb-2 mt-2">{{ room.title }}</div>
</RouterLink>
</div>
<RouterLink :to="roomPath" class="room-link" :aria-label="avatarAriaLabel">
<div class="room-avatar" :class="avatarColor">
<span class="text-h3 text-white" data-testid="room-short-title">
{{ room.shortTitle }}
</span>
</div>
<div class="room-title mb-2 mt-2" data-testid="room-title">
{{ room.title }}
</div>
</RouterLink>
</template>

<script setup lang="ts">
Expand Down

0 comments on commit b437ee7

Please sign in to comment.