| @@ -85,5 +85,11 @@ | |||
| "jest-dom": "^4.0.0", | |||
| "prettier": "2.3.1", | |||
| "react-test-renderer": "^18.2.0" | |||
| }, | |||
| "jest": { | |||
| "collectCoverageFrom": [ | |||
| "src/**/*.{js,jsx}", | |||
| "!src/index.js" | |||
| ] | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,9 @@ | |||
| import { render, screen } from '@testing-library/react'; | |||
| import App from '../../../App'; | |||
| test('renders learn react link', () => | |||
| { | |||
| render(<App />); | |||
| const linkElement = screen.getByTitle(/HR Center/i); | |||
| expect(linkElement).toBeInTheDocument(); | |||
| }); | |||
| @@ -0,0 +1,19 @@ | |||
| import Auth from '../../../../components/Auth/Auth'; | |||
| import ReactDOM from 'react-dom' | |||
| import React from 'react' | |||
| import { getByTestId, render, screen } from '@testing-library/react'; | |||
| describe("Auth tests", () => | |||
| { | |||
| it("render without crashing", () => | |||
| { | |||
| const div = document.createElement('div'); | |||
| ReactDOM.render(<Auth></Auth>, div); | |||
| }) | |||
| it("render with children", () => | |||
| { | |||
| const div = document.createElement('div'); | |||
| const divChildren = document.createElement('div'); | |||
| ReactDOM.render(<Auth children={divChildren}></Auth>, div); | |||
| }) | |||
| }) | |||
| @@ -0,0 +1,18 @@ | |||
| import AuthCard from '../../../../components/AuthCards/AuthCard'; | |||
| import ReactDOM from 'react-dom' | |||
| import React from 'react' | |||
| describe("Auth card tests", () => | |||
| { | |||
| it("render without crashing", () => | |||
| { | |||
| const div = document.createElement('div'); | |||
| ReactDOM.render(<AuthCard title={'title'} subtitle={'subtitle'} isLoading={true}></AuthCard>, div); | |||
| }) | |||
| it("render with children", () => | |||
| { | |||
| const div = document.createElement('div'); | |||
| const divChildren = document.createElement('div'); | |||
| ReactDOM.render(<AuthCard children={divChildren}></AuthCard>, div); | |||
| }) | |||
| }) | |||
| @@ -0,0 +1,46 @@ | |||
| import Button from '../../../components/Button/Button' | |||
| import ReactDOM from 'react-dom' | |||
| import React from 'react' | |||
| import { getByTestId, render, screen } from '@testing-library/react'; | |||
| describe("Button tests", () => | |||
| { | |||
| it("render without crashing", () => | |||
| { | |||
| const div = document.createElement('div'); | |||
| ReactDOM.render(<Button variant={""} size={""}></Button>, div); | |||
| }) | |||
| it("render button with base class", () => | |||
| { | |||
| render(<Button></Button>); | |||
| expect(screen.getByTestId('btn')).toHaveClass("c-btn"); | |||
| }) | |||
| it("render button with size 5", () => | |||
| { | |||
| render(<Button size={5}></Button>); | |||
| expect(screen.getByTestId('btn')).toHaveClass("c-btn--5"); | |||
| }) | |||
| it("render button with text transform", () => | |||
| { | |||
| render(<Button textTransform={'transform'}></Button>); | |||
| expect(screen.getByTestId('btn')).toHaveClass("c-btn--transform"); | |||
| }) | |||
| it("render auth button", () => | |||
| { | |||
| render(<Button authButton={true}></Button>); | |||
| expect(screen.getByTestId('btn')).toHaveClass("c-btn--auth"); | |||
| }) | |||
| it("render button with min width", () => | |||
| { | |||
| render(<Button minWidth={5}></Button>); | |||
| expect(screen.getByTestId('btn')).toHaveClass("c-btn--5"); | |||
| }) | |||
| it("render hidden button", () => | |||
| { | |||
| render(<Button hidden={true}></Button>); | |||
| expect(screen.getByTestId('btn')).toHaveClass("c-btn--hidden"); | |||
| }) | |||
| }) | |||
| @@ -0,0 +1,26 @@ | |||
| import BlockSectionLoader from '../../../../components/Loader/BlockSectionLoader'; | |||
| import ReactDOM from 'react-dom' | |||
| import React from 'react' | |||
| import { getByTestId, render, screen } from '@testing-library/react'; | |||
| describe("Block section loader tests", () => | |||
| { | |||
| it("render without crashing", () => | |||
| { | |||
| const div = document.createElement('div'); | |||
| const divChildren = document.createElement('div'); | |||
| ReactDOM.render(<BlockSectionLoader children={divChildren} isLoading={true}></BlockSectionLoader>, div); | |||
| }) | |||
| it("render with full height", () => | |||
| { | |||
| const div = document.createElement('div'); | |||
| const divChildren = document.createElement('div'); | |||
| ReactDOM.render(<BlockSectionLoader fullHeight={true} children={divChildren} isLoading={true}></BlockSectionLoader>, div); | |||
| }) | |||
| it("render without shadow", () => | |||
| { | |||
| const div = document.createElement('div'); | |||
| const divChildren = document.createElement('div'); | |||
| ReactDOM.render(<BlockSectionLoader noShadow={true} children={divChildren} isLoading={true}></BlockSectionLoader>, div); | |||
| }) | |||
| }) | |||
| @@ -0,0 +1,13 @@ | |||
| import FullPageLoader from '../../../../components/Loader/FullPageLoader'; | |||
| import ReactDOM from 'react-dom' | |||
| import React from 'react' | |||
| import { getByTestId, render, screen } from '@testing-library/react'; | |||
| describe("Full page loader tests", () => | |||
| { | |||
| it("render without crashing", () => | |||
| { | |||
| const div = document.createElement('div'); | |||
| ReactDOM.render(<FullPageLoader></FullPageLoader>, div); | |||
| }) | |||
| }) | |||
| @@ -0,0 +1,14 @@ | |||
| import SectionLoader from '../../../../components/Loader/SectionLoader'; | |||
| import ReactDOM from 'react-dom' | |||
| import React from 'react' | |||
| import { getByTestId, render, screen } from '@testing-library/react'; | |||
| describe("Section loader tests", () => | |||
| { | |||
| it("render without crashing", () => | |||
| { | |||
| const div = document.createElement('div'); | |||
| const divChildren = document.createElement('div'); | |||
| ReactDOM.render(<SectionLoader children={divChildren} isLoading={true}></SectionLoader>, div); | |||
| }) | |||
| }) | |||
| @@ -0,0 +1,17 @@ | |||
| import BackdropComponent from '../../../../components/MUI/BackdropComponent' | |||
| import ReactDOM from 'react-dom' | |||
| import React from 'react' | |||
| describe("Backdrop tests", () => | |||
| { | |||
| it("render without crashing", () => | |||
| { | |||
| const div = document.createElement('div'); | |||
| ReactDOM.render(<BackdropComponent isLoading={true}></BackdropComponent>, div); | |||
| }) | |||
| it("render with absolute position", () => | |||
| { | |||
| const div = document.createElement('div'); | |||
| ReactDOM.render(<BackdropComponent position='absolute' isLoading={true}></BackdropComponent>, div); | |||
| }) | |||
| }) | |||
| @@ -0,0 +1,17 @@ | |||
| import DrawerComponent from '../../../../components/MUI/DrawerComponent' | |||
| import ReactDOM from 'react-dom' | |||
| import React from 'react' | |||
| describe("Drawer tests", () => | |||
| { | |||
| it("render without crashing", () => | |||
| { | |||
| const div = document.createElement('div'); | |||
| ReactDOM.render(<DrawerComponent></DrawerComponent>, div); | |||
| }) | |||
| it("render with content", () => | |||
| { | |||
| const div = document.createElement('div'); | |||
| ReactDOM.render(<DrawerComponent content={"content"}></DrawerComponent>, div); | |||
| }) | |||
| }) | |||
| @@ -0,0 +1,17 @@ | |||
| import PopoverComponent from '../../../../components/MUI/PopoverComponent' | |||
| import ReactDOM from 'react-dom' | |||
| import React from 'react' | |||
| describe("Popover tests", () => | |||
| { | |||
| it("render without crashing", () => | |||
| { | |||
| const div = document.createElement('div'); | |||
| ReactDOM.render(<PopoverComponent></PopoverComponent>, div); | |||
| }) | |||
| it("render with content", () => | |||
| { | |||
| const div = document.createElement('div'); | |||
| ReactDOM.render(<PopoverComponent content={"content"}></PopoverComponent>, div); | |||
| }) | |||
| }) | |||
| @@ -0,0 +1,14 @@ | |||
| import Section from '../../../../components/Section/Section'; | |||
| import ReactDOM from 'react-dom' | |||
| import React from 'react' | |||
| import { getByTestId, render, screen } from '@testing-library/react'; | |||
| describe("Section tests", () => | |||
| { | |||
| it("render without crashing", () => | |||
| { | |||
| const div = document.createElement('div'); | |||
| const divChildren = document.createElement('div'); | |||
| ReactDOM.render(<Section children={divChildren} className="section"></Section>, div); | |||
| }) | |||
| }) | |||
| @@ -0,0 +1,13 @@ | |||
| import ApplicantSelection from '../../../../components/Selection/ApplicantSelection'; | |||
| import ReactDOM from 'react-dom' | |||
| import React from 'react' | |||
| import { getByTestId, render, screen } from '@testing-library/react'; | |||
| describe("Applicant selection tests", () => | |||
| { | |||
| it("render without crashing", () => | |||
| { | |||
| const div = document.createElement('div'); | |||
| ReactDOM.render(<ApplicantSelection></ApplicantSelection>, div); | |||
| }) | |||
| }) | |||
| @@ -1,6 +1,6 @@ | |||
| export default { | |||
| app: { | |||
| title: "HR Centar", | |||
| title: "HR Center", | |||
| }, | |||
| refresh: { | |||
| // title: 'Are you active?', | |||
| @@ -77,7 +77,7 @@ export default { | |||
| // this._useDifferentEmail = value; | |||
| // }, | |||
| signInWithGoogle: "Prijava putem Google-a", | |||
| invalidEmail:"Format adrese nije validan" | |||
| invalidEmail: "Format adrese nije validan" | |||
| }, | |||
| // password: { | |||
| // weak: 'weak', | |||
| @@ -169,7 +169,7 @@ export default { | |||
| FD: "Primljenih kandidata", | |||
| }, | |||
| }, | |||
| registration:{ | |||
| registration: { | |||
| phone: 'Broj Telefona', | |||
| linkedinProfile: 'LinkedIn profil', | |||
| position: 'Pozicija', | |||