进行了一些小修复
This commit is contained in:
@@ -127,6 +127,8 @@ test('the legacy runtime owns lazySizes while AKSRT consumers share one image-at
|
||||
const scripts = read('src/Core/ScriptsPart1c.php');
|
||||
const routeScripts = read('src/Core/ScriptsPart1b.php');
|
||||
const builder = read('tools/build-public-assets.mjs');
|
||||
const loader = read('assets/js/runtime/loader.js');
|
||||
const searchShell = read('inc/helpers/header/aksrt-header-menu-search.php');
|
||||
const pagination = read('assets/js/core/pagination.js');
|
||||
const widgets = read('assets/widgets/frontend.js');
|
||||
|
||||
@@ -134,7 +136,9 @@ test('the legacy runtime owns lazySizes while AKSRT consumers share one image-at
|
||||
assert.match(bridge, /window\.aksrtGetLazyImageAttr = function/);
|
||||
assert.match(builder, /assets\/js\/lazy-image-attr\.js/);
|
||||
assert.match(builder, /assets\/js\/rehydrate\.js/);
|
||||
assert.match(scripts, /assets\/js\/build\/public\.js'[\s\S]*?\['loader_js'\]/);
|
||||
assert.match(builder, /assets\/js\/runtime\/main\.min\.js/);
|
||||
assert.doesNotMatch(loader, /['"]main['"]\s*:|tbquire\(\[['"]main['"]\]\)/);
|
||||
assert.match(scripts, /assets\/js\/build\/public\.js'[\s\S]*?\['jquery'\]/);
|
||||
for (const file of ['pay-vip.js', 'order-center.js', 'page-navs.js', 'credits.js']) {
|
||||
const blocks = enqueueBlocksFor(routeScripts, file);
|
||||
assert.ok(blocks.length > 0, `${file} must be enqueued`);
|
||||
@@ -147,6 +151,10 @@ test('the legacy runtime owns lazySizes while AKSRT consumers share one image-at
|
||||
assert.match(runtime, /var bg = _this\.attr\('data-bg'\)[\s\S]*?background-image/);
|
||||
assert.match(runtime, /var lazyload_action = _this\.attr\('lazyload-action'\)/);
|
||||
assert.match(runtime, /if \(_this\.attr\('remote-box'\)\)[\s\S]*?_this\.click\(\)/);
|
||||
assert.match(searchShell, /'type'\s*=>\s*'click'/);
|
||||
assert.match(runtime, /aksrt:remote-loaded/);
|
||||
assert.doesNotMatch(runtime, /action:\s*'get_current_user'/);
|
||||
assert.match(runtime, /var cases = jQuery\('\.vanilla-tilt:not\(\.is-initialized\)'\);[\s\S]*?if \(!cases\.length\)[\s\S]*?tbquire\(\['tilt'\]/);
|
||||
assert.doesNotMatch(pagination, /IntersectionObserver|new Image\(/);
|
||||
assert.doesNotMatch(widgets, /IntersectionObserver/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user