* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+
import * as React from 'react';
import Link from '../../components/common/Link';
-import { Button } from '../../components/controls/buttons';
import Modal from '../../components/controls/Modal';
+import { Button } from '../../components/controls/buttons';
import { isInput } from '../../helpers/keyboardEventHelpers';
import { KeyboardKeys } from '../../helpers/keycodes';
import { translate } from '../../helpers/l10n';
{ keys: ['a'], action: 'assign' },
{ keys: ['m'], action: 'assign_to_me' },
{ keys: ['i'], action: 'severity' },
- { keys: ['c'], action: 'comment' },
{ keys: ['ctrl', '+', 'enter'], action: 'submit_comment' },
{ keys: ['t'], action: 'tags' },
],
expect(screen.getByText('issue.transition.confirm')).toBeInTheDocument();
expect(screen.getByText('issue.transition.resolve')).toBeInTheDocument();
- // Open comment popup on key press 'c'
- await user.keyboard('c');
-
- expect(screen.getByText('issue.comment.formlink')).toBeInTheDocument();
- await user.keyboard('{Escape}');
-
// Open tags popup on key press 't'
await user.keyboard('t');
} else if (event.key === KeyboardKeys.KeyM && this.props.issue.actions.includes('assign')) {
event.preventDefault();
return this.handleAssignement('_me');
- } else if (event.key === KeyboardKeys.KeyC) {
- event.preventDefault();
- return this.handleIssuePopupToggle('comment');
} else if (event.key === KeyboardKeys.KeyT) {
event.preventDefault();
return this.handleIssuePopupToggle('edit-tags');
} else if (event.key === KeyboardKeys.KeyI) {
event.preventDefault();
return togglePopup('set-severity');
- } else if (event.key === KeyboardKeys.KeyC) {
- event.preventDefault();
- return togglePopup('comment');
} else if (event.key === KeyboardKeys.KeyT) {
event.preventDefault();
return togglePopup('edit-tags');
expect(ui.setAssigneeBtn(/Organa/).get()).toBeInTheDocument();
await ui.pressDismissShortcut();
- await ui.pressCommentShortcut();
- expect(ui.commentTextInput.get()).toBeInTheDocument();
- await ui.pressDismissShortcut();
-
await ui.pressTagsShortcut();
expect(ui.tagsSearchInput.get()).toBeInTheDocument();
await ui.pressDismissShortcut();
await user.keyboard(`{${KeyboardKeys.KeyI}}`);
});
},
- async pressCommentShortcut() {
- await act(async () => {
- await user.keyboard(`{${KeyboardKeys.KeyC}}`);
- });
- },
async pressTagsShortcut() {
await act(async () => {
await user.keyboard(`{${KeyboardKeys.KeyT}}`);
KeyA = 'a',
KeyM = 'm',
KeyI = 'i',
- KeyC = 'c',
KeyT = 't',
KeyS = 's',
KeyQuestionMark = '?',