Skip to content

Commit

Permalink
feat(vue-demo): add missing data-testid (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdanilowicz committed Jun 26, 2023
1 parent 5ff23a6 commit c74afb4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/hungry-dancers-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vue-demo-store": minor
---

Add missing data-testid
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ watch(enter, (value) => {
</div>
<div
v-if="showSuggest"
data-testid="layout-search-result-box"
class="absolute border-gray-100 border-t-1 duration-300 left-0 mt-2 overflow-hidden right-0 rounded-b-md shadow-md transition-height w-auto z-1"
>
<NuxtLink
Expand All @@ -119,6 +120,7 @@ watch(enter, (value) => {
<div v-else>
<NuxtLink
v-if="getTotal > 0"
data-testid="layout-search-result-box-more-link"
:to="localePath({ path: `/search`, query: { query: typingQuery } })"
@click="[(active = false), $emit('link-clicked')]"
>
Expand All @@ -127,7 +129,9 @@ watch(enter, (value) => {
{{ getTotal }}
<span>{{ $t("search.result", getTotal) }}</span>
</NuxtLink>
<div v-else>{{ $t("search.noResults") }}</div>
<div v-else data-testid="layout-search-result-box-no-result">
{{ $t("search.noResults") }}
</div>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const srcPath = computed(() => {
? `width=${roundUp(width.value)}`
: `height=${roundUp(height.value)}`;
return `${getSmallestThumbnailUrl(
product.value.cover.media
product.value.cover?.media
)}?${biggestParam}&fit=crop,smart`;
});
</script>
Expand Down
3 changes: 3 additions & 0 deletions templates/vue-demo-store/pages/checkout/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,7 @@ const addAddressModalController = useModal();
</div>
<button
type="button"
data-testid="checkout-add-new-billing-address-button"
class="flex font-medium text-brand-dark"
@click="addAddressModalController.open"
>
Expand All @@ -784,6 +785,7 @@ const addAddressModalController = useModal();
<input
id="customShipping"
v-model="state.customShipping"
data-testid="checkout-custom-shipping-address-checkbox"
name="privacy"
type="checkbox"
class="mt-1 focus:ring-indigo-500 h-4 w-4 border text-indigo-600 rounded"
Expand Down Expand Up @@ -823,6 +825,7 @@ const addAddressModalController = useModal();
</div>
<button
type="button"
data-testid="checkout-add-new-shipping-address-button"
class="flex font-medium text-brand-dark"
@click="addAddressModalController.open"
>
Expand Down

0 comments on commit c74afb4

Please sign in to comment.