mirror of
https://github.com/oceanprotocol/commons.git
synced 2023-03-15 18:03:00 +01:00
fix faucet test
This commit is contained in:
parent
ca58d7d0b1
commit
1ab87dea30
@ -101,6 +101,7 @@ class Faucet extends PureComponent<{}, FaucetState> {
|
|||||||
primary
|
primary
|
||||||
onClick={() => this.getTokens(this.context.requestFromFaucet)}
|
onClick={() => this.getTokens(this.context.requestFromFaucet)}
|
||||||
disabled={!this.context.isLogged}
|
disabled={!this.context.isLogged}
|
||||||
|
name="Faucet"
|
||||||
>
|
>
|
||||||
Request Ether
|
Request Ether
|
||||||
</Button>
|
</Button>
|
||||||
|
@ -3,18 +3,27 @@ context('Faucet', () => {
|
|||||||
before(() => {
|
before(() => {
|
||||||
cy.visit('/faucet')
|
cy.visit('/faucet')
|
||||||
// Wait for end of loading
|
// Wait for end of loading
|
||||||
cy.get('button', { timeout: 60000 }).should('have.length', 1)
|
cy.get('button[name="Faucet"]', { timeout: 60000 }).should(
|
||||||
|
'have.length',
|
||||||
|
1
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.get('button[name="Faucet"]')
|
||||||
|
.first()
|
||||||
|
.as('button')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Faucet button is clickable when user is connected.', () => {
|
it('Faucet button is clickable when user is connected.', () => {
|
||||||
cy.get('button')
|
cy.get('@button')
|
||||||
.contains('Request Ether')
|
.contains('Request Ether')
|
||||||
.should('not.be.disabled')
|
.should('not.be.disabled')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Execute faucet call', () => {
|
it('Execute faucet call', () => {
|
||||||
// Execute call
|
// Execute call
|
||||||
cy.get('button')
|
cy.get('@button')
|
||||||
.contains('Request Ether')
|
.contains('Request Ether')
|
||||||
.click()
|
.click()
|
||||||
// Verify that we got response from server
|
// Verify that we got response from server
|
||||||
|
Loading…
Reference in New Issue
Block a user