mirror of
https://github.com/DefectingCat/DefectingCat.github.io
synced 2025-07-16 01:01:38 +00:00
build(test): remove tests
This commit is contained in:
@ -1,25 +0,0 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import NavBar from 'components/nav-bar';
|
||||
import '@testing-library/jest-dom';
|
||||
|
||||
describe('NavBar', () => {
|
||||
it('renders a title', async () => {
|
||||
render(<NavBar />);
|
||||
|
||||
const heading = await screen.findByText(/RUA!/i);
|
||||
|
||||
expect(heading).toBeInTheDocument();
|
||||
});
|
||||
it('renders menu items', async () => {
|
||||
render(<NavBar />);
|
||||
|
||||
const home = await screen.findByText(/Home/i);
|
||||
const blog = await screen.findByText(/Blog/i);
|
||||
|
||||
expect(home).toBeInTheDocument();
|
||||
expect(blog).toBeInTheDocument();
|
||||
|
||||
expect(home).toHaveAttribute('href', '/');
|
||||
expect(blog).toHaveAttribute('href', '/blog');
|
||||
});
|
||||
});
|
@ -1,30 +0,0 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import '@testing-library/jest-dom';
|
||||
import PostCard from 'components/post-card';
|
||||
|
||||
const post = {
|
||||
slug: 'first-post',
|
||||
title: 'First post test',
|
||||
date: '2022-03-22',
|
||||
tags: ['functions', 'javascript'],
|
||||
};
|
||||
|
||||
describe('NavBar', () => {
|
||||
it('render posts', () => {
|
||||
render(<PostCard post={post} />);
|
||||
|
||||
expect(screen.getByText(/First post test/i)).toBeInTheDocument();
|
||||
});
|
||||
it('render tags', () => {
|
||||
render(<PostCard post={post} />);
|
||||
|
||||
expect(screen.getByText(/JavaScript/i)).toBeInTheDocument();
|
||||
});
|
||||
it('renders links', () => {
|
||||
render(<PostCard post={post} />);
|
||||
|
||||
const link = screen.getByRole('link', { name: /First post test/i });
|
||||
expect(link).toBeInTheDocument();
|
||||
expect(link).toHaveAttribute('href', '/p/first-post');
|
||||
});
|
||||
});
|
@ -1,22 +0,0 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import '@testing-library/jest-dom';
|
||||
import Blog from 'pages/blog';
|
||||
|
||||
const posts = [
|
||||
{
|
||||
slug: 'first-post',
|
||||
title: 'First post test',
|
||||
date: '2022-03-22',
|
||||
tags: ['functions', 'javascript'],
|
||||
},
|
||||
];
|
||||
|
||||
describe('NavBar', () => {
|
||||
it('renders blog title', async () => {
|
||||
render(<Blog posts={[]} />);
|
||||
|
||||
const heading = await screen.findByText(/Blog posts/i);
|
||||
|
||||
expect(heading).toBeInTheDocument();
|
||||
});
|
||||
});
|
@ -9,8 +9,6 @@
|
||||
"build-local": "next build",
|
||||
"start": "next start",
|
||||
"lint": "next lint",
|
||||
"test": "jest --watch",
|
||||
"test-ci": "jest --ci --coverage",
|
||||
"pretty": "prettier --write \"./**/*.{js,jsx,ts,tsx,json,md,mdx,css}\" --ignore-unknown",
|
||||
"pretty-check": "prettier \"./**/*.{js,jsx,ts,tsx,json,md,mdx,css}\" --ignore-unknown --check",
|
||||
"prepare": "husky install"
|
||||
@ -49,9 +47,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@next/bundle-analyzer": "^14.1.4",
|
||||
"@testing-library/jest-dom": "^6.4.2",
|
||||
"@testing-library/react": "^14.2.2",
|
||||
"@types/jest": "^29.5.12",
|
||||
"@types/node": "20.11.30",
|
||||
"@types/react": "18.2.69",
|
||||
"@types/three": "^0.162.0",
|
||||
@ -64,8 +59,6 @@
|
||||
"file-loader": "^6.2.0",
|
||||
"gray-matter": "^4.0.3",
|
||||
"husky": "^9.0.11",
|
||||
"jest": "^29.7.0",
|
||||
"jest-environment-jsdom": "^29.7.0",
|
||||
"leva": "^0.9.35",
|
||||
"postcss": "^8.4.38",
|
||||
"prettier": "^3.2.5",
|
||||
|
Reference in New Issue
Block a user