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