fix(accounts): isolate action menu interactions
Stop double-click events on account action buttons before they reach editable table rows. Simplify the account menu heading to a single hoster and access-type label without empty identity separators, and cover both interaction and formatting paths.
This commit is contained in:
@@ -794,6 +794,7 @@ describe("account workspace", () => {
|
||||
checkbox.props.onChange();
|
||||
row.props.onDoubleClick();
|
||||
actionButton.props.onClick({ stopPropagation: () => {}, currentTarget: { getBoundingClientRect: () => ({ right: 20, bottom: 30 }) } });
|
||||
actionButton.props.onDoubleClick({ stopPropagation: () => calls.push("action-double-click-stopped") });
|
||||
|
||||
expect(calls).toEqual([
|
||||
`select:${rowId}:false`,
|
||||
@@ -801,10 +802,21 @@ describe("account workspace", () => {
|
||||
`select:${rowId}:false`,
|
||||
`toggle:${rowId}`,
|
||||
`edit:${rowId}`,
|
||||
`context:${rowId}`
|
||||
`context:${rowId}`,
|
||||
"action-double-click-stopped"
|
||||
]);
|
||||
});
|
||||
|
||||
it("formats the account action heading as hoster and access type without a dangling marker", () => {
|
||||
const api = settingsModel as typeof settingsModel & {
|
||||
formatAccountContextHeading?: (hoster: string, mode: string) => string;
|
||||
};
|
||||
|
||||
expect(api.formatAccountContextHeading).toBeTypeOf("function");
|
||||
expect(api.formatAccountContextHeading?.("Debrid-Link", "API")).toBe("Debrid-Link | API");
|
||||
expect(api.formatAccountContextHeading?.("Mega-Debrid", "Web-Login")).toBe("Mega-Debrid | Web-Login");
|
||||
});
|
||||
|
||||
it("shows the selected account count", () => {
|
||||
const model = workspaceModel();
|
||||
const tree = AccountWorkspace({
|
||||
|
||||
Reference in New Issue
Block a user