Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ describe('SnippetInfoDropdown', () => {
it('should render the dropdown trigger button', () => {
render(<SnippetInfoDropdown snippet={mockSnippet} />)

expect(screen.getByRole('button')).toBeInTheDocument()
expect(screen.getByRole('button', { name: 'common.operation.more' })).toBeInTheDocument()
})

it('should render nothing without snippet create or management permission', () => {
Expand All @@ -149,7 +149,7 @@ describe('SnippetInfoDropdown', () => {
mockWorkspacePermissionKeys = ['snippets.create_and_modify']

const { unmount } = render(<SnippetInfoDropdown snippet={mockSnippet} />)
await user.click(screen.getByRole('button'))
await user.click(screen.getByRole('button', { name: 'common.operation.more' }))

expect(screen.getByText('snippet.menu.editInfo')).toBeInTheDocument()
expect(screen.getByText('snippet.menu.exportSnippet')).toBeInTheDocument()
Expand All @@ -158,7 +158,7 @@ describe('SnippetInfoDropdown', () => {
unmount()
mockWorkspacePermissionKeys = ['snippets.management']
render(<SnippetInfoDropdown snippet={mockSnippet} />)
await user.click(screen.getByRole('button'))
await user.click(screen.getByRole('button', { name: 'common.operation.more' }))

expect(screen.queryByText('snippet.menu.editInfo')).not.toBeInTheDocument()
expect(screen.queryByText('snippet.menu.exportSnippet')).not.toBeInTheDocument()
Expand All @@ -177,7 +177,7 @@ describe('SnippetInfoDropdown', () => {
)

render(<SnippetInfoDropdown snippet={mockSnippet} />)
await user.click(screen.getByRole('button'))
await user.click(screen.getByRole('button', { name: 'common.operation.more' }))
await user.click(screen.getByText('snippet.menu.editInfo'))

expect(screen.getByTestId('create-snippet-dialog')).toBeInTheDocument()
Expand Down Expand Up @@ -216,7 +216,7 @@ describe('SnippetInfoDropdown', () => {

render(<SnippetInfoDropdown snippet={mockSnippet} />)

await user.click(screen.getByRole('button'))
await user.click(screen.getByRole('button', { name: 'common.operation.more' }))
await user.click(screen.getByText('snippet.menu.exportSnippet'))

await waitFor(() => {
Expand All @@ -236,7 +236,7 @@ describe('SnippetInfoDropdown', () => {

render(<SnippetInfoDropdown snippet={mockSnippet} />)

await user.click(screen.getByRole('button'))
await user.click(screen.getByRole('button', { name: 'common.operation.more' }))
await user.click(screen.getByText('snippet.menu.exportSnippet'))

await waitFor(() => {
Expand All @@ -257,7 +257,7 @@ describe('SnippetInfoDropdown', () => {

render(<SnippetInfoDropdown snippet={mockSnippet} />)

await user.click(screen.getByRole('button'))
await user.click(screen.getByRole('button', { name: 'common.operation.more' }))
await user.click(screen.getByText('snippet.menu.deleteSnippet'))

expect(screen.getByText('snippet.deleteConfirmTitle')).toBeInTheDocument()
Expand Down
5 changes: 4 additions & 1 deletion web/app/components/app-sidebar/snippet-info/dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ const SnippetInfoDropdown = ({ snippet }: SnippetInfoDropdownProps) => {
return (
<>
<DropdownMenu open={open} onOpenChange={setOpen}>
<DropdownMenuTrigger className="action-btn action-btn-m size-6 rounded-md text-text-tertiary data-popup-open:bg-state-base-hover data-popup-open:text-text-secondary">
<DropdownMenuTrigger
aria-label={t(($) => $['operation.more'], { ns: 'common' })}
className="action-btn action-btn-m size-6 rounded-md text-text-tertiary data-popup-open:bg-state-base-hover data-popup-open:text-text-secondary"
>
<span aria-hidden className="i-ri-more-fill size-4" />
</DropdownMenuTrigger>
<DropdownMenuContent placement="bottom-end" sideOffset={4} popupClassName="w-[180px] p-1">
Expand Down