diff --git a/__test__/components/Article.test.jsx b/__test__/components/Article.test.jsx
deleted file mode 100644
index a8ba778..0000000
--- a/__test__/components/Article.test.jsx
+++ /dev/null
@@ -1,46 +0,0 @@
-/* eslint-env jest */
-import { render } from '@testing-library/react'
-import Article from '../../src/components/Article/Article'
-import '@testing-library/jest-dom'
-import { formatDate } from '@/lib/helpers'
-
-describe('Article', () => {
- it('renders title', () => {
- const props = generateArticleProps()
- const { getByText } = render()
- const titleElement = getByText(props.attributes.title)
- expect(titleElement).toBeInTheDocument()
- })
-
- it('renders description', () => {
- const props = generateArticleProps()
- const { getByText } = render()
- const descriptionElement = getByText(props.attributes.desc)
- expect(descriptionElement).toBeInTheDocument()
- })
-
- it('renders pubdate if available', () => {
- const props = generateArticleProps()
- const { getByText } = render()
- const pubdateElement = getByText(formatDate(props.attributes.pubdate))
- expect(pubdateElement).toBeInTheDocument()
- })
-
- it('renders content', () => {
- const props = generateArticleProps()
- const { container } = render()
- const contentElement = container.querySelector('[data-test=content]')
- expect(contentElement.innerHTML).toBe(props.html)
- })
-})
-
-function generateArticleProps () {
- return {
- attributes: {
- title: 'My title',
- desc: 'My description',
- pubdate: new Date().toUTCString()
- },
- html: '
This is my content!
'
- }
-}
diff --git a/__test__/components/ExsternalLink.test.jsx b/__test__/components/ExsternalLink.test.jsx
deleted file mode 100644
index 506d457..0000000
--- a/__test__/components/ExsternalLink.test.jsx
+++ /dev/null
@@ -1,28 +0,0 @@
-/* eslint-env jest */
-import { render, screen } from '@testing-library/react'
-import ExternalLink from '../../src/components/ExternalLink/ExternalLink'
-import '@testing-library/jest-dom'
-
-describe('ExternalLink', () => {
- const props = {
- href: 'https://example.com',
- children: 'Test Link'
- }
-
- it('renders without crashing', () => {
- render()
- })
-
- it('renders correct href and rel attributes', () => {
- render()
- const link = screen.getByText(props.children)
- expect(link).toHaveAttribute('href', props.href)
- expect(link).toHaveAttribute('rel', 'nofollow noopener')
- expect(link).toHaveAttribute('target', '_blank')
- })
-
- it('renders children correctly', () => {
- render()
- expect(screen.getByText(props.children)).toBeInTheDocument()
- })
-})
diff --git a/__test__/components/Footer.test.jsx b/__test__/components/Footer.test.jsx
deleted file mode 100644
index b6882e6..0000000
--- a/__test__/components/Footer.test.jsx
+++ /dev/null
@@ -1,10 +0,0 @@
-/* eslint-env jest */
-import { render } from '@testing-library/react'
-import '@testing-library/jest-dom'
-import Footer from '@/components/Footer/Footer'
-
-describe('Footer', () => {
- it('renders without crashing', () => {
- render()
- })
-})
diff --git a/__test__/components/Grid.test.jsx b/__test__/components/Grid.test.jsx
deleted file mode 100644
index 4594a17..0000000
--- a/__test__/components/Grid.test.jsx
+++ /dev/null
@@ -1,16 +0,0 @@
-/* eslint-env jest */
-import { render } from '@testing-library/react'
-import '@testing-library/jest-dom'
-import Grid from '@/components/Grid/Grid'
-
-describe('Grid', () => {
- it('renders without crashing', () => {
- const { container } = render()
- expect(container.firstChild).toHaveClass('grid')
- })
-
- it('renders its children', () => {
- const { getByText } = render(Child
)
- expect(getByText('Child')).toBeInTheDocument()
- })
-})
diff --git a/__test__/components/Header.test.jsx b/__test__/components/Header.test.jsx
deleted file mode 100644
index 200a48a..0000000
--- a/__test__/components/Header.test.jsx
+++ /dev/null
@@ -1,19 +0,0 @@
-/* eslint-env jest */
-import { render, screen } from '@testing-library/react'
-import Header from '../../src/components/Header/Header'
-import '@testing-library/jest-dom'
-
-describe('Header', () => {
- it('renders without crashing', () => {
- render(
- )
- })
-
- it('renders correct navigation links', () => {
- render()
- const links = ['Home', 'Writing', 'CV']
- links.forEach(link => {
- expect(screen.getByText(link)).toBeInTheDocument()
- })
- })
-})
diff --git a/__test__/components/Resume.test.jsx b/__test__/components/Resume.test.jsx
deleted file mode 100644
index 5a56848..0000000
--- a/__test__/components/Resume.test.jsx
+++ /dev/null
@@ -1,63 +0,0 @@
-/* eslint-env jest */
-import { render } from '@testing-library/react'
-import Resume from '../../src/components/Resume/Resume'
-import '@testing-library/jest-dom'
-
-describe('Resume', () => {
- const props = {
- competencies: ['Competency 1', 'Competency 2'],
- education: 'My education history',
- certifications: ['Certification 1', 'Certification 2'],
- languages: [{ name: 'English', proficiency: 'Fluent' }],
- experience: [
- {
- employer: 'Employer 1',
- position: 'Position 1',
- start: 'Start date 1',
- end: 'End date 1',
- desc: 'Description 1'
- }
- ]
- }
-
- it('renders without crashing', () => {
- render()
- })
-
- it('renders competencies', () => {
- const { getByText } = render()
- props.competencies.forEach(competency => {
- expect(getByText(competency)).toBeInTheDocument()
- })
- })
-
- it('renders education', () => {
- const { getByText } = render()
- expect(getByText(props.education)).toBeInTheDocument()
- })
-
- it('renders certifications', () => {
- const { getByText } = render()
- props.certifications.forEach(certification => {
- expect(getByText(certification)).toBeInTheDocument()
- })
- })
-
- it('renders languages', () => {
- const { getByText } = render()
- props.languages.forEach(language => {
- expect(getByText(`${language.name} - ${language.proficiency}`)).toBeInTheDocument()
- })
- })
-
- it('renders experience', () => {
- const { getByText } = render()
- props.experience.forEach(exp => {
- expect(getByText(exp.employer)).toBeInTheDocument()
- expect(getByText(exp.position)).toBeInTheDocument()
- expect(getByText(exp.start)).toBeInTheDocument()
- expect(getByText(exp.end)).toBeInTheDocument()
- expect(getByText(exp.desc)).toBeInTheDocument()
- })
- })
-})
diff --git a/__test__/layouts/DefaultLayout.test.jsx b/__test__/layouts/DefaultLayout.test.jsx
deleted file mode 100644
index 5cecb03..0000000
--- a/__test__/layouts/DefaultLayout.test.jsx
+++ /dev/null
@@ -1,29 +0,0 @@
-/* eslint-env jest */
-import { render, screen } from '@testing-library/react'
-import DefaultLayout from '../../src/layouts/DefaultLayout/DefaultLayout'
-import '@testing-library/jest-dom'
-
-describe('DefaultLayout', () => {
- const props = {
- children: Test Content
- }
-
- it('renders without crashing', () => {
- render()
- })
-
- it('renders Header', () => {
- render()
- expect(screen.getByTestId('header')).toBeInTheDocument()
- })
-
- it('renders Footer', () => {
- render()
- expect(screen.getByTestId('footer')).toBeInTheDocument()
- })
-
- it('renders children correctly', () => {
- render()
- expect(screen.getByText('Test Content')).toBeInTheDocument()
- })
-})
diff --git a/__test__/pages/Writing.test.jsx b/__test__/pages/Writing.test.jsx
deleted file mode 100644
index 126f220..0000000
--- a/__test__/pages/Writing.test.jsx
+++ /dev/null
@@ -1,69 +0,0 @@
-/* eslint-env jest */
-import { render } from '@testing-library/react'
-import '@testing-library/jest-dom'
-import Writing, { Title, Description } from '../../src/pages/writing'
-
-jest.mock('next/head', () => {
- return {
- __esModule: true,
- default: ({ children }) => {
- return <>{children}>
- }
- }
-})
-
-describe('Writing', () => {
- it('renders without crashing', () => {
- render(
- getStubWritingComponent())
- })
-
- it('renders meta title', async () => {
- const { container } = render(getStubWritingComponent())
- expect(container.querySelector('title')).toHaveTextContent(Title)
- })
-
- it('renders opengraph title', () => {
- const { container } = render(getStubWritingComponent())
- expect(container.querySelector('meta[property="og:title"]'))
- .toHaveAttribute('content', Title)
- })
-
- it('renders meta description', () => {
- const { container } = render(getStubWritingComponent())
- expect(container.querySelector('meta[name="description"]'))
- .toHaveAttribute('content', Description)
- })
-
- it('renders opengraph description', () => {
- const { container } = render(getStubWritingComponent())
-
- expect(container.querySelector('meta[property="og:description"]'))
- .toHaveAttribute('content', Description)
- })
-})
-
-function getStubWritingComponent () {
- const entries = [
- {
- attributes: {
- title: 'My title one',
- pubdate: 'Mon, 18 Mar 2024 16:47:32 GMT',
- desc: 'This is my description.'
- },
- html: 'This is some content
',
- slug: 'my-title-one'
- },
- {
- attributes: {
- title: 'My title Two',
- pubdate: 'Mon, 19 Mar 2024 16:47:32 GMT',
- desc: 'This is my description.'
- },
- html: 'This is some content
',
- slug: 'my-title-two'
- }
- ]
-
- return
-}
diff --git a/package.json b/package.json
index 4caf3da..6f9d38a 100644
--- a/package.json
+++ b/package.json
@@ -14,7 +14,7 @@
"format": "npx standard --fix",
"prepare": "husky",
"deploy": "./util/pre-deploy.sh && ./util/deploy-gcloud.sh",
- "test": "jest --verbose",
+ "test": "jest --verbose --passWithNoTests",
"lint": "next lint"
},
"dependencies": {