Skip to content

Conversation

@kdeakinstructure
Copy link
Contributor

@kdeakinstructure kdeakinstructure commented Dec 17, 2025

Test Plan

  1. Run the new E2E tests in TodoE2ETest.kt:
    • testNewTodoE2E - Tests filtering by date ranges, favorite courses, and item interactions
    • testNewTodoPastFiltersE2E - Tests past date filters (last week, 2/3/4 weeks ago, today)
    • testToDoCalendarEventsAndPersonalToDosE2E - Tests calendar events and personal to-dos visibility, swipe gestures, and navigation
  2. Verify all assertions pass and items are displayed/filtered correctly
  3. Verify favorite courses seeding works properly
  4. Verify swipe gestures work for marking items as done
  5. Verify calendar navigation from date badges

Changes

  • Added comprehensive E2E tests for the new To Do page covering:
    • Future date filters (today, this week, next week, 2/3/4 weeks)
    • Past date filters (today, this week, last week, 2/3/4 weeks ago)
    • Calendar events and personal to-dos visibility
    • Swipe gestures for marking items as done
    • Favorite courses filter
    • Completed items filter
  • Fixed favorite courses dataseeding bug where courses weren't being properly marked as favorites for students
  • Implemented PlannerAPI for seeding calendar to-dos
  • Added PlannerNoteApiModel for planner notes
  • Enhanced ToDoListPage, ToDoFilterPage, and CalendarScreenPage with additional test methods
  • Removed deprecated TodoPage class and cleaned up StudentTest.kt
  • Extended ToDoListInteractionTest with swipe gesture tests

refs: MBL-19569

affects: Student

release note: none

  • I have tested this code in light and dark mode
  • I have tested this code in portrait and landscape
  • I have run all relevant accessibility checks
  • Run E2E tests

Fix favorite courses dataseeding process.

refs: MBL-19569
affects: Student
release note:
…nd todos, past item filters).

Fix dataseeding issue with favorite course filter logic.
Implement PlannerAPI for seeding calendar todos.
Add and modify some apimodels.
Add many page objects methods.

refs: MBL-19569
affects: Student
release note:
…udentTest.

refs: MBL-19569
affects: Student
release note:
Copy link

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

This PR significantly enhances the To-Do feature with comprehensive E2E testing and improved filter functionality. The implementation looks solid overall with good test coverage and proper use of Compose testing patterns.

✅ Strengths

  • Comprehensive test coverage: Three new E2E tests thoroughly cover the To-Do list functionality including filters, calendar events, personal to-dos, and swipe gestures
  • Well-structured tests: Clear test organization with descriptive logging at each step following the PREPARATION/STEP/ASSERTION pattern
  • Good use of Compose testing: Proper use of test tags, semantic matching, and the page object pattern
  • API integration: New PlannerAPI properly integrated with consistent patterns
  • Accessibility improvements: Better semantic descriptions and test tag organization for UI components

⚠️ Issues Found

  • Critical Logic Error (SeedApi.kt:145) - Unused lambda in favorite courses seeding. The lambda wraps the logic but is never executed, causing the favorite courses feature to silently fail. This needs immediate attention.
  • Code cleanup needed - Several commented-out code sections that should be removed (CalendarScreenPage.kt:84)
  • Formatting inconsistencies - Extra whitespace and blank lines that don't match project style

📋 Code Quality Observations

Positive:

  • Consistent use of data seeding patterns for test setup
  • Proper handling of calendar-specific edge cases (Sunday checks)
  • Good separation of concerns with dedicated filter page objects
  • Appropriate use of Kotlin idioms and coroutines

Minor Improvements:

  • Consider more specific test tags for better test reliability
  • Some test assertions could be more descriptive about expected vs actual states

🔒 Security & Performance

No security concerns identified. The changes are test-focused with proper data isolation. Performance should be unaffected as changes are primarily in test code.

🧪 Test Coverage

Excellent test coverage with three comprehensive E2E tests covering:

  1. Main To-Do functionality with various date range filters
  2. Past date filters with edge case handling
  3. Calendar events, personal to-dos, and swipe gestures

Recommendation

Fix the critical lambda issue in SeedApi.kt before merging, as it will cause the favorite courses feature to not work correctly in tests. The other issues are minor cleanup items that should also be addressed for code quality.

Great work on the comprehensive testing! The filter functionality looks well-designed and thoroughly tested.

@OptIn(ExperimentalTestApi::class)
fun assertItemDisplayed(itemTitle: String) {
composeTestRule.waitUntilExactlyOneExists(hasText(itemTitle), 5000)
// composeTestRule.waitUntilExactlyOneExists(hasTestTag("eventTitle") and hasText(itemTitle), 5000)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commented code should be removed. The new implementation using waitUntil with a custom condition is better than the commented waitUntilExactlyOneExists approach. Clean up the commented line.

CoursesApi.addCourseToFavorites(coursesList[it].id,teachersList[0].token)
// Seed favorite courses for all students
(0 until minOf(request.favoriteCourses, coursesList.size)).forEach { courseIndex ->
studentsList.forEach { student ->
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This lambda appears to be unused. The lambda creates a scope but its result isn't assigned or used. This looks like a logic error - the favorite course logic should be executing immediately, not wrapped in an unused lambda.

Suggested fix:

(0 until minOf(request.favoriteCourses, coursesList.size)).forEach { courseIndex ->
    studentsList.forEach { student ->
        coursesList[courseIndex].isFavorite = true
        addFavoriteCourses(
            CoursesApi.addCourseToFavorites(
                coursesList[courseIndex].id,
                student.token
            )
        )
    }
}

return CanvasNetworkAdapter.retrofitWithToken(token).create(CalendarEventService::class.java)
}


Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra blank line added here. While not critical, it's inconsistent with the previous code style. Consider removing it to maintain consistency.

}
) {
Checkbox(
Checkbox(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra space before Checkbox component. Remove for consistent formatting.

@github-actions
Copy link

github-actions bot commented Dec 17, 2025

📊 Code Coverage Report

✅ Student

  • PR Coverage: 42.91%
  • Master Coverage: 42.91%
  • Delta: +0.00%

✅ Teacher

  • PR Coverage: 25.48%
  • Master Coverage: 25.48%
  • Delta: +0.00%

⚠️ Pandautils

  • PR Coverage: 22.49%
  • Master Coverage: 22.49%
  • Delta: -0.00%

📈 Overall Average

  • PR Coverage: 30.29%
  • Master Coverage: 30.30%
  • Delta: -0.00%

@github-actions
Copy link

github-actions bot commented Dec 17, 2025

🧪 Unit Test Results

✅ 📱 Student App

  • Tests: 1241 total, 0 failed, 0 skipped
  • Duration: 0.000s
  • Success Rate: 100%

✅ 🌅 Horizon

  • Tests: 449 total, 0 failed, 0 skipped
  • Duration: 36.372s
  • Success Rate: 100%

✅ 📦 Submodules

  • Tests: 2472 total, 0 failed, 0 skipped
  • Duration: 54.991s
  • Success Rate: 100%

📊 Summary

  • Total Tests: 4162
  • Failed: 0
  • Skipped: 0
  • Status: ✅ All tests passed!

Last updated: Wed, 17 Dec 2025 21:21:02 GMT

@github-actions
Copy link

github-actions bot commented Dec 17, 2025

Student Install Page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants