File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/LiveDevelopment/BrowserScripts Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 2929 * exported functions.
3030 */
3131function RemoteFunctions ( config = { } ) {
32-
32+ // we load this file in unit test window and dont want it to do anything unexpected in the unit test runner context
33+ const isUnitTestWindow = window . Phoenix && window . Phoenix . isTestWindow ;
3334 const GLOBALS = {
3435 // given to internal elements like info box, options box, image gallery and all other phcode internal elements
3536 // to distinguish between phoenix internal vs user created elements
@@ -5626,15 +5627,15 @@ function RemoteFunctions(config = {}) {
56265627 // init the hot corner after the DOM is ready
56275628 if ( document . readyState === 'loading' ) {
56285629 document . addEventListener ( 'DOMContentLoaded' , ( ) => {
5629- if ( ! _hotCorner ) {
5630+ if ( ! _hotCorner && ! isUnitTestWindow ) {
56305631 _hotCorner = new HotCorner ( ) ;
56315632 _hotCorner . updateState ( config . mode === 'preview' ) ;
56325633 }
56335634 } ) ;
56345635 } else {
56355636 // or if the DOM is already ready then init directly
56365637 setTimeout ( ( ) => {
5637- if ( ! _hotCorner ) {
5638+ if ( ! _hotCorner && ! isUnitTestWindow ) {
56385639 _hotCorner = new HotCorner ( ) ;
56395640 _hotCorner . updateState ( config . mode === 'preview' ) ;
56405641 }
You can’t perform that action at this time.
0 commit comments