test: check-sizes measures text and control heights per size mode (T8)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
// Saves a size mode on the logged-in user's account (needs the redmine_tonalmine plugin).
|
||||
// No size resets the account to the default appearance.
|
||||
export async function setSize(page, size) {
|
||||
const status = await page.evaluate(async (body) => {
|
||||
const headers = { 'Content-Type': 'application/json', 'X-Requested-With': 'XMLHttpRequest',
|
||||
'X-CSRF-Token': document.querySelector('meta[name="csrf-token"]').content };
|
||||
return (await fetch('/tonalmine/appearance', { method: 'PUT', headers, body: JSON.stringify(body) })).status;
|
||||
}, size ? { size } : {});
|
||||
if (status !== 204) throw new Error(`could not save size ${size ?? 'default'} (HTTP ${status})`);
|
||||
}
|
||||
Reference in New Issue
Block a user