Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mercihabam committed Sep 26, 2024
1 parent 30fbe06 commit 63ebbfa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/core/output_modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ protected function output() {
$res .= '<script type="text/javascript" src="'.WEB_ROOT.sprintf("%ssite.js", $rel_name).'"></script>';
$res .= '<script type="module">';
foreach (glob($name.'js_modules' . DIRECTORY_SEPARATOR . '*.js') as $js) {
$res .= "\n".'import "./'.WEB_ROOT.str_replace(APP_PATH, '', $js).'";';
$res .= 'import "./'.WEB_ROOT.str_replace(APP_PATH, '', $js).'";';
}
$res .= '</script>';
}
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/modules/core/output_modules_debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function test_page_js_debug() {
$this->assertEquals(array('<script type="text/javascript" src="vendor/twbs/bootstrap/dist/js/bootstrap.bundle.min.js"></script><script type="text/javascript" src="third_party/cash.min.js"></script><script type="text/javascript" src="third_party/resumable.min.js"></script><script type="text/javascript" src="third_party/ays-beforeunload-shim.js"></script><script type="text/javascript" src="third_party/jquery.are-you-sure.js"></script><script type="text/javascript" src="third_party/sortable.min.js"></script><script type="text/javascript" src="third_party/forge.min.js"></script><script type="text/javascript" src="modules/core/site.js"></script>'), $res->output_response);
$test->handler_response = array('encrypt_ajax_requests' => true, 'router_module_list' => array('imap'));
$res = $test->run();
$this->assertEquals(array('<script type="text/javascript" src="vendor/twbs/bootstrap/dist/js/bootstrap.bundle.min.js"></script><script type="text/javascript" src="third_party/cash.min.js"></script><script type="text/javascript" src="third_party/resumable.min.js"></script><script type="text/javascript" src="third_party/ays-beforeunload-shim.js"></script><script type="text/javascript" src="third_party/jquery.are-you-sure.js"></script><script type="text/javascript" src="third_party/sortable.min.js"></script><script type="text/javascript" src="third_party/forge.min.js"></script><script type="text/javascript" src="modules/core/site.js"></script><script type="text/javascript" src="modules/imap/site.js"></script>'), $res->output_response);
$this->assertEquals(array('<script type="text/javascript" src="vendor/twbs/bootstrap/dist/js/bootstrap.bundle.min.js"></script><script type="text/javascript" src="third_party/cash.min.js"></script><script type="text/javascript" src="third_party/resumable.min.js"></script><script type="text/javascript" src="third_party/ays-beforeunload-shim.js"></script><script type="text/javascript" src="third_party/jquery.are-you-sure.js"></script><script type="text/javascript" src="third_party/sortable.min.js"></script><script type="text/javascript" src="third_party/forge.min.js"></script><script type="text/javascript" src="modules/core/site.js"></script><script type="text/javascript" src="modules/imap/site.js"></script><script type="module">import "./modules/imap/js_modules/Hm_Message.js";</script>'), $res->output_response);
}
/**
* @preserveGlobalState disabled
Expand Down

0 comments on commit 63ebbfa

Please sign in to comment.