getAppearance = async (page, options = { closeKebabMenu: true }) => {
	try {
		await openKebabMenu(page);

		const textContent = await page.getByRole('menuitem', { name: 'Appearance' }).textContent();
		const appearance = textContent?.split(/\s+/)[1].toLowerCase();
		if (!appearance || !['light', 'dark', 'system'].includes(appearance)) {
			throw new Error(`Invalid appearance ${appearance}`);
		}
		return /** @type {'light' | 'dark' | 'system'} */ (appearance);
	} catch (e) {
		console.error('getAppearance failed', e);
		throw e;
	} finally {
		if (options.closeKebabMenu) {
			await closeKebabMenu(page);
		}
	}
}
@param {import('@playwright/test').Page} page
@param {{ closeKebabMenu?: boolean }} options
@returns {Promise<'light' | 'dark' | 'system'>}