fix(runtime): use compatible WordPress jQuery
This commit is contained in:
1 parent
d64c4cf1b4
commit
4a12de38cb
3 files changed
+9
-9
No files matched your search
@@ -37,16 +37,16 @@ const header = join([
|
||||
'inc/helpers/aksrt-header-userbox.php',
|
||||
]);
|
||||
|
||||
test('the public dependency graph is the single local runtime stack', () => {
|
||||
assert.match(scripts, /wp_deregister_script\('jquery'\)/);
|
||||
assert.match(scripts, /jquery\.min\.js'[\s\S]*?'1\.9\.1'/);
|
||||
test('the public dependency graph uses WordPress jQuery with the local runtime stack', () => {
|
||||
assert.match(scripts, /wp_enqueue_script\('jquery'\)/);
|
||||
assert.doesNotMatch(scripts, /wp_deregister_script\('jquery'\)/);
|
||||
assert.doesNotMatch(scripts, /jquery\.min\.js'[\s\S]*?'1\.9\.1'/);
|
||||
assert.match(scripts, /bootstrap\.min\.css'[\s\S]*?'3\.4\.1'/);
|
||||
assert.match(scripts, /fontawesome5'[\s\S]*?all\.min\.css'[\s\S]*?'5\.15\.4'/);
|
||||
assert.match(scripts, /main\.min\.css/);
|
||||
assert.match(scripts, /loader\.js'[\s\S]*?\['jquery', 'bootstrap'\]/);
|
||||
assert.match(read('assets/js/runtime/loader.js'), /tbquire\(\['main'\]\)/);
|
||||
for (const file of [
|
||||
'assets/js/runtime/libs/jquery.min.js',
|
||||
'assets/js/runtime/libs/bootstrap.min.js',
|
||||
'assets/css/bootstrap.min.css',
|
||||
'assets/fontawesome5/css/all.min.css',
|
||||
|
||||
@@ -40,10 +40,12 @@ test('published post content reaches the front submit editor unchanged', () => {
|
||||
assert.match(editor, /wp_editor\(\(string\) \$ctx\['current_content'\], 'post_content', \$editor_settings\);/);
|
||||
});
|
||||
|
||||
test('front submit uses the registered local jQuery runtime', () => {
|
||||
test('front submit uses the WordPress-managed jQuery runtime', () => {
|
||||
const source = read('src/Core/ScriptsPart1b.php');
|
||||
|
||||
assert.match(source, /wp_register_script\('jquery', \$base_uri \. '\/assets\/js\/runtime\/libs\/jquery\.min\.js', \[\], '1\.9\.1', false\)/);
|
||||
assert.match(source, /wp_enqueue_script\('jquery'\)/);
|
||||
assert.doesNotMatch(source, /wp_deregister_script\('jquery'\)/);
|
||||
assert.doesNotMatch(source, /wp_register_script\('jquery'/);
|
||||
assert.doesNotMatch(source, /jquery-migrate/);
|
||||
|
||||
const page = read('templates/pages/page-submit.php');
|
||||
|
||||
Reference in new issue
Block a user