Skip to content

Added tests for the Templates flow - #97

Merged
jasonstratton merged 1 commit into
DynamoDS:masterfrom
Chloepeg:DYN-9702-Templates-tests
Jul 1, 2026
Merged

Added tests for the Templates flow#97
jasonstratton merged 1 commit into
DynamoDS:masterfrom
Chloepeg:DYN-9702-Templates-tests

Conversation

@Chloepeg

Copy link
Copy Markdown
Contributor

Purpose

This PR addresses DYN-9702.

After DYN-9702 was merged, additional tests were still needed for the Templates functionality added to PageRecent.tsx and for the new TemplatesContext.tsx file. This PR adds that missing tests coverage.

This update adds focused test coverage for the template support introduced in DYN-9702. The tests cover how template data is received from Dynamo, exposed through TemplatesContext, normalized for use by the existing grid/table components, and displayed/opened from PageRecent.

changes :

Added additional TemplatesContext unit tests for:

  • registering the Dynamo template callback
  • receiving template data from Dynamo
  • normalizing date to DateModified
  • defaulting missing Author and Description
  • cleaning up the callback when the provider is removed

Extended PageRecent unit tests for:

  • rendering templates from context
  • switching the Templates section from grid view to list view
  • opening a clicked template through openFile

Declarations

Check these if you believe they are true

Release Notes

Added unit test coverage for the Dynamo Home Templates flow introduced in DYN-9702.

Reviewers

@zeusongit
@DynamoDS/eidos

FYIs

@dnenov
@johnpierson
@jnealb
@jasonstratton

TemplatesContext is covered for registering and cleaning up the Dynamo callback, updating context from received template data, and normalizing template fields (date to DateModified, default Author/Description). PageRecent is covered for rendering templates from context, switching the Templates section to list view, and opening a template row through the shared openFile flow

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds missing unit test coverage for the Templates flow introduced in DYN-9702, validating that template data provided by the Dynamo host is exposed via TemplatesContext and correctly rendered/operated on in the Recent page Templates section.

Changes:

  • Expanded TemplatesContext tests to cover callback registration, data updates, normalization (date/Author/Description), and cleanup on unmount.
  • Extended PageRecent tests to validate templates rendering from context, switching the Templates section to list view, and opening a template via openFile.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/unit/TemplatesContext.test.tsx Adds unit tests for Templates callback lifecycle and normalization behavior.
tests/unit/Recent/PageRecent.test.tsx Adds unit tests ensuring Templates are rendered, can switch to list view, and open on click.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jasonstratton jasonstratton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM - Approved and I will merge

@jasonstratton
jasonstratton merged commit e1f7e7e into DynamoDS:master Jul 1, 2026
11 checks passed
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.

3 participants