switchAppearance = async (page, appearance) => {
	try {
		let current = await getAppearance(page);
		if (current === appearance) return;

		await openKebabMenu(page);
		// Switch appearance a max of 2 times (since there's 3 options)
		for (let i = 0; i < 2; i++) {
			await page.getByRole('menuitem', { name: 'Appearance' }).click();
			current = await getAppearance(page, { closeKebabMenu: false });
			if (current === appearance) break;
		}

		if (current !== appearance) {
			throw new Error(`Appearance ${current} doesnt match ${appearance} after switching`);
		}
	} catch (e) {
		console.error('switchAppearance failed', e);
		throw e;
	} finally {
		await closeKebabMenu(page);
	}
}
@param {import('@playwright/test').Page} page
@param {'light' | 'dark' | 'system'} appearance