22 * @jest -environment jsdom
33 */
44
5- import { hydrateForceLoadedStores } from '../src/pro/ClientSideRenderer.ts' ;
5+ import { hydrateImmediateHydratedStores } from '../src/pro/ClientSideRenderer.ts' ;
66import { getRailsContext } from '../src/context.ts' ;
77
88// Mock the getRailsContext function
@@ -22,14 +22,14 @@ describe('Pro License Validation', () => {
2222 consoleSpy . mockRestore ( ) ;
2323 } ) ;
2424
25- describe ( 'hydrateForceLoadedStores ' , ( ) => {
25+ describe ( 'hydrateImmediateHydratedStores ' , ( ) => {
2626 it ( 'should warn and return early when no Pro license is detected' , async ( ) => {
2727 getRailsContext . mockReturnValue ( { rorPro : false } ) ;
2828
29- const result = await hydrateForceLoadedStores ( ) ;
29+ const result = await hydrateImmediateHydratedStores ( ) ;
3030
3131 expect ( consoleSpy ) . toHaveBeenCalledWith (
32- "[REACT ON RAILS] The 'force_loading ' feature requires a React on Rails Pro license. " +
32+ "[REACT ON RAILS] The 'immediate_hydration ' feature requires a React on Rails Pro license. " +
3333 'Please visit https://shakacode.com/react-on-rails-pro to get a license.' ,
3434 ) ;
3535 expect ( result ) . toBeUndefined ( ) ;
@@ -39,7 +39,7 @@ describe('Pro License Validation', () => {
3939 getRailsContext . mockReturnValue ( { rorPro : true } ) ;
4040
4141 // Test that it doesn't warn when license is valid (no force-load elements present)
42- const result = hydrateForceLoadedStores ( ) ;
42+ const result = hydrateImmediateHydratedStores ( ) ;
4343
4444 expect ( consoleSpy ) . not . toHaveBeenCalled ( ) ;
4545 expect ( result ) . toBeDefined ( ) ;
@@ -48,10 +48,10 @@ describe('Pro License Validation', () => {
4848 it ( 'should return early when no rails context is available' , async ( ) => {
4949 getRailsContext . mockReturnValue ( null ) ;
5050
51- const result = await hydrateForceLoadedStores ( ) ;
51+ const result = await hydrateImmediateHydratedStores ( ) ;
5252
5353 expect ( consoleSpy ) . toHaveBeenCalledWith (
54- "[REACT ON RAILS] The 'force_loading ' feature requires a React on Rails Pro license. " +
54+ "[REACT ON RAILS] The 'immediate_hydration ' feature requires a React on Rails Pro license. " +
5555 'Please visit https://shakacode.com/react-on-rails-pro to get a license.' ,
5656 ) ;
5757 expect ( result ) . toBeUndefined ( ) ;
0 commit comments