| "jest-dom": "^4.0.0", | "jest-dom": "^4.0.0", | ||||
| "prettier": "2.3.1", | "prettier": "2.3.1", | ||||
| "react-test-renderer": "^18.2.0" | "react-test-renderer": "^18.2.0" | ||||
| }, | |||||
| "jest": { | |||||
| "collectCoverageFrom": [ | |||||
| "src/**/*.{js,jsx}", | |||||
| "!src/index.js" | |||||
| ] | |||||
| } | } | ||||
| } | |||||
| } |
| 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(); | |||||
| }); |
| 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); | |||||
| }) | |||||
| }) |
| 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); | |||||
| }) | |||||
| }) |
| 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"); | |||||
| }) | |||||
| }) |
| 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); | |||||
| }) | |||||
| }) |
| 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); | |||||
| }) | |||||
| }) |
| 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); | |||||
| }) | |||||
| }) |
| 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); | |||||
| }) | |||||
| }) |
| 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); | |||||
| }) | |||||
| }) |
| 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); | |||||
| }) | |||||
| }) |
| 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); | |||||
| }) | |||||
| }) |
| 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); | |||||
| }) | |||||
| }) |
| export default { | export default { | ||||
| app: { | app: { | ||||
| title: "HR Centar", | |||||
| title: "HR Center", | |||||
| }, | }, | ||||
| refresh: { | refresh: { | ||||
| // title: 'Are you active?', | // title: 'Are you active?', | ||||
| // this._useDifferentEmail = value; | // this._useDifferentEmail = value; | ||||
| // }, | // }, | ||||
| signInWithGoogle: "Prijava putem Google-a", | signInWithGoogle: "Prijava putem Google-a", | ||||
| invalidEmail:"Format adrese nije validan" | |||||
| invalidEmail: "Format adrese nije validan" | |||||
| }, | }, | ||||
| // password: { | // password: { | ||||
| // weak: 'weak', | // weak: 'weak', | ||||
| FD: "Primljenih kandidata", | FD: "Primljenih kandidata", | ||||
| }, | }, | ||||
| }, | }, | ||||
| registration:{ | |||||
| registration: { | |||||
| phone: 'Broj Telefona', | phone: 'Broj Telefona', | ||||
| linkedinProfile: 'LinkedIn profil', | linkedinProfile: 'LinkedIn profil', | ||||
| position: 'Pozicija', | position: 'Pozicija', |