diff --git a/oxlint-suppressions.json b/oxlint-suppressions.json index 96e1398801d..0995e0da8ff 100644 --- a/oxlint-suppressions.json +++ b/oxlint-suppressions.json @@ -284,14 +284,6 @@ "count": 1 } }, - "web/app/components/app/app-publisher/sections.tsx": { - "jsx_a11y/click-events-have-key-events": { - "count": 1 - }, - "jsx_a11y/no-static-element-interactions": { - "count": 1 - } - }, "web/app/components/app/configuration/config-prompt/__tests__/index.spec.tsx": { "jsx_a11y/click-events-have-key-events": { "count": 1 diff --git a/web/app/components/app/app-publisher/__tests__/sections.spec.tsx b/web/app/components/app/app-publisher/__tests__/sections.spec.tsx index 2c66a5c9cd9..02b6f1f6102 100644 --- a/web/app/components/app/app-publisher/__tests__/sections.spec.tsx +++ b/web/app/components/app/app-publisher/__tests__/sections.spec.tsx @@ -1,6 +1,7 @@ /* oxlint-disable typescript/no-explicit-any */ import type { ReactNode } from 'react' import { fireEvent, screen } from '@testing-library/react' +import userEvent from '@testing-library/user-event' import { AccessMode } from '@/models/access-control' import { renderWithConsoleQuery as render } from '@/test/console/query-data' import { AppModeEnum } from '@/types/app' @@ -85,19 +86,30 @@ describe('app-publisher sections', () => { expect(handleRestore).toHaveBeenCalled() }) - it('should expose the access control warning when subjects are missing', () => { + it('should expose the access control warning and open access settings from the keyboard', async () => { + const user = userEvent.setup() + const onClick = vi.fn() + render( , ) expect(screen.getByText(/(?:^|\.)publishApp\.notSet(?=$|:)/)).toBeInTheDocument() expect(screen.getByText(/(?:^|\.)publishApp\.notSetDesc(?=$|:)/)).toBeInTheDocument() + + const accessButton = screen.getByRole('button', { + name: /accessControlDialog\.accessItems\.specific/, + }) + accessButton.focus() + await user.keyboard('{Enter}') + + expect(onClick).toHaveBeenCalledOnce() }) it('should render the publish update action when the draft has not been published yet', () => { diff --git a/web/app/components/app/app-publisher/sections.tsx b/web/app/components/app/app-publisher/sections.tsx index 95f1b532095..4067bf22095 100644 --- a/web/app/components/app/app-publisher/sections.tsx +++ b/web/app/components/app/app-publisher/sections.tsx @@ -88,12 +88,12 @@ export const AccessModeDisplay = ({ mode }: { mode?: keyof typeof ACCESS_MODE_MA return ( <> - -
+ + {t(($) => $[`accessControlDialog.accessItems.${label}`], { ns: 'app' })} -
+
) } @@ -219,22 +219,23 @@ export const PublisherAccessSection = ({ {t(($) => $['publishApp.title'], { ns: 'app' })}

-
-
+ -
+ {!isAppAccessSet && ( -

+ {t(($) => $['publishApp.notSet'], { ns: 'app' })} -

+ )} -
- -
-
+ + + + {!isAppAccessSet && (

{t(($) => $['publishApp.notSetDesc'], { ns: 'app' })}