-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #197 from ScaleMote/feature/make-payment
Feature/make payment
- Loading branch information
Showing
24 changed files
with
799 additions
and
140 deletions.
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
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,6 @@ | ||
{ | ||
"destinationAccount": "GCECUYXE32PPYKPVYOSILACOCUGMEZSDO7GYERC2GKAG2HM34BLMMOMB", | ||
"amountToSend": 100, | ||
"assetCode": "native", | ||
"issuer": "none" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/// <reference types="cypress" /> | ||
/// <reference types="@testing-library/cypress"/> | ||
import { amountToSend, assetCode, destinationAccount, issuer } from '../../fixtures/payment.json'; | ||
|
||
describe('checks that the /payment component works', () => { | ||
const BASE_URL = '/payment'; | ||
|
||
it('should visit /payment with payment information but user is not connected', () => { | ||
cy.visit( | ||
`${BASE_URL}?receiver=${destinationAccount}&amount=${amountToSend}&assetCode=${assetCode}&issuer=${issuer}`, | ||
); | ||
cy.get('.user-not-connected').contains('User is not connected'); | ||
cy.get('.payment-btn').click(); | ||
cy.url().should('include', '/connect'); | ||
}); | ||
|
||
it('should render payment information if payment parameters are valid', () => { | ||
window.localStorage.setItem('wallet', 'xbull'); | ||
cy.visit( | ||
`${BASE_URL}?receiver=${destinationAccount}&amount=${amountToSend}&assetCode=${assetCode}&issuer=${issuer}`, | ||
); | ||
cy.get('.simple-signer').contains(`You are paying ${amountToSend} XLM to the account ${destinationAccount}.`); | ||
}); | ||
|
||
it('should render an error if payment parameters was not provided', () => { | ||
cy.visit(`${BASE_URL}?receiver=${destinationAccount}`); | ||
cy.get('.simple-signer').contains("Sorry, the recipient's data wasn't provided."); | ||
}); | ||
}); |
Oops, something went wrong.