diff --git a/tests/navigation/legacy-navigation-contract.test.cjs b/tests/navigation/legacy-navigation-contract.test.cjs index 44b8811e..1d8e4661 100644 --- a/tests/navigation/legacy-navigation-contract.test.cjs +++ b/tests/navigation/legacy-navigation-contract.test.cjs @@ -38,13 +38,19 @@ const header = join([ ]); 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'/); - 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'\]\)/); + const buildTool = read('tools/build-public-assets.mjs'); + + assert.match(scripts, /registered\['jquery'\]->deps = \['jquery-core'\]/); + assert.match(scripts, /wp_enqueue_script\('jquery'\)/); + assert.doesNotMatch(scripts, /wp_deregister_script\('jquery'\)/); + assert.match(scripts, /'aksrt-runtime'/); + assert.match(scripts, /assets\/js\/build\/public\.js/); + assert.match(buildTool, /assets\/css\/bootstrap\.min\.css/); + assert.match(buildTool, /assets\/fontawesome5\/css\/all\.min\.css/); + assert.match(buildTool, /assets\/css\/main\.min\.css/); + assert.match(buildTool, /assets\/js\/runtime\/libs\/bootstrap\.min\.js/); + assert.match(buildTool, /assets\/js\/runtime\/loader\.js/); + assert.match(buildTool, /assets\/js\/runtime\/main\.min\.js/); for (const file of [ 'assets/js/runtime/libs/jquery.min.js', 'assets/js/runtime/libs/bootstrap.min.js', @@ -146,16 +152,17 @@ test('mobile navigation is one setting-driven left right or top drawer', () => { test('guest account member VIP and publish contracts share reference header DOM', () => { const userboxCss = read('assets/css/frontend/header-userbox.css'); + const buildTool = read('tools/build-public-assets.mjs'); assert.match(header, /is_user_logged_in\(\)/); assert.match(header, /sub-user-box aksrt-header-userbox/); assert.match(header, /signin-loader|signin/); assert.match(header, /get_payment_vip_settings/); - assert.match(header, /nav_user_newposts_btn/); + assert.match(header, /navbar-newposts/); assert.match(header, /nav_newposts/); - assert.match(header, /navbar-form navbar-right navbar-but/); + assert.match(header, /navbar-form navbar-right/); assert.match(header, /pay-vip/); - assert.match(scripts, /\$enqueue_module\('header-userbox'\)/); + assert.match(buildTool, /assets\/css\/frontend\/header-userbox\.css/); assert.match(userboxCss, /\.aksrt-header-userbox \.user-info > \.avatar/); assert.match(userboxCss, /\.aksrt-header-wallet/); assert.match(userboxCss, /\.aksrt-header-checkin/);