mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-20 19:16:08 +00:00
ae3dfa2eb7
- The phone's admin sections follow the desktop sidebar: the same groups (Users, Configuration, Maintenance) in its dropdown, Security and Services instead of one Settings section, and live flights and booking mails beside the addons they configure. An old ?tab=settings link still opens Security. - Passkey login and the 2FA rule sit with the other ways in; the passkey card keeps the domain, and a managed install no longer shows the danger zone. - MAdminSelect replaces every native select on the admin screens: TREK's own field or row pill that opens the picker sheet (permissions, backup schedule, invite trip, plugin settings). - Explanations wait behind an info mark (MHintLabel), as on the desktop: admin rows and fields, the settings rows' new `hint`, addon and provider rows. - Permissions are one line each with the level as a pill; addon rows lose the type badge their heading already names; settings buttons no longer wrap. - "Require 2FA" in every language; admin.tabs.settings is unused and gone.
23 lines
1.0 KiB
TypeScript
23 lines
1.0 KiB
TypeScript
import { screen, within } from '@testing-library/react';
|
|
import type { UserEvent } from '@testing-library/user-event';
|
|
|
|
/**
|
|
* Picks an option of the phone's own select (MAdminSelect): taps the combobox
|
|
* named `name`, then the option labelled `option` in the picker sheet it opens.
|
|
*/
|
|
export async function pickMobileOption(user: UserEvent, name: string, option: string): Promise<void> {
|
|
await user.click(screen.getByRole('combobox', { name }));
|
|
const sheet = await screen.findByRole('dialog', { name });
|
|
await user.click(within(sheet).getByRole('button', { name: option }));
|
|
}
|
|
|
|
/** The labels a phone select offers, read from its open picker sheet. */
|
|
export async function mobileOptionLabels(user: UserEvent, name: string): Promise<string[]> {
|
|
await user.click(screen.getByRole('combobox', { name }));
|
|
const sheet = await screen.findByRole('dialog', { name });
|
|
return within(sheet)
|
|
.getAllByRole('button')
|
|
.filter((button) => button.getAttribute('aria-label') === null)
|
|
.map((button) => button.textContent ?? '');
|
|
}
|