Skip to content

Commit

Permalink
Merge pull request #458 from storyblok/feat/work-1342
Browse files Browse the repository at this point in the history
feat(work-1342): fix data-testid case
  • Loading branch information
Pablo Veiga authored Oct 26, 2023
2 parents 0255d23 + 50138e1 commit 00926ac
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
14 changes: 11 additions & 3 deletions src/components/Badge/SbBadge.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
<template>
<div :class="activeClasses">
<SbIcon v-if="isRenderIcon" :name="iconName" :data-testid="`${dataTestId}-icon`"/>
<span v-if="hasLabelToRender" class="sb-badge__label" :data-testid="`${dataTestid}-active-label`">
<SbIcon
v-if="isRenderIcon"
:name="iconName"
:data-testid="`${dataTestid}-icon`"
/>
<span
v-if="hasLabelToRender"
class="sb-badge__label"
:data-testid="`${dataTestid}-active-label`"
>
<slot>{{ activeLabel }}</slot>
</span>
<slot v-else></slot>
Expand Down Expand Up @@ -75,7 +83,7 @@ export default {
activeClasses,
activeLabel,
iconName,
dataTestid
dataTestid,
}
},
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Modal/SbModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ export default {
computed: {
closeButtonDataTestId() {
const dataTestId = this.$attrs['data-testid']
return dataTestId ? `${dataTestId}-close-button` : 'sb-modal-close-button'
const dataTestid = this.$attrs['data-testid']
return dataTestid ? `${dataTestid}-close-button` : 'sb-modal-close-button'
},
computedClasses() {
Expand Down

0 comments on commit 00926ac

Please sign in to comment.