Skip to content

Commit

Permalink
chore: switch terms active/inactive to unlocked/locked
Browse files Browse the repository at this point in the history
  • Loading branch information
theborakompanioni committed Nov 16, 2023
1 parent 821b227 commit ec30c2a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/components/Wallet.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('<Wallet />', () => {
act(() => setup({ walletFileName: dummyWalletFileName }))

expect(screen.getByText(walletDisplayName(dummyWalletFileName))).toBeInTheDocument()
expect(screen.getByText('wallets.wallet_preview.wallet_inactive')).toBeInTheDocument()
expect(screen.getByText('wallets.wallet_preview.wallet_locked')).toBeInTheDocument()
expect(screen.queryByPlaceholderText('wallets.wallet_preview.placeholder_password')).not.toBeInTheDocument()
expect(screen.queryByText('wallets.wallet_preview.button_unlock')).not.toBeInTheDocument()
expect(screen.queryByText('wallets.wallet_preview.button_open')).not.toBeInTheDocument()
Expand All @@ -62,7 +62,7 @@ describe('<Wallet />', () => {
it('should unlock inactive wallet successfully', async () => {
await act(async () => setup({ walletFileName: dummyWalletFileName, unlockWallet: mockUnlockWallet }))

expect(screen.getByText('wallets.wallet_preview.wallet_inactive')).toBeInTheDocument()
expect(screen.getByText('wallets.wallet_preview.wallet_locked')).toBeInTheDocument()
expect(screen.getByText('wallets.wallet_preview.button_unlock')).toBeInTheDocument()
expect(screen.getByPlaceholderText('wallets.wallet_preview.placeholder_password')).toBeInTheDocument()
expect(screen.queryByText('wallets.wallet_preview.button_open')).not.toBeInTheDocument()
Expand Down Expand Up @@ -93,7 +93,7 @@ describe('<Wallet />', () => {
)

expect(screen.getByText(walletDisplayName(dummyWalletFileName))).toBeInTheDocument()
expect(screen.getByText('wallets.wallet_preview.wallet_active')).toBeInTheDocument()
expect(screen.getByText('wallets.wallet_preview.wallet_unlocked')).toBeInTheDocument()
expect(screen.queryByPlaceholderText('wallets.wallet_preview.placeholder_password')).toBeInTheDocument()
expect(screen.queryByText('wallets.wallet_preview.button_unlock')).toBeInTheDocument()
expect(screen.queryByText('wallets.wallet_preview.button_open')).not.toBeInTheDocument()
Expand All @@ -110,7 +110,7 @@ describe('<Wallet />', () => {
)

expect(screen.getByText(walletDisplayName(dummyWalletFileName))).toBeInTheDocument()
expect(screen.getByText('wallets.wallet_preview.wallet_active')).toBeInTheDocument()
expect(screen.getByText('wallets.wallet_preview.wallet_unlocked')).toBeInTheDocument()
expect(screen.getByText('wallets.wallet_preview.button_open')).toBeInTheDocument()
expect(screen.getByText('wallets.wallet_preview.button_lock')).toBeInTheDocument()
expect(screen.queryByPlaceholderText('wallets.wallet_preview.placeholder_password')).not.toBeInTheDocument()
Expand All @@ -126,7 +126,7 @@ describe('<Wallet />', () => {
}),
)

expect(screen.getByText('wallets.wallet_preview.wallet_active')).toBeInTheDocument()
expect(screen.getByText('wallets.wallet_preview.wallet_unlocked')).toBeInTheDocument()
expect(screen.getByText('wallets.wallet_preview.button_lock')).toBeInTheDocument()

await act(async () => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/Wallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ export default function Wallet({
</rb.Card.Title>

{isActive ? (
<span className="text-success">{t('wallets.wallet_preview.wallet_active')}</span>
<span className="text-success">{t('wallets.wallet_preview.wallet_unlocked')}</span>
) : (
<span className="text-muted">{t('wallets.wallet_preview.wallet_inactive')}</span>
<span className="text-muted">{t('wallets.wallet_preview.wallet_locked')}</span>
)}
</div>

Expand Down
8 changes: 4 additions & 4 deletions src/components/Wallets.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ describe('<Wallets />', () => {

await act(async () => setup({}))

expect(screen.getByText('wallets.wallet_preview.wallet_inactive')).toBeInTheDocument()
expect(screen.getByText('wallets.wallet_preview.wallet_locked')).toBeInTheDocument()
expect(screen.getByText('wallets.wallet_preview.button_unlock')).toBeInTheDocument()
expect(screen.getByPlaceholderText('wallets.wallet_preview.placeholder_password')).toBeInTheDocument()

Expand Down Expand Up @@ -261,7 +261,7 @@ describe('<Wallets />', () => {

await act(async () => setup({}))

expect(screen.getByText('wallets.wallet_preview.wallet_inactive')).toBeInTheDocument()
expect(screen.getByText('wallets.wallet_preview.wallet_locked')).toBeInTheDocument()
expect(screen.getByText('wallets.wallet_preview.button_unlock')).toBeInTheDocument()
expect(screen.getByPlaceholderText('wallets.wallet_preview.placeholder_password')).toBeInTheDocument()

Expand Down Expand Up @@ -313,7 +313,7 @@ describe('<Wallets />', () => {
}),
)

expect(screen.getByText('wallets.wallet_preview.wallet_active')).toBeInTheDocument()
expect(screen.getByText('wallets.wallet_preview.wallet_unlocked')).toBeInTheDocument()
expect(screen.getByText('wallets.wallet_preview.button_lock')).toBeInTheDocument()

await act(async () => {
Expand Down Expand Up @@ -361,7 +361,7 @@ describe('<Wallets />', () => {
}),
)

expect(screen.getByText('wallets.wallet_preview.wallet_active')).toBeInTheDocument()
expect(screen.getByText('wallets.wallet_preview.wallet_unlocked')).toBeInTheDocument()
expect(screen.getByText('wallets.wallet_preview.button_lock')).toBeInTheDocument()

await act(async () => {
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@
"alert_wallet_already_locked": "{{ walletName }} already locked.",
"wallet_active": "Active",
"wallet_inactive": "Inactive",
"wallet_locked": "Locked",
"wallet_unlocked": "Unlocked",
"placeholder_password": "Password",
"button_open": "Open",
"button_lock": "Lock",
Expand Down

0 comments on commit ec30c2a

Please sign in to comment.