Skip to content

test: use public chat$new_chat() in restore-reminder test - #325

Merged
simonpcouch merged 1 commit into
mainfrom
fix/chat-test-new-chat
Sep 9, 2026
Merged

simonpcouch merged 1 commit into
mainfrom
fix/chat-test-new-chat

Conversation

@cpsievert

Copy link
Copy Markdown
Collaborator

Closes #324

Summary

shinychat (posit-dev/shinychat#399) made clear() abort when conversation history is enabled, which is the only configuration commons_server() creates — so the restore-reminder test's chat$clear() assertion had no reachable behavior left to exercise. This drops that assertion (the reset path is identical to new_chat()'s, and the agent-level lifecycle is already covered by unit tests in test-commons.R) and replaces the internal controller$new_chat() call with the public chat$new_chat() on the object chat_server() returns. One internal reach remains: firing a restore under testServer requires the history controller (shinychat:::get_session_chat_bookmark_info), since shinychat exposes no public restore trigger; a comment in the test says so.

Verification

testthat::test_file("tests/testthat/test-chat.R") passes against shinychat main (0.5.0, local install from ../shinychat/pkg-r, which includes the clear() guard).

shinychat's clear() now aborts when conversation history is enabled
(the only configuration commons_server() creates), which broke this
test. Drop the clear() assertion since new_chat() covers the same
commons behavior, and replace controller$new_chat() with the public
chat$new_chat() added in posit-dev/shinychat#399.

Closes #324
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Preview deployed to Connect (dogfood.team.pct.posit.it): https://dogfood.team.pct.posit.it/connect/#/apps/d7a36cae-8f27-448b-a478-61b81fbe3942/draft/368971

Deployed from commit aac5a3d.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Preview deployed to Connect (connect.staging.pct.posit.it): https://connect.staging.pct.posit.it/connect/#/apps/ad662e1b-5048-4acc-9ad7-f9478c92274e/draft/2722

Deployed from commit aac5a3d.

@jat255

jat255 commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

LGTM, but I'd wait for @simonpcouch

@jat255
jat255 added this pull request to stack #326 September 9, 2026 03:22
@simonpcouch
simonpcouch merged commit 499a164 into main Sep 9, 2026
4 checks passed
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Cleaned up 1 preview bundle(s) on https://dogfood.team.pct.posit.it: 368971

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Cleaned up 1 preview bundle(s) on https://connect.staging.pct.posit.it: 2722

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.

R CMD check is red on main: shinychat now refuses chat$clear() when history is enabled

3 participants