-
Notifications
You must be signed in to change notification settings - Fork 98
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
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
49f32a0
some wallet component tests
jbibla 59d1462
wallet tests — stuck on pagebalance
jbibla b2a576a
added test for vuex related component
faboweb 29f97c7
page receive and page send
jbibla efed15a
not testing page receive and send now
jbibla dacb989
attempt to fix build
jbibla 3c0c8e8
fixing snapshot mismatch if date is ms number
faboweb 6b0b450
trying to fix ci with fixing vue versions
faboweb 9d165b1
Update setup.js
faboweb 9995ad4
Update coverage readme
faboweb e8083dd
resolve merge conflict from git pull
jbibla File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) => ({ | ||
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import xmlhttprequest from 'xmlhttprequest' | ||
|
||
// providing the browser XMLHttpRequest in the node.js process of jest where it is not available | ||
global.XMLHttpRequest = xmlhttprequest.XMLHttpRequest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import Vue from 'vue' | ||
import CardAddress from '../../../app/src/renderer/components/wallet/CardAddress' | ||
|
||
describe('CardAddress', () => { | ||
let Cmp, vm | ||
let propsData = { | ||
address: 12345678 | ||
} | ||
|
||
beforeEach(() => { | ||
Cmp = Vue.extend(CardAddress) | ||
vm = new Cmp({ propsData: propsData }).$mount() | ||
}) | ||
|
||
it('has the expected html structure', () => { | ||
expect(vm.$el).toMatchSnapshot() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import Vue from 'vue' | ||
import CardBalance from '../../../app/src/renderer/components/wallet/CardBalance' | ||
|
||
describe('CardBalance', () => { | ||
let Cmp, vm | ||
let propsData = { | ||
balance: { | ||
denom: 'jbcoin', | ||
amount: 1234.56 | ||
} | ||
} | ||
|
||
beforeEach(() => { | ||
Cmp = Vue.extend(CardBalance) | ||
vm = new Cmp({ propsData: propsData }).$mount() | ||
}) | ||
|
||
it('has the expected html structure', () => { | ||
expect(vm.$el).toMatchSnapshot() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import Vue from 'vue' | ||
import CardNew from '../../../app/src/renderer/components/wallet/CardNew' | ||
|
||
describe('CardNew', () => { | ||
let Cmp, vm | ||
let propsData = { | ||
icon: 'taco', | ||
value: 12345678 | ||
} | ||
|
||
beforeEach(() => { | ||
Cmp = Vue.extend(CardNew) | ||
vm = new Cmp({ propsData: propsData }).$mount() | ||
}) | ||
|
||
it('has the expected html structure', () => { | ||
expect(vm.$el).toMatchSnapshot() | ||
}) | ||
}) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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))