Skip to content

Commit

Permalink
add dusk attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
zlayine committed Dec 6, 2023
1 parent 6072db7 commit 8247ba0
Show file tree
Hide file tree
Showing 14 changed files with 46 additions and 20 deletions.
9 changes: 7 additions & 2 deletions resources/js/components/FormList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,14 @@
leave-to-class="transform opacity-0 scale-95"
>
<div v-for="(item, idx) in localItems" :key="idx" class="flex flex-row flex-nowrap gap-3 md:gap-6">
<slot name="inputs" :inputs="item" />
<slot name="inputs" :inputs="item" :index="idx" />

<button type="button" class="my-auto cursor-pointer" @click="emit('remove', idx)">
<button
type="button"
:dusk="`btn__remove-item-${idx + 1}`"
class="my-auto cursor-pointer"
@click="emit('remove', idx)"
>
<TrashIcon class="h-5 w-5 text-red-600" aria-hidden="true" />
</button>
</div>
Expand Down
4 changes: 3 additions & 1 deletion resources/js/components/ReadMoreButton.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<template>
<span class="underline text-gray-400 cursor-pointer text-xs" @click="sendReadmoreEvent">Read more</span>
<span dusk="btn__readmore" class="underline text-gray-400 cursor-pointer text-xs" @click="sendReadmoreEvent">
Read more
</span>
</template>

<script setup lang="ts">
Expand Down
4 changes: 3 additions & 1 deletion resources/js/components/batch/BatchSetAttribute.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,19 @@
</div>
<div class="w-5"></div>
</template>
<template #inputs="{ inputs }">
<template #inputs="{ inputs, index }">
<div class="flex-1">
<input
v-model="inputs.key"
:dusk="`input__attribute-key-${index + 1}`"
type="text"
class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary sm:text-sm sm:leading-6"
/>
</div>
<div class="flex-1">
<input
v-model="inputs.value"
:dusk="`input__attribute-value-${index + 1}`"
type="text"
class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary sm:text-sm sm:leading-6"
/>
Expand Down
4 changes: 3 additions & 1 deletion resources/js/components/batch/forms/BatchMintForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,19 @@
</div>
<div class="w-5"></div>
</template>
<template #inputs="{ inputs }">
<template #inputs="{ inputs, index }">
<div class="flex-1">
<input
v-model="inputs.key"
:dusk="`input__attribute-key-${index + 1}`"
type="text"
class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary sm:text-sm sm:leading-6"
/>
</div>
<div class="flex-1">
<input
v-model="inputs.value"
:dusk="`input__attribute-value-${index + 1}`"
type="text"
class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary sm:text-sm sm:leading-6"
/>
Expand Down
4 changes: 3 additions & 1 deletion resources/js/components/beam/ClaimableTokenForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,19 @@
</div>
<div class="w-5"></div>
</template>
<template #inputs="{ inputs }">
<template #inputs="{ inputs, index }">
<div class="flex-1">
<input
v-model="inputs.key"
:dusk="`input__attribute-key-${index + 1}`"
type="text"
class="mt-2 block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary sm:text-sm sm:leading-6"
/>
</div>
<div class="flex-1">
<input
v-model="inputs.value"
:dusk="`input__attribute-value-${index + 1}`"
type="text"
class="mt-2 block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary sm:text-sm sm:leading-6"
/>
Expand Down
6 changes: 4 additions & 2 deletions resources/js/components/fueltank/DispatchRuleForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@
</div>
<div class="w-5"></div>
</template>
<template #inputs="{ inputs }">
<template #inputs="{ inputs, index }">
<div class="flex-1">
<input
v-model="inputs.caller"
:dusk="`input__caller-${index + 1}`"
type="text"
class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary sm:text-sm sm:leading-6"
/>
Expand Down Expand Up @@ -74,10 +75,11 @@
</div>
<div class="w-5"></div>
</template>
<template #inputs="{ inputs }">
<template #inputs="{ inputs, index }">
<div class="flex-1">
<input
v-model="inputs.collection"
:dusk="`input__collection-id-${index + 1}`"
type="number"
class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary sm:text-sm sm:leading-6"
/>
Expand Down
4 changes: 2 additions & 2 deletions resources/js/components/pages/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
placeholder="Enter token name"
/>
<Btn
id="create-api-token-button"
dusk="btn__create-api-token"
primary
class="py-2.5 disabled:!bg-primary"
@click="createApiToken"
Expand Down Expand Up @@ -68,7 +68,7 @@
/>
</span>
</div>
<Btn :id="`revoke-api-button__${token.name}`" error @click="confirmRevoke(token.name)">
<Btn :dusk="`btn__revoke-api${token.name}`" error @click="confirmRevoke(token.name)">
Revoke
</Btn>
</div>
Expand Down
9 changes: 6 additions & 3 deletions resources/js/components/pages/create/CreateCollection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,17 @@
</div>
<div class="w-5"></div>
</template>
<template #inputs="{ inputs }">
<template #inputs="{ inputs, index }">
<div class="flex-1">
<input
v-model="inputs.collectionId"
:dusk="`input__collection-id-${index + 1}`"
type="number"
class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary sm:text-sm sm:leading-6"
/>
</div>
<div class="flex-1">
<TokenIdInput v-model="inputs.tokenId" />
<TokenIdInput v-model="inputs.tokenId" :dusk="`input_token-id-${index + 1}`" />
</div>
</template>
</FormList>
Expand All @@ -151,17 +152,19 @@
</div>
<div class="w-5"></div>
</template>
<template #inputs="{ inputs }">
<template #inputs="{ inputs, index }">
<div class="flex-1">
<input
v-model="inputs.key"
:dusk="`input__attribute-key-${index + 1}`"
type="text"
class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary sm:text-sm sm:leading-6"
/>
</div>
<div class="flex-1">
<input
v-model="inputs.value"
:dusk="`input__attribute-value-${index + 1}`"
type="text"
class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary sm:text-sm sm:leading-6"
/>
Expand Down
3 changes: 2 additions & 1 deletion resources/js/components/pages/create/CreateFuelTank.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,11 @@
</div>
<div class="w-5"></div>
</template>
<template #inputs="{ inputs }">
<template #inputs="{ inputs, index }">
<div class="flex-1">
<input
v-model="inputs.caller"
:dusk="`input__caller-${index + 1}`"
type="text"
class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary sm:text-sm sm:leading-6"
/>
Expand Down
4 changes: 3 additions & 1 deletion resources/js/components/pages/create/CreateToken.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,17 +157,19 @@
</div>
<div class="w-5"></div>
</template>
<template #inputs="{ inputs }">
<template #inputs="{ inputs, index }">
<div class="flex-1">
<input
v-model="inputs.key"
:dusk="`input__attribute-key-${index + 1}`"
type="text"
class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary sm:text-sm sm:leading-6"
/>
</div>
<div class="flex-1">
<input
v-model="inputs.value"
:dusk="`input__attribute-value-${index + 1}`"
type="text"
class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary sm:text-sm sm:leading-6"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,17 @@
</div>
<div class="w-5"></div>
</template>
<template #inputs="{ inputs }">
<template #inputs="{ inputs, index }">
<div class="flex-1">
<input
v-model="inputs.collectionId"
:dusk="`input__collection-id-${index + 1}`"
type="number"
class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary sm:text-sm sm:leading-6"
/>
</div>
<div class="flex-1">
<TokenIdInput v-model="inputs.tokenId" />
<TokenIdInput v-model="inputs.tokenId" :dusk="`input__token-id-${index + 1}`" />
</div>
</template>
</FormList>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@
</div>
<div class="w-5"></div>
</template>
<template #inputs="{ inputs }">
<template #inputs="{ inputs, index }">
<div class="flex-1">
<input
v-model="inputs.userId"
:dusk="`input__user-id-${index + 1}`"
type="text"
class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary sm:text-sm sm:leading-6"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,19 @@
</div>
<div class="w-5"></div>
</template>
<template #inputs="{ inputs }">
<template #inputs="{ inputs, index }">
<div class="flex-1">
<input
v-model="inputs.key"
:dusk="`input__attribute-key-${index + 1}`"
type="text"
class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary sm:text-sm sm:leading-6"
/>
</div>
<div class="flex-1">
<input
v-model="inputs.value"
:dusk="`input__attribute-value-${index + 1}`"
type="text"
class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary sm:text-sm sm:leading-6"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@
</div>
<div class="w-5"></div>
</template>
<template #inputs="{ inputs }">
<template #inputs="{ inputs, index }">
<div class="flex-1">
<input
v-model="inputs.caller"
:dusk="`input__caller-${index + 1}`"
type="text"
class="block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary sm:text-sm sm:leading-6"
/>
Expand Down

0 comments on commit 8247ba0

Please sign in to comment.