diff --git a/src/workflows/SnapshotActionMenu.test.tsx b/src/workflows/SnapshotActionMenu.test.tsx
index b89d0cf326..fe72fe693b 100644
--- a/src/workflows/SnapshotActionMenu.test.tsx
+++ b/src/workflows/SnapshotActionMenu.test.tsx
@@ -7,6 +7,18 @@ import SnapshotActionMenu from 'src/workflows/SnapshotActionMenu';
const mockOnDelete = jest.fn();
describe('snapshot action menu', () => {
+ it('honors the disabled prop', async () => {
+ // Act
+ await act(async () => {
+ render();
+ });
+
+ // Assert
+ const snapshotActionMenu = screen.getByRole('button', { name: 'Snapshot action menu' });
+
+ expect(snapshotActionMenu).toHaveAttribute('disabled');
+ expect(snapshotActionMenu).toHaveAttribute('aria-disabled');
+ });
it('renders and enables the menu buttons if you are the snapshot owner', async () => {
// Arrange
const user: UserEvent = userEvent.setup();
@@ -16,13 +28,18 @@ describe('snapshot action menu', () => {
render();
});
- await user.click(screen.getByRole('button', { name: 'Snapshot action menu' }));
+ const snapshotActionMenu = screen.getByRole('button', { name: 'Snapshot action menu' });
+
+ await user.click(snapshotActionMenu);
const deleteSnapshotButton = screen.getByRole('button', { name: 'Delete snapshot' });
await user.pointer({ target: deleteSnapshotButton });
// Assert
+ expect(snapshotActionMenu).not.toHaveAttribute('disabled');
+ expect(snapshotActionMenu).toHaveAttribute('aria-disabled', 'false');
+
expect(deleteSnapshotButton).toBeInTheDocument();
expect(deleteSnapshotButton).toHaveAttribute('aria-disabled', 'false');
expect(screen.queryByRole('tooltip')).not.toBeInTheDocument();