Skip to content

Conversation

@annieli555
Copy link
Contributor

@annieli555 annieli555 commented Jan 5, 2026

Context

Add additional baseline authenticated tests using the new authentication flow introduced in f464e74. Also adds some test helpers to create a new (empty) project, create an new (empty) character, and interact with Firestore.

The new tests include (as discussed in #195 (comment)):

  • Ensuring that a project is saved to the (emulated) cloud after being edited
  • Ensuring that a custom character is saved to the (emulated) cloud of being edited

I also added a test to verify that character references in projects are updated when a character name changes, as this was not tested when I added the feature in #817, due to authenticated tests not being supported at the time. But now it is supported!

Related issues

Verification

Checklist

  • Verify tests pass in CI Investigate test timeout issue (this seems to be an existing bug, recent PRs are also encountering test timeouts)

Copy link
Collaborator

@amyjko amyjko left a comment

Choose a reason for hiding this comment

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

This is a great new set of tests! And much needed.

The timeout is curious. Maybe it's imposed on PR workflows run by people not collaborators on a project? The docs say that timeouts should be 60 minutes.

@annieli555 annieli555 marked this pull request as ready for review January 10, 2026 02:35
@annieli555 annieli555 force-pushed the 195-authenticated-tests branch from 11b9696 to 1ed7eb7 Compare January 10, 2026 03:22
@annieli555
Copy link
Contributor Author

Hi @amyjko ! Made a couple more updates to get tests passing, and the PR is now ready for review!

  1. I realized that the tests were hanging on a prompt to enter an SMTP_PASSWORD (which I encountered locally as well), so I get around this by appending an empty SMTP_PASSWORD to the functions env file during setup.
  2. I also saw that the test in project.spec.ts was failing. It turns out this recent commit added starter code to new projects, so the docs tile becomes collapsed (because of this check). This regression wasn't caught since tests were timing out from the problem described in 1.

Let me know if you'd like me to extract either of these changes into separate PRs! Also related to 2, I wonder if this is actually unintended behavior? It seems like the docs tile would still be helpful to see upon creating a new project.

@annieli555 annieli555 requested a review from amyjko January 10, 2026 03:31
Copy link
Collaborator

@amyjko amyjko left a comment

Choose a reason for hiding this comment

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

This is create. The new Firebase interactions are clean and clear, the updates to the fixtures are more robust, and most importantly, we now have some critical basic tests for project and character saving. I particularly appreciate the reuse of the Firestore libraries in the API to ensure robust and precise confirmation of document writes, rather than a flaky reliance on interface updates. I'm going to approve as is.

@amyjko amyjko merged commit 225124f into wordplaydev:main Jan 10, 2026
3 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.

Support authenticated end to end tests

2 participants