1
0
mirror of https://github.com/kremalicious/blowfish.git synced 2024-11-24 19:10:14 +01:00
blowfish/tests/pages/index.test.jsx

37 lines
1.1 KiB
React
Raw Normal View History

2019-09-24 01:13:02 +02:00
import React from 'react'
import { render, fireEvent } from '@testing-library/react'
2020-02-25 04:10:06 +01:00
import {
AppContext,
PriceContext
} from '../../src/renderer/store/createContext'
import { appContext, priceContext } from '../__fixtures__/context'
import Home from '../../src/renderer/pages/index'
2019-09-24 01:13:02 +02:00
describe('Home', () => {
it('renders correctly', () => {
const { container, getByText } = render(
2020-02-25 04:10:06 +01:00
<PriceContext.Provider value={priceContext}>
<AppContext.Provider value={appContext}>
<Home />
</AppContext.Provider>
</PriceContext.Provider>
2019-09-24 01:13:02 +02:00
)
expect(container.firstChild).toBeInTheDocument()
fireEvent.click(getByText(/Ξ/))
2020-02-09 22:16:23 +01:00
// fireEvent.click(getByText(/0x/))
2019-09-24 01:13:02 +02:00
})
it('renders Welcome without config', () => {
const { container } = render(
2020-02-25 04:10:06 +01:00
<PriceContext.Provider value={priceContext}>
<AppContext.Provider value={{ ...appContext, needsConfig: true }}>
<Home />
</AppContext.Provider>
</PriceContext.Provider>
2019-09-24 01:13:02 +02:00
)
expect(container.firstChild).toHaveTextContent(
'Add your first address to get started.'
)
})
})