From b0635b3eaf95d29a7cfc9bcf1c793cc852ca6c07 Mon Sep 17 00:00:00 2001 From: Xavier Mouligneau <189600+XavierM@users.noreply.github.com> Date: Fri, 28 Feb 2020 15:49:25 -0500 Subject: [PATCH] fix type + test --- .../case/components/case_view/index.test.tsx | 10 ++-- .../components/user_action_tree/index.tsx | 6 +-- .../user_action_tree/user_action_avatar.tsx | 2 +- .../user_action_tree/user_action_item.tsx | 50 +++++++++---------- .../user_action_tree/user_action_markdown.tsx | 2 +- 5 files changed, 36 insertions(+), 34 deletions(-) diff --git a/x-pack/legacy/plugins/siem/public/pages/case/components/case_view/index.test.tsx b/x-pack/legacy/plugins/siem/public/pages/case/components/case_view/index.test.tsx index e58c6042ff4c9..1539b3de5a0c1 100644 --- a/x-pack/legacy/plugins/siem/public/pages/case/components/case_view/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/case/components/case_view/index.test.tsx @@ -93,14 +93,18 @@ describe('CaseView ', () => { ); expect( wrapper - .find(`[data-test-subj="user-action-1"] [data-test-subj="user-action-avatar"]`) + .find( + `div[data-test-subj="user-action-${data.comments[0].commentId}-avatar"] [data-test-subj="user-action-avatar"]` + ) .first() .prop('name') ).toEqual(data.comments[0].createdBy.fullName); expect( wrapper - .find(`[data-test-subj="user-action-1"] [data-test-subj="user-action-title"] strong`) + .find( + `div[data-test-subj="user-action-${data.comments[0].commentId}"] [data-test-subj="user-action-title"] strong` + ) .first() .text() ).toEqual(data.comments[0].createdBy.username); @@ -108,7 +112,7 @@ describe('CaseView ', () => { expect( wrapper .find( - `[data-test-subj="user-action-1"] [data-test-subj="user-action-content"] [data-test-subj="markdown"]` + `div[data-test-subj="user-action-${data.comments[0].commentId}"] [data-test-subj="markdown"]` ) .first() .prop('source') diff --git a/x-pack/legacy/plugins/siem/public/pages/case/components/user_action_tree/index.tsx b/x-pack/legacy/plugins/siem/public/pages/case/components/user_action_tree/index.tsx index 61c3a85dec4ee..6599151f9d4fd 100644 --- a/x-pack/legacy/plugins/siem/public/pages/case/components/user_action_tree/index.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/case/components/user_action_tree/index.tsx @@ -139,7 +139,7 @@ export const UserActionTree = React.memo( markdown={ ))} diff --git a/x-pack/legacy/plugins/siem/public/pages/case/components/user_action_tree/user_action_avatar.tsx b/x-pack/legacy/plugins/siem/public/pages/case/components/user_action_tree/user_action_avatar.tsx index 635de8cb62410..f3276bd50e72c 100644 --- a/x-pack/legacy/plugins/siem/public/pages/case/components/user_action_tree/user_action_avatar.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/case/components/user_action_tree/user_action_avatar.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { EuiAvatar, EuiFlexItem } from '@elastic/eui'; +import { EuiAvatar } from '@elastic/eui'; import React from 'react'; interface UserActionAvatarProps { diff --git a/x-pack/legacy/plugins/siem/public/pages/case/components/user_action_tree/user_action_item.tsx b/x-pack/legacy/plugins/siem/public/pages/case/components/user_action_tree/user_action_item.tsx index 4ccdc92cca2db..816e500827590 100644 --- a/x-pack/legacy/plugins/siem/public/pages/case/components/user_action_tree/user_action_item.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/case/components/user_action_tree/user_action_item.tsx @@ -34,29 +34,27 @@ export const UserActionItem = ({ markdown, onEdit, userName, -}: UserActionItemProps) => { - return ( - <> - - - - - {isEditable && markdown} - {!isEditable && ( - - - {markdown} - - )} - - - ); -}; +}: UserActionItemProps) => ( + <> + + + + + {isEditable && markdown} + {!isEditable && ( + + + {markdown} + + )} + + +); diff --git a/x-pack/legacy/plugins/siem/public/pages/case/components/user_action_tree/user_action_markdown.tsx b/x-pack/legacy/plugins/siem/public/pages/case/components/user_action_tree/user_action_markdown.tsx index d4156359936de..6a50bf24e9d7e 100644 --- a/x-pack/legacy/plugins/siem/public/pages/case/components/user_action_tree/user_action_markdown.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/case/components/user_action_tree/user_action_markdown.tsx @@ -5,7 +5,7 @@ */ import { EuiFlexGroup, EuiFlexItem, EuiButtonEmpty, EuiButton } from '@elastic/eui'; -import React, { useCallback, useState, useEffect } from 'react'; +import React, { useCallback, useState } from 'react'; import styled, { css } from 'styled-components'; import { MarkdownEditor } from '../../../../components/markdown_editor';