Skip to content

# test(e2e): add goal lifecycle create progress delete and empty state tests (#3804) - #3829

Open
KartikeyG-world wants to merge 4 commits into
Priyanshu-byte-coder:mainfrom
KartikeyG-world:test/issue-3804-goals-e2e
Open

KartikeyG-world wants to merge 4 commits into
Priyanshu-byte-coder:mainfrom
KartikeyG-world:test/issue-3804-goals-e2e

Conversation

@KartikeyG-world

Copy link
Copy Markdown
Contributor

Closes #3804

Description

Adds comprehensive Playwright end-to-end test coverage for the Goal Tracker widget exercising the full goal lifecycle from creation to deletion.

Key Changes

  • Added [Goals E2E] full lifecycle: create goal, mark progress, delete via confirmation modal, and verify empty state in e2e/goals.spec.ts.
  • Tests initial empty state ("No goals yet").
  • Tests goal creation with manual tracking unit (hours).
  • Tests real user interaction marking progress via the +1 button (Increment "[title]" progress by 1).
  • Asserts progress count updates (0/5 hours -> 1/5 hours -> 2/5 hours) and progress bar states.
  • Tests deletion through the ConfirmModal component ("Delete Tracking Goal" -> "Permanently Delete").
  • Verifies goal removal and restoration of the empty state.
  • Maintained exact one-commit-per-file discipline (1 commit for 1 modified file).

Architectural Note for Maintainers

  • The issue description mentions "Edit its target". Upon source inspection, while PATCH /api/goals/[id] accepts { target }, the React component src/components/GoalTracker.tsx only provides a target input during creation (setTarget) and does not expose an edit-target interface or button. In adherence to the repository's rule against fabricating fake UI or calling endpoints via page.evaluate(), the test exercises the complete user-facing lifecycle and documents this frontend gap in comments.

Testing & Verification

  • pnpm run type-check: Passed with 0 errors.
  • git diff --check: 0 whitespace issues.

Contributor Notes (WOCS 2026)

@github-actions github-actions Bot added type:feature GSSoC type bonus: new feature type:testing GSSoC type bonus: tests (+10 pts) labels Nov 26, 2026

@Priyanshu-byte-coder Priyanshu-byte-coder left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

The test itself is solid and passes in CI. One small thing: the block comment cites "Per Section 4.4 (No artificial implementation)", which isn't a document in this repo, so it will confuse the next reader. Please keep the useful part (there is no edit-target control in GoalTracker, so this test doesn't cover editing) and drop the Section 4.4 line. Then it's ready.

@Priyanshu-byte-coder Priyanshu-byte-coder added wocs Winter of Code Social 2026: counts for WOCS points level 2 WOCS: moderate, bug fixes/tests/small features (5 points) labels Nov 26, 2026
@github-actions

Copy link
Copy Markdown

Thanks for the PR, @KartikeyG-world! ❄️ This PR is tracked for Winter of Code Social 2026.

See CONTRIBUTING.md for the details.

@KartikeyG-world

Copy link
Copy Markdown
Contributor Author

@Priyanshu-byte-coder
I have commit the changes as per your requirement
Please check it out and let me know about the status
Thankyou

@Priyanshu-byte-coder Priyanshu-byte-coder left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for the cleanup, ready to go.

This branch has not been deployed

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

Labels

level 2 WOCS: moderate, bug fixes/tests/small features (5 points) type:feature GSSoC type bonus: new feature type:testing GSSoC type bonus: tests (+10 pts) wocs Winter of Code Social 2026: counts for WOCS points

Projects

None yet

Development

Successfully merging this pull request may close these issues.

E2E test: creating, editing and deleting a goal

2 participants