test(server): cover the local-flavor widget-serving routes#115
Merged
Conversation
The local flavor serves the Aurora Glass widget (the host page at / with the auth token injected, and the @smooai/chat-widget bundle at /chat-widget.iife.js) but had NO test — a re-vendor (e.g. #113) can compile via include_str! yet serve a broken/wrong bundle. Adds tests/widget_serving.rs (tower oneshot, no network): the bundle is served with the right content-type + the Aurora Glass markers (<smooth-agent-chat>, SmoothAgentChat global, inlined send_message client); the host page substitutes the token placeholder + mounts the element; and both routes are 404 unless the flavor opts in via with_widget (K8s/Lambda never serve them). 3 tests, all green. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01U7Mn93HpqhSgEmX6tRdPAv
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The local deployment flavor serves the Aurora Glass widget — the host page at `/` (auth token injected) and the `@smooai/chat-widget` bundle at `/chat-widget.iife.js` — but had no test. A re-vendor of that bundle (e.g. #113, which re-pointed it at `@smooai/[email protected]`) compiles via `include_str!` even if the served asset is broken or the wrong package.
Adds `tests/widget_serving.rs` (drives the real axum router via `tower::ServiceExt::oneshot`, no network):
3 tests, all green.
🤖 Generated with Claude Code