mirror of
https://github.com/kremalicious/blog.git
synced 2024-11-22 09:56:51 +01:00
fixes
This commit is contained in:
parent
82ff684a69
commit
ca151a6452
@ -23,7 +23,9 @@ const esModules = [
|
|||||||
'escape-string-regexp',
|
'escape-string-regexp',
|
||||||
'markdown-table',
|
'markdown-table',
|
||||||
'web-namespaces',
|
'web-namespaces',
|
||||||
'@rainbow-me/rainbowkit'
|
'@rainbow-me/rainbowkit',
|
||||||
|
'wagmi',
|
||||||
|
'@wagmi/core'
|
||||||
].join('|')
|
].join('|')
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
@ -7,6 +7,8 @@ export const wrapPageElement: GatsbySSR['wrapPageElement'] =
|
|||||||
wrapPageElementWithLayout
|
wrapPageElementWithLayout
|
||||||
|
|
||||||
export const onRenderBody = ({ setPostBodyComponents, setHtmlAttributes }) => {
|
export const onRenderBody = ({ setPostBodyComponents, setHtmlAttributes }) => {
|
||||||
|
setHtmlAttributes({ lang: 'en' })
|
||||||
|
|
||||||
const isEnabled = process.env.NODE_ENV === 'production'
|
const isEnabled = process.env.NODE_ENV === 'production'
|
||||||
|
|
||||||
if (!isEnabled) {
|
if (!isEnabled) {
|
||||||
@ -18,7 +20,6 @@ export const onRenderBody = ({ setPostBodyComponents, setHtmlAttributes }) => {
|
|||||||
'data-website-id': UMAMI_WEBSITE_ID
|
'data-website-id': UMAMI_WEBSITE_ID
|
||||||
}
|
}
|
||||||
|
|
||||||
setHtmlAttributes({ lang: 'en' })
|
|
||||||
setPostBodyComponents([
|
setPostBodyComponents([
|
||||||
<script key="umami-script" async defer {...umamiOptions} />
|
<script key="umami-script" async defer {...umamiOptions} />
|
||||||
])
|
])
|
||||||
|
@ -21,13 +21,11 @@ export function PureChangelog({
|
|||||||
}): ReactElement | null {
|
}): ReactElement | null {
|
||||||
const [changelogHtml, setChangelogHtml] = useState()
|
const [changelogHtml, setChangelogHtml] = useState()
|
||||||
|
|
||||||
const repoFilteredArray = repos
|
const repoMatch = repos
|
||||||
.map(({ node }) => {
|
.map(({ node }) => {
|
||||||
if (node.name === repo) return node
|
if (node.name === repo) return node
|
||||||
})
|
})
|
||||||
.filter((n: any) => n)
|
.filter((n: any) => n)[0]
|
||||||
|
|
||||||
const repoMatch = repoFilteredArray[0]
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!(repoMatch?.object as Queries.GitHub_Blob)?.text) return
|
if (!(repoMatch?.object as Queries.GitHub_Blob)?.text) return
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { render, fireEvent } from '@testing-library/react'
|
import { render, fireEvent, screen } from '@testing-library/react'
|
||||||
import ThemeSwitch from './ThemeSwitch'
|
import ThemeSwitch from './ThemeSwitch'
|
||||||
|
|
||||||
describe('ThemeSwitch', () => {
|
describe('ThemeSwitch', () => {
|
||||||
it('renders correctly', () => {
|
it('renders correctly', async () => {
|
||||||
const { container } = render(<ThemeSwitch />)
|
render(<ThemeSwitch />)
|
||||||
const switchContainer = container.querySelector('aside')
|
const element = await screen.findByTitle('Toggle Dark Mode')
|
||||||
expect(switchContainer).toBeInTheDocument()
|
expect(element).toBeInTheDocument()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('checkbox can be changed', () => {
|
it('checkbox can be changed', () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user