Skip to content

L02-BugFree/frontend

Repository files navigation

NexTime Mobile 📱

NexTime là ứng dụng hỗ trợ quản lý lịch trình nhóm, tạo checklist, và tìm giờ rảnh chung. Xây dựng bằng React Native + Expo.

Test & Coverage

📊 CI & Quality Badges

Test & Coverage Quality Gate Status Coverage Maintainability Rating

Lưu ý: Thay YOUR_GITHUB_USERNAMEYOUR_REPO_NAME bằng thông tin GitHub thực tế.


🚀 Chạy test locally

Yêu cầu hệ thống

  • Node.js ≥ 18
  • npm ≥ 9

Cài đặt dependencies

cd mobile
npm install --legacy-peer-deps

Chạy tests và xem coverage

cd mobile
npm run test

Sau khi chạy xong:

  • Kết quả test hiển thị trực tiếp trên Terminal
  • Coverage report (HTML): mobile/test-report/index.html
  • Coverage raw data: mobile/coverage/lcov.info (dùng cho SonarCloud)

Coverage yêu cầu

Metric Ngưỡng
Lines ≥ 70%

🗂️ Cấu trúc test

mobile/
├── HomeScreen.tsx            # Màn hình chính
├── HomeScreen.test.tsx       # 4 test cases
├── OnboardingScreen.tsx      # Màn hình giới thiệu
├── OnboardingScreen.test.tsx # 5 test cases
└── jest.config.js            # Cấu hình Jest + coverage

Danh sách test cases

HomeScreen.test.tsx (4 tests):

  1. renders without crashing – Kiểm tra màn hình load thành công
  2. renders create schedule button – Kiểm tra nút tạo lịch trình tồn tại
  3. handles create schedule button press without errors – Ấn nút không gây crash
  4. calls onBack when logout button is pressed – Kiểm tra callback khi ấn Quay lại

OnboardingScreen.test.tsx (5 tests):

  1. renders without crashing – Kiểm tra màn hình load thành công
  2. renders login and register buttons – Kiểm tra cả 2 nút hiển thị
  3. calls onNavigate when login button is pressed – Callback đăng nhập hoạt động
  4. calls onNavigate when register button is pressed – Callback đăng ký hoạt động
  5. handles button presses without errors when no callback provided – Không crash khi không có callback

🏗️ Tech Stack

  • React Native 0.81 + Expo 54
  • NativeWind (TailwindCSS cho React Native)
  • Jest + jest-expo + @testing-library/react-native
  • SonarCloud (Code Quality & Security)
  • GitHub Actions (CI/CD)

📱 Chạy app trên thiết bị

cd mobile
npm start          # Expo Dev Tools + QR Code
npm run android    # Android emulator
npm run ios        # iOS simulator (macOS only)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors