Skip to content

เรียนรู้การเขียนเทส UI ตั้งแต่ unit, integration จนถึง visual regression

License

Notifications You must be signed in to change notification settings

React-in-Thai/learn-react-testing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

เครื่องมือ

  • Storybook (UI documentation)
  • React testing library
  • Chromatic (Visual testing service)

การติดตั้ง

git clone https://github.com/React-in-Thai/learn-react-testing.git
cd learn-react-testing
yarn

แบบฝึกหัด

📹 วิดีโอประกอบ

Avatar

  1. สร้าง Avatar component ที่มี properties ดังนี้
  • src: รูปที่ใช้แสดง (หากไม่ใส่ src มาให้แสดงเป็น ตัวอักษร)
  • children: ตัวอักษร หรือ ไอคอน ที่แสดง หากไม่มี src
  • size: sm | lg ขนาดของ Avatar
  • แสดงผลถูกต้องตามหลัก accessibility
    • role
    • aria-label
  1. เขียนเทสที่ครอบคลุม (เช็คได้จาก code coverage)
  2. แสดงผลลงใน storybook
  3. เปิดใช้งาน chromatic
  4. ทดลองเปิด PR (pull request) และ setup github check ในการรัน unit test และ visual test (chromatic)
    • หากเทสไม่ผ่าน ไม่สามารถ merge ได้

AvatarGroup ตัวอย่าง https://mui.com/components/avatars/#grouped

About

เรียนรู้การเขียนเทส UI ตั้งแต่ unit, integration จนถึง visual regression

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published