import assert from 'node:assert/strict'; import {shouldAutoStartWidget} from '../src/widgets/cheerpjAutoStart.ts'; // Newly created and historic Workplace widgets must start automatically. assert.equal(shouldAutoStartWidget('ui.cheerpj-workplace',{autoStart:true}),true); assert.equal(shouldAutoStartWidget('ui.cheerpj-workplace',{autoStart:false}),true); assert.equal(shouldAutoStartWidget('ui.cheerpj-workplace',{}),true); // Only an explicitly disabled runtime option stops Workplace autostart. assert.equal(shouldAutoStartWidget('ui.cheerpj-workplace',{manualStartOnly:true,autoStart:true}),false); assert.equal(shouldAutoStartWidget('ui.cheerpj-workplace',{manualStartOnly:false,autoStart:false}),true); // Generic JNLP remains opt-in to avoid unexpected Java program execution. assert.equal(shouldAutoStartWidget('ui.cheerpj',{autoStart:false}),false); assert.equal(shouldAutoStartWidget('ui.cheerpj',{autoStart:true}),true); console.log('CheerpJ autostart policy: 7 assertions passed.');