test: move tests into folder and add test files in exclude list

feature/scripts-sh
Näser 3 years ago
parent 7fb96c3ca5
commit 38fd5a1abe

@ -1,10 +0,0 @@
import { render } from '@testing-library/react';
import Footer from './footer';
describe('Footer', () => {
it('should render successfully', () => {
const { baseElement } = render(<Footer />);
expect(baseElement).toBeTruthy();
});
});

@ -1,10 +0,0 @@
import { render } from '@testing-library/react';
import SeoConfig from './seo-config';
describe('SeoConfig', () => {
it('should render successfully', () => {
const { baseElement } = render(<SeoConfig />);
expect(baseElement).toBeTruthy();
});
});

@ -1,10 +1,10 @@
sonar.host.url=http://192.168.1.33:9000/ sonar.host.url=http://192.168.1.33:9000/
sonar.projectKey=david:guitar-apps sonar.projectKey=david:guitar-apps
sonar.sources=./ sonar.sources=./
sonar.exclusions=.next/,.eslintrc.json,config.ts,index.d.ts,jest.config.ts,next.config.js,postcss.config.js,tailwind.config.js,with-nx.js,**/*.css,**/*.scss sonar.exclusions=.next/,.eslintrc.json,config.ts,index.d.ts,jest.config.ts,next.config.js,postcss.config.js,tailwind.config.js,with-nx.js,**/*.css,**/*.scss,**/*.spec.ts,**/*.spec.tsx
sonar.coverage.exclusions=.next/,.eslintrc.json,config.ts,index.d.ts,jest.config.ts,next.config.js,postcss.config.js,tailwind.config.js,with-nx.js sonar.coverage.exclusions=.next/,.eslintrc.json,config.ts,index.d.ts,jest.config.ts,next.config.js,postcss.config.js,tailwind.config.js,with-nx.js
sonar.language=ts sonar.language=ts
sonar.tests=./ sonar.tests=./tests
sonar.javascript.lcov.reportPaths=../../coverage/apps/website/lcov.info sonar.javascript.lcov.reportPaths=../../coverage/apps/website/lcov.info
sonar.testExecutionReportPaths=test-report.xml sonar.testExecutionReportPaths=test-report.xml
sonar.sourceEncoding=UTF-8 sonar.sourceEncoding=UTF-8

@ -1,6 +1,6 @@
import { render } from '@testing-library/react'; import { render } from '@testing-library/react';
import Carousel from './carousel'; import Carousel from '../components/carousel/carousel';
describe('Carousel', () => { describe('Carousel', () => {
it('should render successfully', () => { it('should render successfully', () => {

@ -0,0 +1,10 @@
import {render} from '@testing-library/react';
import Footer from '../components/footer/footer';
describe('Footer', () => {
it('should render successfully', () => {
const {baseElement} = render(<Footer/>);
expect(baseElement).toBeTruthy();
});
});

@ -1,13 +1,12 @@
import {render} from '@testing-library/react'; import {render} from '@testing-library/react';
import {SessionProvider, useSession} from "next-auth/react";
import Header from './header'; import Header from '../components/header/header';
jest.mock("next-auth/react", () => { jest.mock("next-auth/react", () => {
const originalModule = jest.requireActual('next-auth/react'); const originalModule = jest.requireActual('next-auth/react');
const mockSession = { const mockSession = {
expires: new Date(Date.now() + 2 * 86400).toISOString(), expires: new Date(Date.now() + 2 * 86400).toISOString(),
user: { username: "admin" } user: {username: "admin"}
}; };
return { return {
__esModule: true, __esModule: true,

@ -1,12 +1,12 @@
import { render } from '@testing-library/react'; import {render} from '@testing-library/react';
import Layout from './layout'; import Layout from '../components/layout/layout';
jest.mock("next-auth/react", () => { jest.mock("next-auth/react", () => {
const originalModule = jest.requireActual('next-auth/react'); const originalModule = jest.requireActual('next-auth/react');
const mockSession = { const mockSession = {
expires: new Date(Date.now() + 2 * 86400).toISOString(), expires: new Date(Date.now() + 2 * 86400).toISOString(),
user: { username: "admin" } user: {username: "admin"}
}; };
return { return {
__esModule: true, __esModule: true,
@ -19,7 +19,7 @@ jest.mock("next-auth/react", () => {
describe('Layout', () => { describe('Layout', () => {
it('should render successfully', () => { it('should render successfully', () => {
const { baseElement } = render(<Layout />); const {baseElement} = render(<Layout/>);
expect(baseElement).toBeTruthy(); expect(baseElement).toBeTruthy();
}); });
}); });

@ -0,0 +1,10 @@
import {render} from '@testing-library/react';
import SeoConfig from '../components/seo-config/seo-config';
describe('SeoConfig', () => {
it('should render successfully', () => {
const {baseElement} = render(<SeoConfig/>);
expect(baseElement).toBeTruthy();
});
});
Loading…
Cancel
Save