This repository has been archived by the owner on Nov 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add QrCode & Copy to ShapeShift #4322
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f015c74
Extract CopyIcon to ~/ui/Icons
jacogr 1e4d3f2
Add copy & QrCode address
jacogr 45d4b2c
Default size 4
jacogr 936f872
Add bitcoin: link
jacogr 0bf20e7
use protocol links applicable to coin exchanged
jacogr e9da3c2
Merge branch 'master' into jg-qr-shapeshift
jacogr 8883534
Remove .only
jacogr 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
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 |
---|---|---|
|
@@ -19,7 +19,10 @@ import React from 'react'; | |
|
||
import AwaitingDepositStep from './'; | ||
|
||
const TEST_ADDRESS = '0x123456789123456789123456789123456789'; | ||
|
||
let component; | ||
let instance; | ||
|
||
function render () { | ||
component = shallow( | ||
|
@@ -30,6 +33,7 @@ function render () { | |
} } | ||
/> | ||
); | ||
instance = component.instance(); | ||
|
||
return component; | ||
} | ||
|
@@ -48,4 +52,61 @@ describe('modals/Shapeshift/AwaitingDepositStep', () => { | |
render({ depositAddress: 'xyz' }); | ||
expect(component.find('FormattedMessage').first().props().id).to.match(/awaitingDeposit/); | ||
}); | ||
|
||
describe('instance methods', () => { | ||
describe('renderAddress', () => { | ||
let address; | ||
|
||
beforeEach(() => { | ||
address = shallow(instance.renderAddress(TEST_ADDRESS)); | ||
}); | ||
|
||
it('renders the address', () => { | ||
expect(address.text()).to.contain(TEST_ADDRESS); | ||
}); | ||
|
||
describe('CopyToClipboard', () => { | ||
let copy; | ||
|
||
beforeEach(() => { | ||
copy = address.find('Connect(CopyToClipboard)'); | ||
}); | ||
|
||
it('renders the copy', () => { | ||
expect(copy.length).to.equal(1); | ||
}); | ||
|
||
it('passes the address', () => { | ||
expect(copy.props().data).to.equal(TEST_ADDRESS); | ||
}); | ||
}); | ||
|
||
describe('QrCode', () => { | ||
let qr; | ||
|
||
beforeEach(() => { | ||
qr = address.find('QrCode'); | ||
}); | ||
|
||
it('renders the QrCode', () => { | ||
expect(qr.length).to.equal(1); | ||
}); | ||
|
||
it('passed the address', () => { | ||
expect(qr.props().value).to.equal(TEST_ADDRESS); | ||
}); | ||
|
||
describe('protocol link', () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is under There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The link wraps the QrCode. Not attached to it either way, could be outside as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok |
||
it('does not render a protocol link (unlinked type)', () => { | ||
expect(address.find('a')).to.have.length(0); | ||
}); | ||
|
||
it('renders protocol link for BTC', () => { | ||
address = shallow(instance.renderAddress(TEST_ADDRESS, 'BTC')); | ||
expect(address.find('a').props().href).to.equal(`bitcoin:${TEST_ADDRESS}`); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); |
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
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.
Is the class
.hero
still used anywhere ?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.
Yeap. Both in AwaitingExchange & CompletedStep.
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.
Ah right, wasn't looking in the right folder. My bad !