1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

more dynamic intro text

This commit is contained in:
Matthias Kretschmann 2019-10-11 18:35:29 +02:00
parent 5b0c3486dd
commit e007ab2090
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 22 additions and 11 deletions

View File

@ -3,5 +3,5 @@
.actions { .actions {
display: grid; display: grid;
gap: $spacer / 2; gap: $spacer / 2;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
} }

View File

@ -3,7 +3,7 @@ import { render, fireEvent } from '@testing-library/react'
import { MemoryRouter } from 'react-router' import { MemoryRouter } from 'react-router'
import { createMemoryHistory, createLocation } from 'history' import { createMemoryHistory, createLocation } from 'history'
import Faucet from '.' import Faucet from '.'
import { User } from '../../context' import { User, Market } from '../../context'
import { userMockConnected } from '../../../__mocks__/user-mock' import { userMockConnected } from '../../../__mocks__/user-mock'
const history = createMemoryHistory() const history = createMemoryHistory()
@ -12,13 +12,22 @@ const location = createLocation('/faucet')
const setup = () => { const setup = () => {
const utils = render( const utils = render(
<User.Provider value={userMockConnected}> <User.Provider value={userMockConnected}>
<MemoryRouter> <Market.Provider
<Faucet value={{
history={history} network: 'pacific',
location={location} totalAssets: 100,
match={{ params: '', path: '', url: '', isExact: true }} categories: [''],
/> networkMatch: true
</MemoryRouter> }}
>
<MemoryRouter>
<Faucet
history={history}
location={location}
match={{ params: '', path: '', url: '', isExact: true }}
/>
</MemoryRouter>
</Market.Provider>
</User.Provider> </User.Provider>
) )
const button = utils.getByText('Request ETH') const button = utils.getByText('Request ETH')
@ -49,6 +58,6 @@ describe('Faucet', () => {
fireEvent.click(button) fireEvent.click(button)
expect(userMockConnected.requestFromFaucet).toHaveBeenCalledTimes(1) expect(userMockConnected.requestFromFaucet).toHaveBeenCalledTimes(1)
// check for spinner // check for spinner
expect(getByText('Getting Ether...')).toBeInTheDocument() expect(getByText('Getting ETH...')).toBeInTheDocument()
}) })
}) })

View File

@ -14,7 +14,9 @@ function Faucet() {
return ( return (
<Route <Route
title="Faucet" title="Faucet"
description={`Shower yourself with some Ether for Ocean's ${network} network.`} description={`Shower yourself with some ETH ${
showRequestTokens ? 'or OCEAN' : ''
} for Ocean's ${network} network.`}
> >
<Content> <Content>
<Web3message /> <Web3message />