This repository was archived by the owner on May 13, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 11import * as utils from '@site/src/utils' ;
2- import { LOCALHOST_APP_ID , DEFAULT_WS_SERVER } from '../constants' ;
2+ import { LOCALHOST_APP_ID , DEFAULT_WS_SERVER , VERCEL_DEPLOYMENT_APP_ID } from '../constants' ;
33const {
44 getAccountsFromSearchParams,
55 getAppId,
@@ -158,10 +158,18 @@ describe('Get Server Config', () => {
158158 jest . clearAllMocks ( ) ;
159159 } ) ;
160160
161+ describe ( 'Given we are in SSR ( no browser object ) ' , ( ) => {
162+ it ( 'Should return default ws server url and appId while SSR' , ( ) => {
163+ jest . spyOn ( utils , 'getIsBrowser' ) . mockReturnValueOnce ( false ) ;
164+ const serverConfig = getServerConfig ( ) ;
165+ expect ( serverConfig . appId ) . toEqual ( LOCALHOST_APP_ID ) ;
166+ expect ( serverConfig . serverUrl ) . toEqual ( DEFAULT_WS_SERVER ) ;
167+ } ) ;
168+ } ) ;
169+
161170 describe ( 'Given we are in Browser' , ( ) => {
162171 jest . spyOn ( utils , 'getIsBrowser' ) . mockReturnValue ( true ) ;
163-
164- it ( 'Should return default ws server url and vercel deployment appId in LOCALHOST ' , ( ) => {
172+ it ( 'Should return default ws server url and localhost appId' , ( ) => {
165173 const serverConfig = getServerConfig ( ) ;
166174 expect ( serverConfig . appId ) . toEqual ( LOCALHOST_APP_ID ) ;
167175 expect ( serverConfig . serverUrl ) . toEqual ( DEFAULT_WS_SERVER ) ;
You can’t perform that action at this time.
0 commit comments