Skip to content
Merged
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 @@ -123,6 +123,7 @@ const AnnotationActivity = ({
: { ...linkMessage, values: { number: linkValue } };
const tetherProps = {
attachment: 'top right',
className: 'bcs-AnnotationActivity-deleteConfirmationModal',
constraints: [{ to: 'scrollParent', attachment: 'together' }],
targetAttachment: 'bottom right',
};
Expand Down Expand Up @@ -227,7 +228,7 @@ const AnnotationActivity = ({
)}
renderElement={ref => {
return isConfirmingDelete ? (
<div ref={ref} className="bcs-AnnotationActivity-deleteConfirmationModal">
<div ref={ref}>
<DeleteConfirmation
data-resin-component={ACTIVITY_TARGETS.ANNOTATION_OPTIONS}
isOpen={isConfirmingDelete}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { mount } from 'enzyme';
import TetherComponent from 'react-tether';

import AnnotationActivity from '../AnnotationActivity';
import AnnotationActivityMenu from '../AnnotationActivityMenu';
Expand Down Expand Up @@ -288,6 +289,24 @@ describe('elements/content-sidebar/ActivityFeed/annotations/AnnotationActivity',
expect(onDelete).toHaveBeenCalledWith({ id: mockAnnotation.id, permissions });
expect(wrapper.exists(DeleteConfirmation)).toBe(false);
});

test('should apply correct className to TetherComponent for z-index styling', () => {
const item = {
...mockAnnotation,
permissions: { can_delete: true },
};

const wrapper = getWrapper({ item });

const tetherComponent = wrapper.find(TetherComponent);
expect(tetherComponent.exists()).toBe(true);
// Find the TetherComponent that has the delete confirmation modal className
const modalTetherComponent = tetherComponent.findWhere(
node => node.prop('className') === 'bcs-AnnotationActivity-deleteConfirmationModal',
);
expect(modalTetherComponent.exists()).toBe(true);
expect(modalTetherComponent.prop('className')).toBe('bcs-AnnotationActivity-deleteConfirmationModal');
});
});

describe('SelectableActivityCard', () => {
Expand Down