// test/priority.test.js window.testPriority = async function() { const { ____RefreshState_Internal_Force_Full_Scan_Only_In_Extreme_Performance_Scenarios, $, NewState } = ApigoState; console.log('Testing directive priorities...'); // Test $if vs $text (if should hide text) document.body.innerHTML = '
'; const state = NewState({ hide: false, msg: 'visible' }); document.documentElement._thisObj = { state }; ____RefreshState_Internal_Force_Full_Scan_Only_In_Extreme_Performance_Scenarios(document.documentElement); if ($('#prio-test').textContent !== 'visible') throw new Error('Basic visibility failed'); state.hide = true; await new Promise(r => setTimeout(r, 10)); if ($('#prio-test')) throw new Error('Priority $if failed: node should be removed'); console.log('priority.js tests passed'); return true; }