?? ?? ??? ?????? CSS- ?? (??? ??? ??? ?? ??? ??????)? ?? ?? ?? ???? ????. ??? ??? ?????
??? ?? ???-??? ?? ??? ????? ?????. ??? ???????? ?? ??? ?????? ?? ??? ?????? ????.
???? ????? ?? ??? ???????? ???? ?? ? ????.
???? ? ?? ?? ? ?????????. ???, ?? ??? ???????? ???? ??? ??? ?????. ?? ??? ?? ??? ?? ???? ?? ?? ????? ?? ?? ????.
??? ?? ??? -Library? ???? ?? ? ??? ? ?? ?? ???? ???? ? ??? ?? ????. ??? ???? ?? ? ? ????.
git ?? https://github.com/kinsomicrote/todoapp-test.git
????? ??? ???? ??????.
## ?? ?? ??-Dev React-Testing-Library Jest-Dom ## npm NPM ??-?? ?? ?? ???-???-?? ?? -MOD
Jest? ? ??? ??? ?? ??? ??? ??? ??? ?????. src ?????? __test__
?? ??? ??? App.test.js
?? ? ??? ????.
?? ?? ?????
?? ? ??? ?? ?? ???? ????? ? ??? ???? ??? ? ?? ???? ?? ? ??? ???.
? ???? ?? ???? ?? ?? ??? ? ?? ?? ?? ????. ??? ? ?? ???? ??? ?????. ???? ?? ??? ?? ?? ?? ?? ?????. ??? ??, ???, ?? ?? ?? ???? ???? ?? ??? ?? ??? ?? ?????. ?? ?? ??? ?? ? ?? ??? ????? ????? ??????? ? ???? ?? ???? ??????.
?? ? ???? ??? ???? ??? ? ?? ??????. App.test.js
??? ?? ??? ?? ????????.
'React'?? React React; "React-Testing-Library"?? {render, cleanup} ?? ??; "Jest-Dom/Extend-Expect"?? ??; './app'?? ? ?? ??; Afterach (??); it ( "?? ? ??", () => { const {asfragment} = render (<app></app> ); ?? (asfragment ()). tomatchsnapshot (); });
??? ???? ???? ???? ? ??? ???? ?????. render
?????? ?? ??? ???? ? ?????. afterEach(cleanup)
???? ? ? ??? ? ??? ?? ? ???? ??? ?? cleanup
?????.
asFragment
???? ?? ?? ??? DocumentFragment
????. ?? ?? ?? ? ?? ?? ?? ? ??? ?????.
???? ???? ?? ?? ????? ?????.
## ?? ?? ??? ## npm NPM ???
?????, ??? ? ?? ??? ? ?? __tests__
???? ??? __snapshots__
?? ? ???? ?? ?? ?? ?? ?????. ??? ??? App.test.js.snap
??? ??? ?? ?? ??? ????.
// Jest Snapshot v1, https://goo.gl/fbaqlp ???? [`?? ? 1`] =` <documentfragment><div> <div> <div> <h2> Todo? ?????? </h2> </div> </div> <div> <div> </div> </div> <div> <div> ??? ?????? </div> </div> <div> <div> <h3> ??? </h3> <ul data-test=""> <li> <div> ??? ???? ?? </div> </li> <li> <div> ????? ?????? ?? </div> </li> </ul> </div> </div> </div> </documentfragment> `;;
?? DOM ??? ???? ??????
?? ?????? ?? ????? ?? ??? ? ????? ???? ? ? ??? ???? ????. ? ?? ?? ????? ??? ? ??? ??????? ????.?? ?????? ????? ??? ?????? (<ul></ul>
) ??? ??? ??????. ??? ??? 2? ?? ??? ?????.
( '?? TODO ??? ?????', () => { const {getByTestId} = render (<app></app> ); const todolist = getbytestid ( 'todos-ul'); expect (todolist.children.length) .tobe (2); });
? ?? ? ???? getByTestId
???? App
?? ???? ??? ID? ?????. ?? ?? todos-ul
??? ??? todoList
??????. ??? 2? ???????.
???? ?? ?? ???? ???? ?? ??? ?? ?? ? ? ??? ???? ???? ??? ? ??? ??????. ????? ? ?????.
- ?? ??? ?????
- ?? ??? ?? ?? ?????
- ?? ???? ??????
- ?? ??? ?? 2 ???? ?? ? ?? ????? ?????.
??? ??? ??? ?? ????! ??? ? ?? ??? ?????.
??? ???? ????? ??! ?? ?? ? ?? ??? ? ??? ???.
?, ??. ??
?, ??? ?????! ??? ?????. ?? ??? ???. ? ? ??? :
it ( '?? ??', () => { const {getBytestid, fireevent} = render (<app></app> ); ?? = '??? ?????'; const todoinputeLement = getByTestId ( 'todo-input'); TODOINPUTELEMENT.VALUE = ??; fireeevent.change (todoinputelement); expling (todoinputeLement.value) .tobe ( 'legr react'); });
getByTestId
???? ?? ?????? ??? ID? ?? ? ??????. ?? ?? ??? ???? ??? "Learn React"? ???? ?? ??? ??? ????. ???? ??? ID? ???? ?? ??? ?? ?? ??? ?? ?? ? ? ?? ???? ??????. ? ??? ?? ? ?, ?? ??? ?? ??? "??? ?????"?? ?????.
??? ??? ??? ?????? ?? ??? ??? ??? ?????!
????, ??? ? ? ??? ?? ? ? ??? ??????. ??? ????? ??? ? ??? ?? ???? ??? ?? ??, ? ????? ????? ??? ???????.
?? ??? ?? ?? ? ?? ??? ????? ??? ?????. getByText
???? ??? ?? ??? ??? ?? ? ? ????. ??? "Add Task"? DOM ??? ?? ???? ????? ??? ? ? ??? ?? ? ? ??????.
????? ?? ??? ?? ?? (?? ??)? ?? 3? ??? ?????. ?? ?? ??? ??? ???? ???? ?????.
It ( '??? TODO ?? ??', () => { const {getBytext, getBytestid, fireevent} = render (<app></app> ); const todoinputeLement = getByTestId ( 'todo-input'); const todolist = getbytestid ( 'todos-ul'); TODOINPUTELENT.VALUE = 'LEARN REACT'; fireeevent.change (todoinputelement); fireeevent.click (getByText ( 'Add Task')); expect (todolist.children.length) .tobe (3); });
?? ????
??? React?? ????? ? ?? ?? ?????
?? React Application?? React-Testing-Library? ??? ? ? ????. ??? ??? ?? ???? ???? ??? ????? ???? ?? ?? ????. Kent C. Dodds??? ????? Frontend Masters (?? ??)?? ???? ?? ?? ??? ???, ?? ?? ???-??? INS? ?????.
?, ??? REACT? ??? ??? ?????. ?? ?? ???? ???, ?? ?? ?????? ??? ?? ? ??? ??? ????. ?? ????? ?? ??? ???? ???????.
? ??? React Testing Library? ?????? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

CSS?? ????? ??? ? ?? ??? ????. 1. HTML ? CSS? ?? ??? ?????? ???? ?? ???? ?? ???? ??????. 2. ?? ??? ??? ?? ???? ???? ?? ?? ??? ?? ?? ??? ??????. 3. ??? ????? ???? JavaScript? ?? ???? ?????? ??? ?????. ? ?? ??? ??? ??? ????? ?? ??, ??, ??? ? ?? ???? ?? ?? ?? ??? ???? ?????.

CSS ???? ??? ? ??? ??? ????? ???? ??? ???? ???? ?? ?? ???? ????? ???????. 1. Flexbox ? ??? ??? ?? ???? ??? ??, ?? : ??? ?? ? ????? ??? ????. 2. Caniuse ?? ?? ?? ??? ??????. 3. -webkit-, -moz-, -ms-, -o- ? ?? ???? ???? ???? ?????. 4. AutoPrefixer? ???? ???? ???? ???? ?? ????. 5. ?? ????? ????? PostCSS? ???? BrowsersList? ??????. 6. ?? ? ???? ???? ?????. 7. Modernizr ?? ??? ??? ????? ??? ? ????. 8. ?? ????? ???? ?? ? ??? ????.

themaindifferencesbetweendisplay : ???, ??, andinline-blockinhtml/cssarelayoutbehavior, spaceusage ? stylingcontrol.1.inlineElementsFlowWithText, do n'tStartonnewlines, ingorewidth/height, andonlyapplyhorizontalpadding/margins —IdealforIneTeTexting

CSS? ?? ?? ??? ??? ??? ???? ???? SVG? ???? ?? ???, ?? ????, ??? ?? ?? ??? ?? ???? ??????. ??? ??? ????. 1. ?, ??, ??? ?? ?? ??? ?? ??? ?????. 2. ?? ?? ? ??? ???? ??? ? ????. 3. ?????? ?? ?? ?? ?? ????? ???? ?? ??? ?? ? ? ????. 4. ???? ???? ??? ??? ??? ????? ?? ? ??? ????. ???? ???? ?? ?? ?? : ? (50pxatcenter) ? ??? ?? ?? : ??? (50%0%, 100 0%, 0%)? ?? ????. ????

??? ?? ???? ???? ??? ??, ?? ??? ??? ? ? ????? ??? ??? ???? ???? ? ? ?? ? ? ????. 1. CSS ?? : ?? ??? ???? ???? ?? ??; 2. ????? ?? ?? ?? ???? ?? ?? ??? ??? ? ????. 3. ?? ??? ??? ??? ??? ?? ?? ???? ????????. 4. ??? ????? ??? ???? ?? ? ??? ??? ?? ??? ?? ?? ??? ????? ???? ?? ????.

CSS? ???? ?? ? ???? ???? ??? ?? ??? ?? ?? ?? ? ? ????. 1. Max width : 100% ? ?? : Auto? ???? ???? ??? ????? ???? ??? ??? ? ??????. 2. HTML? SRCSET ? ?? ??? ???? ?? ??? ??? ??? ??? ???????????. 3. ?? ?? ? ?? ??? ???? ??? ??? ? ?? ?????? ??????. ? ??? ?? ???? ?? ???? ???? ???? ????????.

?? ????? CSS ?? ??? ????? ?? ?? ??? ??, ?? ?? ?? ??, Flexbox ? ??? ???? ?? ?? ? ?? CSS ??? ????? ??? ???? ???? ?? ????? ??? ?????. 1. ?? ??? ??? ???? ????. ???? CSSRESET ?? NALLER.CSS? ???? ?? ???? ???? ????. 2. IE? ?? ??? ?? ?? ?? ??? ????. ?? ?? : ?? ? ???? ??? ??? ???? ?? ????. 3. Flexbox ? Grid? Edge Case ?? Old ???? ??? ?????. ? ?? ??? ? AutopRefixer ??; 4. ?? CSS ?? ??? ???? ????. Caniuse? ???? ?? ?????????.

CSS ??? ??? ?? ?? ?? ? ?? ? ?? ??? ?? ????. 1.px? ?? ??? ????? ?? ??? ??? ?? ??? ?????. 2.EM? ?? ????, ?? ?? ??? ??? ?? ?? ???? ??, REM? ?? ??? ???? ? ????? ??? ????? ?????. 3.VW/VH? ?? ? ???? ??? ??? ??? ??????? ?? ???? ?????? ???????. 4. ??? ?? ?? ? ??, ?? ?? ?? ? ??? ???? ???? ???????. ???? ??? ???? ??? ? ?? ??? ???? ? ????.
