File tree Expand file tree Collapse file tree 7 files changed +99
-15
lines changed
skill-category-new-dialog Expand file tree Collapse file tree 7 files changed +99
-15
lines changed Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+ import SelectSkillsDialog from "./SelectSkillsDialog" ;
3+ import EnzymeToJson from 'enzyme-to-json' ;
4+ import { mount } from 'enzyme' ;
5+
6+ const skill = {
7+ id : "skill-id" ,
8+ name : "Java" ,
9+ description : "A programming language" ,
10+ pending : false ,
11+ extraneous : true
12+ } ;
13+
14+ it ( "renders correctly" , ( ) => {
15+ const dialog = mount (
16+ < SelectSkillsDialog
17+ isOpen = { true }
18+ onClose = { jest . fn ( ) }
19+ selectableSkills = { [ skill ] }
20+ onSave = { jest . fn ( ) }
21+ />
22+ ) ;
23+ expect ( EnzymeToJson ( dialog ) ) . toMatchSnapshot ( { } ) ;
24+ } ) ;
25+
26+
27+
Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+ import SkillCategoryCard from "./SkillCategoryCard" ;
3+ import { AppContextProvider } from "../../context/AppContext" ;
4+ import { BrowserRouter } from "react-router-dom" ;
5+
6+ it ( "renders correctly" , ( ) => {
7+ snapshot (
8+ < AppContextProvider >
9+ < BrowserRouter >
10+ < SkillCategoryCard name = "Languages" id = "languages-id" />
11+ </ BrowserRouter >
12+ </ AppContextProvider >
13+ ) ;
14+ } ) ;
Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+ import SkillCategoryNewDialog from "./SkillCategoryNewDialog" ;
3+ import EnzymeToJson from 'enzyme-to-json' ;
4+ import { mount } from 'enzyme' ;
5+
6+
7+ it ( "renders correctly" , ( ) => {
8+ const dialog = mount (
9+ < SkillCategoryNewDialog
10+ isOpen = { true }
11+ onClose = { jest . fn ( ) }
12+ onConfirm = { jest . fn ( ) }
13+ />
14+ ) ;
15+ expect ( EnzymeToJson ( dialog ) ) . toMatchSnapshot ( { } ) ;
16+ } ) ;
17+
18+
Original file line number Diff line number Diff line change @@ -41,11 +41,11 @@ const Root = styled('div')({
4141 backgroundColor : "transparent" ,
4242 margin : "4rem 2rem 2rem 2rem" ,
4343 height : "100%" ,
44- 'max-width' : "100%" ,
45- '@media (max-width:800px)' : {
44+ maxWidth : "100%" ,
45+ '@media (max-width: 800px)' : {
4646 display : "flex" ,
47- 'flex-direction' : "column" ,
48- 'overflow-x' : "hidden" ,
47+ flexDirection : "column" ,
48+ overflowX : "hidden" ,
4949 margin : "2rem 5% 0 5%" ,
5050 }
5151 }
@@ -182,21 +182,21 @@ const SkillCategoriesPage = () => {
182182 />
183183 < Autocomplete
184184 className = "filter-skill-categories-field"
185+ size = "small"
186+ style = { { minWidth : "200px" , maxWidth : "300px" } }
187+ options = { skills }
188+ getOptionLabel = { ( option ) => option . name }
189+ filterSelectedOptions
190+ value = { skillFilter }
191+ onChange = { ( _ , newValue ) => setSkillFilter ( newValue ) }
185192 renderInput = { ( params ) => (
186193 < TextField
187194 { ...params }
188- style = { { minWidth : "200px" , maxWidth : "300px" } }
189195 label = "Filter by Skill"
190196 variant = "outlined"
191- size = "small"
192197 placeholder = "Skill name"
193198 />
194199 ) }
195- options = { skills }
196- getOptionLabel = { ( option ) => option . name }
197- filterSelectedOptions
198- value = { skillFilter }
199- onChange = { ( _ , newValue ) => setSkillFilter ( newValue ) }
200200 />
201201 < Button
202202 className = "new-skill-category-button"
Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+ import { AppContextProvider } from "../context/AppContext" ;
3+ import SkillCategoriesPage from "./SkillCategoriesPage" ;
4+
5+ it ( "renders correctly" , ( ) => {
6+ snapshot (
7+ < AppContextProvider >
8+ < SkillCategoriesPage />
9+ </ AppContextProvider >
10+ ) ;
11+ } ) ;
Original file line number Diff line number Diff line change @@ -40,11 +40,11 @@ const Root = styled('div')({
4040 backgroundColor : "transparent" ,
4141 margin : "4rem 2rem 2rem 2rem" ,
4242 height : "100%" ,
43- 'max-width' : "100%" ,
44- '@media (max-width:800px)' : {
43+ maxWidth : "100%" ,
44+ '@media (max-width: 800px)' : {
4545 display : "flex" ,
46- 'flex-direction' : "column" ,
47- 'overflow-x' : "hidden" ,
46+ flexDirection : "column" ,
47+ overflowX : "hidden" ,
4848 margin : "2rem 5% 0 5%" ,
4949 }
5050 }
Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+ import { AppContextProvider } from "../context/AppContext" ;
3+ import SkillCategoryEditPage from "./SkillCategoryEditPage" ;
4+ import { BrowserRouter } from "react-router-dom" ;
5+
6+ it ( "renders correctly" , ( ) => {
7+ snapshot (
8+ < AppContextProvider >
9+ < BrowserRouter >
10+ < SkillCategoryEditPage />
11+ </ BrowserRouter >
12+ </ AppContextProvider >
13+ ) ;
14+ } ) ;
You can’t perform that action at this time.
0 commit comments