added locators for lock unlock torn flow

This commit is contained in:
Roman Kasinsky 2022-06-13 18:13:02 +03:00 committed by Danil Kovtonyuk
parent 7f57fb6263
commit 6d56ed2405
5 changed files with 34 additions and 9 deletions

View File

@ -35,6 +35,7 @@
type="is-text"
:icon-left="isDataLoading ? '' : 'settings'"
:loading="isDataLoading"
data-test="button_manage_torn"
@click.native="onManage"
>
{{ $t('manage') }}

View File

@ -1,7 +1,7 @@
<template>
<div class="modal-card box box-modal has-delete">
<button type="button" class="delete" @click="$emit('close')" />
<b-tabs v-model="activeTab" :animated="false" class="is-modal">
<b-tabs v-model="activeTab" :data-test="`tab_${activeTab}`" :animated="false" class="is-modal">
<LockTab />
<UnlockTab />
<DelegateTab />

View File

@ -1,5 +1,5 @@
<template>
<b-tab-item :label="$t('delegate')">
<b-tab-item :label="$t('delegate')" header-class="delegate_tab">
<div class="p">
{{ $t('delegateTabDesc') }}
</div>

View File

@ -1,5 +1,5 @@
<template>
<b-tab-item :label="$t('lock')">
<b-tab-item :label="$t('lock')" header-class="lock_torn_tab">
<div class="p">
{{ $t('lockTabDesc') }}
</div>
@ -7,6 +7,7 @@
<b-field :class="hasErrorAmount ? 'is-warning' : ''">
<b-input
v-model="computedAmountToLock"
data-test="input_torn_amount_to_lock"
step="0.01"
:min="minAmount"
:max="maxAmountToLock"
@ -18,6 +19,7 @@
<div class="control has-button">
<button
class="button is-primary is-small is-outlined"
data-test="button_max_torn_amount_to_lock"
@mousedown.prevent
@click="setMaxAmountToLock"
>
@ -27,13 +29,26 @@
</b-field>
</b-field>
<div class="label-with-value">
{{ $t('availableBalance') }}: <span><number-format :value="maxAmountToLock" /> TORN</span>
{{ $t('availableBalance') }}:
<span><number-format data-test="info_available_balance" :value="maxAmountToLock" /> TORN</span>
</div>
<div class="buttons buttons__halfwidth">
<b-button type="is-primary is-fullwidth" outlined :disabled="disabledApprove" @click="onApprove">
<b-button
type="is-primary is-fullwidth"
outlined
data-test="button_approve_torn"
:disabled="disabledApprove"
@click="onApprove"
>
{{ $t('approve') }}
</b-button>
<b-button type="is-primary is-fullwidth" outlined :disabled="disabledLock" @click="onLock">
<b-button
type="is-primary is-fullwidth"
outlined
data-test="button_lock_torn"
:disabled="disabledLock"
@click="onLock"
>
{{ $t('lock') }}
</b-button>
</div>

View File

@ -1,5 +1,5 @@
<template>
<b-tab-item :label="$t('unlock')">
<b-tab-item :label="$t('unlock')" header-class="unlock_torn_tab">
<div class="p">
{{ $t('unlockTabDesc') }}
</div>
@ -7,6 +7,7 @@
<b-field :class="hasErrorAmount ? 'is-warning' : ''">
<b-input
v-model="computedAmountToUnlock"
data-test="input_torn_amount_to_unlock"
step="0.01"
:min="minAmount"
:max="maxAmountToUnlock"
@ -18,6 +19,7 @@
<div class="control has-button">
<button
class="button is-primary is-small is-outlined"
data-test="button_max_torn_amount_to_unlock"
@mousedown.prevent
@click="setMaxAmountToUnlock"
>
@ -27,7 +29,8 @@
</b-field>
</b-field>
<div class="label-with-value">
{{ $t('lockedBalance') }}: <span><number-format :value="maxAmountToUnlock" /> TORN</span>
{{ $t('lockedBalance') }}:
<span><number-format data-test="info_locked_balance" :value="maxAmountToUnlock" /> TORN</span>
</div>
<b-tooltip
class="is-block"
@ -36,7 +39,13 @@
:active="!hasLockedBalance || !canWithdraw"
multilined
>
<b-button :disabled="disableUnlock" type="is-primary is-fullwidth" outlined @click="onUnlock">
<b-button
:disabled="disableUnlock"
type="is-primary is-fullwidth"
outlined
data-test="button_unlock_torn"
@click="onUnlock"
>
{{ $t('unlock') }}
</b-button>
</b-tooltip>