diff --git a/.codecov.yml b/.codecov.yml index d87f8f8806d..9887fb6c990 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -3,17 +3,17 @@ coverage: project: default: off mobile: - paths: "packages/mobile/" + paths: 'packages/mobile/' flags: mobile - threshold: 40% - target: 10% - web: - paths: "packages/web/" - flags: web threshold: 5% target: 70% + web: + paths: 'packages/web/' + flags: web + threshold: 2% + target: 75% protocol: - paths: "packages/protocol/" + paths: 'packages/protocol/' flags: protocol threshold: 5% target: 90% diff --git a/packages/web/src/dev/LeaderBoard.test.tsx b/packages/web/src/dev/LeaderBoard.test.tsx new file mode 100644 index 00000000000..1e32a83ac95 --- /dev/null +++ b/packages/web/src/dev/LeaderBoard.test.tsx @@ -0,0 +1,20 @@ +import { fireEvent, render } from '@testing-library/react' +import * as React from 'react' +import LeaderBoard from 'src/dev/LeaderBoard' + +const leaders = new Array(12).fill({ points: 10, identity: 'annie', address: '0x1f3f' }) + +describe('LeaderBoard', () => { + it('it displays an expand button, and when pressed a "collapse" butto shows', () => { + const { getByText } = render() + + fireEvent.click(getByText(/expand/)) + expect(getByText(/collapse/)).toBeTruthy() + }) + + it('displays a link to terms', () => { + const { getByText } = render() + + expect(getByText(/terms/i).getAttribute('href')).toEqual('/stake-off/terms') + }) +}) diff --git a/packages/web/src/home/MissionText.tsx b/packages/web/src/home/MissionText.tsx deleted file mode 100644 index 6c38a423ef2..00000000000 --- a/packages/web/src/home/MissionText.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import * as React from 'react' -import { Text } from 'react-native' -import { H1 } from 'src/fonts/Fonts' -import { I18nProps, withNamespaces } from 'src/i18n' -import { Cell, GridRow, Spans } from 'src/layout/GridRow' -import { fonts, standardStyles, textStyles } from 'src/styles' - -function MissionText({ t }: I18nProps) { - return ( - - -

- {t('missionMeaning')} -

- {t('missionText')} -
-
- ) -} - -export default withNamespaces('about')(React.memo(MissionText)) diff --git a/packages/web/src/utils/abortableFetch.test.ts b/packages/web/src/utils/abortableFetch.test.ts new file mode 100644 index 00000000000..b46054e712e --- /dev/null +++ b/packages/web/src/utils/abortableFetch.test.ts @@ -0,0 +1,10 @@ +const fetch = jest.fn() +jest.mock('cross-fetch', () => fetch) +import abortableFetch from 'src/utils/abortableFetch' + +describe('abortableFetch', () => { + it('behaves like fetch', async () => { + await abortableFetch('with-any-given-url.domain', { method: 'get' }) + expect(fetch).toHaveBeenCalledWith('with-any-given-url.domain', { method: 'get' }) + }) +})