Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jribbink committed Aug 7, 2024
1 parent 8083563 commit c605a73
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion components/Headers/AppHeader.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Image, Text, Heading, HStack, Stack } from '@chakra-ui/react'
import { useConfig } from '../../contexts/ConfigContext'
import { useConfig } from '../../contexts/FclContext'

export default function AppHeader() {
const { appConfig, clientConfig } = useConfig()
Expand Down
4 changes: 2 additions & 2 deletions components/Headers/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import DeveloperMessage from '../DeveloperMessage'
import { isGreaterThanOrEqualToVersion } from '../../helpers/version'
import { SUPPORTED_VERSIONS } from '../../helpers/constants'
import { isTestnet as isTestnetFn } from '../../helpers/networks'
import { useConfig } from '../../contexts/ConfigContext'
import { useConfig } from '../../contexts/FclContext'

export default function Header() {
const isTestnet = isTestnetFn()
Expand All @@ -16,7 +16,7 @@ export default function Header() {
isGreaterThanOrEqualToVersion(appVersion, SUPPORTED_VERSIONS.APP_CONFIG)
const isAppHeaderSupported = isGreaterThanOrEqualToVersion(
appVersion,
SUPPORTED_VERSIONS.APP_CONFIG
SUPPORTED_VERSIONS.APP_CONFIG,
)

return (
Expand Down
6 changes: 2 additions & 4 deletions components/Headers/__tests__/AppHeader.test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { render as defaultRender } from '@testing-library/react'
import AppHeader from '../AppHeader'
import { ConfigProvider } from '../../../contexts/ConfigContext'
import { FclProvider } from '../../../contexts/FclContext'

describe('Component: AppHeader', () => {
const render = config => component => {
return defaultRender(
<ConfigProvider {...config}>{component}</ConfigProvider>
)
return defaultRender(<FclProvider config={config}>{component}</FclProvider>)
}

test('should render the the component with icon', () => {
Expand Down
2 changes: 1 addition & 1 deletion components/Headers/__tests__/Header.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jest.mock(

describe('Component: Header', () => {
const render = config => component => {
return defaultRender(<FclProvider {...config}>{component}</FclProvider>)
return defaultRender(<FclProvider config={config}>{component}</FclProvider>)
}

test('should render the configurable component if version is old enough', () => {
Expand Down

0 comments on commit c605a73

Please sign in to comment.