Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some wallet tests #58

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ $ npm run pack
$ npm run test
```

To see where you are missing coverage, run a test first and then open `http-server test/unit/coverage/lcov-repor` to see details for the coverage.


## FAQ

Expand Down
122 changes: 6 additions & 116 deletions app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/src/renderer/components/wallet/PageBalances.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default {
...mapGetters(['filters', 'wallet']),
filteredBalances () {
let query = this.filters.balances.search.query
let list = orderBy(this.wallet.balances, ['denom', 'desc'])
let list = orderBy(this.wallet.balances, ['denom'], ['desc'])
if (this.filters.balances.search.visible) {
return list.filter(i => includes(i.denom.toLowerCase(), query))
} else {
Expand Down
5 changes: 1 addition & 4 deletions app/src/renderer/components/wallet/PageReceive.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ export default {
CardNew
},
computed: {
...mapGetters([
'allAddresses',
'allWallets'
]),
...mapGetters(['allAddresses', 'allWallets']),
addresses () {
return this.allAddresses.slice().reverse()
},
Expand Down
1 change: 0 additions & 1 deletion app/src/renderer/vuex/modules/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export default ({ commit, basecoin }) => {
state[type].search.visible = bool
},
setSearchQuery (state, [type, string]) {
console.log('setSearchQuery', type, string)
state[type].search.query = string
}
}
Expand Down
25 changes: 12 additions & 13 deletions app/src/renderer/vuex/modules/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
const files = require.context('.', false, /\.js$/)
const funcs = {}
files.keys().forEach((key) => {
if (key === './index.js') return
funcs[key.replace(/(\.\/|\.js)/g, '')] = files(key).default
export default (opts) => ({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

require.context is not available in jest (comment on that from the lead dev of jest: facebook/create-react-app#517 (comment))

candidates: require('./candidates.js').default(opts),
config: require('./config.js').default(opts),
delegators: require('./delegators.js').default(opts),
filters: require('./filters.js').default(opts),
node: require('./node.js').default(opts),
notifications: require('./notifications.js').default(opts),
proposals: require('./proposals.js').default(opts),
shoppingCart: require('./shoppingCart.js').default(opts),
user: require('./user.js').default(opts),
validators: require('./validators.js').default(opts),
wallet: require('./wallet.js').default(opts)
})

export default (opts) => {
const modules = {}
for (let key in funcs) {
modules[key] = funcs[key](opts)
}
return modules
}
1 change: 1 addition & 0 deletions app/src/renderer/vuex/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Vue.use(Vuex)

export default (opts = {}) => {
opts.commit = (...args) => store.commit(...args)

var store = new Vuex.Store({
actions,
getters,
Expand Down
Loading