Skip to content

test: add unit tests for isCompactedEvent and createCompactedEvent#400

Closed
nuthalapativarun wants to merge 1 commit into
google:mainfrom
nuthalapativarun:test/compacted-event
Closed

test: add unit tests for isCompactedEvent and createCompactedEvent#400
nuthalapativarun wants to merge 1 commit into
google:mainfrom
nuthalapativarun:test/compacted-event

Conversation

@nuthalapativarun

Copy link
Copy Markdown
Contributor

Please ensure you have read the contribution guide before creating a pull request.

Link to Issue or Description of Change

Adds unit tests for core/src/events/compacted_event.ts, which had no test coverage:

  • isCompactedEvent — 4 cases: valid CompactedEvent, plain Event, event missing the isCompacted field, and event where isCompacted is false
  • createCompactedEvent — 5 cases: isCompacted flag is set to true, startTime/endTime/compactedContent are carried through, base Event defaults are merged (id, invocationId, actions), author and content params are respected, and the created event satisfies the isCompactedEvent type guard

Testing Plan

Unit Tests:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.
✓ core/test/events/compacted_event_test.ts (9 tests) 3ms
Test Files: 1 passed (1)
     Tests: 9 passed (9)

Manual End-to-End (E2E) Tests:
Pure unit tests with no dependencies on external services.

Checklist

  • Read CONTRIBUTING.md
  • Self-reviewed code
  • Commented hard-to-understand areas
  • Added tests proving fix/feature works
  • Unit tests pass locally
  • Manually tested end-to-end
  • Dependent changes merged/published

@nuthalapativarun

Copy link
Copy Markdown
Contributor Author

Closing in favour of the consolidated PR #413, as requested by @kalenkevich. All changes from this PR are included there.

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.

1 participant