Skip to content

Commit

Permalink
fixed pagetransactions not showing transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
faboweb committed Dec 19, 2017
1 parent 21e6cf7 commit bb235be
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 64 deletions.
2 changes: 1 addition & 1 deletion app/src/renderer/components/wallet/PageTransactions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ page(title='Transactions')
modal-search(v-if="filters.transactions.search.visible" type="transactions")

data-empty-tx(v-if='transactions.length === 0')
data-empty-search(v-else-if="filteredTransactions.length")
data-empty-search(v-else-if="filteredTransactions.length === 0")
li-transaction(
v-else
v-for="i in filteredTransactions"
Expand Down
8 changes: 7 additions & 1 deletion test/unit/specs/PageTransactions.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ describe('PageTransactions', () => {
}
})

store.commit('setWalletKey', {address: 'myAddress'})
store.commit('setWalletHistory', [{
tx: {
hash: 'x',
Expand Down Expand Up @@ -77,7 +78,8 @@ describe('PageTransactions', () => {
localVue,
store,
stubs: {
'data-empty-tx': '<data-empty-tx />'
'data-empty-tx': '<data-empty-tx />',
'li-transaction': '<li-transactions />'
}
})

Expand All @@ -93,6 +95,10 @@ describe('PageTransactions', () => {
expect(wrapper.contains('.ni-modal-search')).toBe(true)
})

it('should show transactions', () => {
expect(wrapper.findAll('li-transactions').length).toBe(2)
})

it('should sort the transaction by time', () => {
expect(wrapper.vm.filteredTransactions.map(x => x.tx.hash)).toEqual(['y', 'x'])
})
Expand Down
82 changes: 20 additions & 62 deletions test/unit/specs/__snapshots__/PageTransactions.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -75,37 +75,16 @@ exports[`PageTransactions has the expected html structure 1`] = `
class="ni-page-main"
>
<!---->
<div
class="ni-data-msg"
>
<div
class="ni-data-msg__icon"
>
<i
class="material-icons"
>
search
</i>
</div>
<div
class="ni-data-msg__text"
>
<div
class="ni-data-msg__title"
>
<div>
No Results
</div>
</div>
<div
class="ni-data-msg__subtitle"
>
<div>
Your search did not match any available data.
</div>
</div>
</div>
</div>
<li-transactions
address="myAddress"
devmode="true"
transaction-value="[object Object]"
/>
<li-transactions
address="myAddress"
devmode="true"
transaction-value="[object Object]"
/>
</main>
<footer
class="app-footer"
Expand Down Expand Up @@ -232,37 +211,16 @@ exports[`PageTransactions should filter the transactions 1`] = `
</button>
</div>
</div>
<div
class="ni-data-msg"
>
<div
class="ni-data-msg__icon"
>
<i
class="material-icons"
>
search
</i>
</div>
<div
class="ni-data-msg__text"
>
<div
class="ni-data-msg__title"
>
<div>
No Results
</div>
</div>
<div
class="ni-data-msg__subtitle"
>
<div>
Your search did not match any available data.
</div>
</div>
</div>
</div>
<li-transactions
address="myAddress"
devmode="true"
transaction-value="[object Object]"
/>
<li-transactions
address="myAddress"
devmode="true"
transaction-value="[object Object]"
/>
</main>
<footer
class="app-footer"
Expand Down

0 comments on commit bb235be

Please sign in to comment.