diff --git a/frontend/src/components/common/modals/__snapshots__/deletion-moadal.test.tsx.snap b/frontend/src/components/common/modals/__snapshots__/deletion-moadal.test.tsx.snap
index b8a166cf2..7c0a478b1 100644
--- a/frontend/src/components/common/modals/__snapshots__/deletion-moadal.test.tsx.snap
+++ b/frontend/src/components/common/modals/__snapshots__/deletion-moadal.test.tsx.snap
@@ -1,5 +1,47 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
+exports[`DeletionModal disables deletion when user is not owner 1`] = `
+
{
- it('renders correctly with deletionButtonI18nKey', async () => {
+ beforeEach(async () => {
await mockI18n()
+ })
+
+ afterEach(() => {
+ jest.resetAllMocks()
+ jest.resetModules()
+ })
+
+ it('renders correctly with deletionButtonI18nKey', async () => {
+ mockNoteOwnership('test', 'test')
+ const onConfirm = jest.fn()
+ render(
+
+ testText
+
+ )
+ const modal = await screen.findByTestId('commonModal')
+ expect(modal).toMatchSnapshot()
+ })
+
+ it('disables deletion when user is not owner', async () => {
+ mockNoteOwnership('test2', 'test')
const onConfirm = jest.fn()
render(
diff --git a/frontend/src/components/common/modals/deletion-modal.tsx b/frontend/src/components/common/modals/deletion-modal.tsx
index 524cd5f8f..6da54f863 100644
--- a/frontend/src/components/common/modals/deletion-modal.tsx
+++ b/frontend/src/components/common/modals/deletion-modal.tsx
@@ -3,6 +3,7 @@
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
+import { useIsOwner } from '../../../hooks/common/use-is-owner'
import { cypressId } from '../../../utils/cypress-attribute'
import type { CommonModalProps } from './common-modal'
import { CommonModal } from './common-modal'
@@ -40,6 +41,7 @@ export const DeletionModal: React.FC> = ({
...props
}) => {
useTranslation()
+ const isOwner = useIsOwner()
return (
> = ({
{...props}>
{children}
-