2020-06-09 17:49:41 +02:00
|
|
|
import React from "react";
|
|
|
|
import ReactDom from 'react-dom'
|
2020-06-09 23:22:43 +02:00
|
|
|
import SideBar from "./SideBar";
|
2020-06-09 20:10:26 +02:00
|
|
|
|
2020-06-09 17:49:41 +02:00
|
|
|
import {render} from '@testing-library/react'
|
|
|
|
import "@testing-library/jest-dom"
|
|
|
|
|
2020-06-09 23:22:43 +02:00
|
|
|
describe('<SideBar/>', function () {
|
2020-06-09 20:10:26 +02:00
|
|
|
it('renders without crashing ', function () {
|
|
|
|
const div = document.createElement("div");
|
2020-06-09 23:22:43 +02:00
|
|
|
ReactDom.render(<SideBar/>,div);
|
2020-06-09 20:10:26 +02:00
|
|
|
ReactDom.unmountComponentAtNode(div);
|
|
|
|
});
|
2020-06-09 17:49:41 +02:00
|
|
|
|
2020-06-09 20:10:26 +02:00
|
|
|
it('renders childs correctly', function () {
|
2020-06-09 23:22:43 +02:00
|
|
|
const {getByText} = render(<SideBar>test</SideBar>);
|
|
|
|
const randomElement = getByText(/test/i);
|
|
|
|
expect(randomElement).toBeInTheDocument();
|
2020-06-09 20:10:26 +02:00
|
|
|
});
|
2020-06-09 17:49:41 +02:00
|
|
|
});
|