First round of test

This commit is contained in:
2026-05-24 01:07:39 +02:00
parent e2da4773bd
commit 2d898f6818
5 changed files with 94 additions and 59 deletions
+19 -1
View File
@@ -49,11 +49,29 @@ export function isInitialized() {
return _isInitialized;
}
/**
* Conditional base class — test environment lacks foundry globals.
*/
const _MenuAppBase =
typeof foundry !== 'undefined' &&
foundry.applications?.api?.ApplicationV2
? foundry.applications.api.ApplicationV2
: class _FallbackMenuApp {
static DEFAULT_OPTIONS = {};
get rendered() { return this._rendered ?? false; }
set rendered(v) { this._rendered = v; }
get element() { return this._element ?? null; }
set element(v) { this._element = v; }
async render() { this._rendered = true; }
async close() { this._rendered = false; }
};
/**
* PlayerPrivacyPanelMenu - Wrapper for Foundry settings menu.
* When instantiated by Foundry, it creates a PlayerPrivacyPanel with the current user as target.
* Extends ApplicationV2 so it passes Foundry's registerMenu validation.
*/
export class PlayerPrivacyPanelMenu {
export class PlayerPrivacyPanelMenu extends _MenuAppBase {
/**
* @param {object} [options] - Foundry options (unused, but required by settings menu API)
*/