@@ -23,31 +23,29 @@ describe("SSR Display Page", () => {
2323 expect ( html ) . toContain ( '<div id="root">' )
2424 expect ( html ) . toContain ( name ) // Title should contain paste name
2525
26- // LIMITATION: SSR fails in Workers test environment due to @heroui /input-otp module resolution issue
27- // See: UPSTREAM_ISSUE.md and INPUT_OTP_ISSUE.md
28- // In test environment , SSR falls back to CSR (returns static display.html)
29- // In production, SSR works correctly and embeds serialized data
26+ // LIMITATION: SSR fails in Workers test environment due to module resolution
27+ // The input-otp package cannot be resolved in Workers runtime during dynamic import
28+ // In production , SSR works correctly. In tests, it falls back to CSR.
29+ // This is a known limitation of the Cloudflare Workers test environment.
3030
31- // Check if SSR succeeded (has serialized data) or fell back to CSR (static HTML )
31+ // Verify the page is functional (either SSR or CSR fallback )
3232 const hasSerializedData = html . includes ( "__PASTE_DATA__" )
3333
3434 if ( hasSerializedData ) {
3535 // SSR succeeded - verify data is properly embedded
3636 expect ( html ) . toContain ( "application/json" )
3737 expect ( html ) . toContain ( "window.__PASTE_DATA__" )
3838
39- // Extract and verify serialized data
4039 const match = / < s c r i p t i d = " _ _ P A S T E _ D A T A _ _ " t y p e = " a p p l i c a t i o n \/ j s o n " > ( .* ?) < \/ s c r i p t > / . exec ( html )
4140 expect ( match ) . toBeTruthy ( )
4241
4342 const data = JSON . parse ( match ! [ 1 ] ) as { name : string ; content : string ; metadata : unknown }
4443 expect ( data . name ) . toBe ( name )
45- expect ( data . content ) . toBeTruthy ( ) // Base64 encoded content
44+ expect ( data . content ) . toBeTruthy ( )
4645 expect ( data . metadata ) . toBeTruthy ( )
4746 } else {
48- // SSR failed, fell back to CSR - this is expected in test environment
49- // Verify CSR fallback works correctly
50- expect ( html ) . toContain ( "display" ) // Should have display.js
47+ // CSR fallback - verify it loads correctly
48+ expect ( html ) . toContain ( "display" )
5149 expect ( html ) . toContain ( ".js" )
5250 }
5351 } )
0 commit comments