Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
mbondyra committed Nov 2, 2020
1 parent c9c6651 commit 14625f1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions x-pack/plugins/lens/public/drag_drop/drag_drop.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,10 @@ describe('DragDrop', () => {
component.find('[data-test-subj="lnsDragDrop-reorderableDrop"]').at(2).simulate('dragover');
expect(component.find('[data-test-subj="lnsDragDrop"]').at(0).prop('style')).toEqual({});
expect(component.find('[data-test-subj="lnsDragDrop"]').at(1).prop('style')).toEqual({
transform: 'translateY(-4px)',
transform: 'translateY(-8px)',
});
expect(component.find('[data-test-subj="lnsDragDrop"]').at(2).prop('style')).toEqual({
transform: 'translateY(-4px)',
transform: 'translateY(-8px)',
});

component.find('[data-test-subj="lnsDragDrop-reorderableDrop"]').at(2).simulate('dragleave');
Expand Down
6 changes: 4 additions & 2 deletions x-pack/plugins/lens/public/drag_drop/drag_drop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -312,17 +312,19 @@ const getKeyboardReorderMessageMoved = (
prevPosition: number
) =>
i18n.translate('xpack.lens.dragDrop.elementMoved', {
defaultMessage: `You have moved the item ${itemLabel} from position {prevPosition} to position {position}`,
defaultMessage: `You have moved the item {itemLabel} from position {prevPosition} to position {position}`,
values: {
itemLabel,
position,
prevPosition,
},
});

const getKeyboardReorderMessageLifted = (itemLabel: string, position: number) =>
i18n.translate('xpack.lens.dragDrop.elementLifted', {
defaultMessage: `You have lifted an item ${itemLabel} in position {position}`,
defaultMessage: `You have lifted an item {itemLabel} in position {position}`,
values: {
itemLabel,
position,
},
});
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/lens/public/drag_drop/providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export function ReorderProvider({
<EuiPortal>
<EuiScreenReaderOnly>
<div>
<p id="lnsDragDrop-reorderAnnouncement" aria-live="assertive">
<p id="lnsDragDrop-reorderAnnouncement" aria-live="assertive" aria-atomic={true}>
{state.keyboardReorderMessage}
</p>
<p id={`lnsDragDrop-reorderInstructions-${id}`}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ describe('LayerPanel', () => {

const group = component
.find(EuiFormRow)
.findWhere((e) => e.prop('error') === 'Required dimension');
.findWhere((e) => e.prop('error')?.props?.children === 'Required dimension');

expect(group).toHaveLength(1);
});

Expand Down

0 comments on commit 14625f1

Please sign in to comment.