Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Step 5.1: Add data-testid attributes
  • Loading branch information
DAB0mB authored and Urigo committed May 20, 2020
1 parent a7c3d79 commit 5cf57da
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/components/ChatsListScreen/ChatsList.tsx
Expand Up @@ -92,14 +92,20 @@ const ChatsList = () => {
<Container>
<StyledList>
{chats.map((chat) => (
<StyledListItem key={chat!.id} button>
<ChatPicture src={chat.picture} alt="Profile" />
<StyledListItem key={chat.id} button>
<ChatPicture
data-testid="picture"
src={chat.picture}
alt="Profile"
/>
<ChatInfo>
<ChatName>{chat.name}</ChatName>
<ChatName data-testid="name">{chat.name}</ChatName>
{chat.lastMessage && (
<React.Fragment>
<MessageContent>{chat.lastMessage.content}</MessageContent>
<MessageDate>
<MessageContent data-testid="content">
{chat.lastMessage.content}
</MessageContent>
<MessageDate data-testid="date">
{moment(chat.lastMessage.createdAt).format('HH:mm')}
</MessageDate>
</React.Fragment>
Expand Down

0 comments on commit 5cf57da

Please sign in to comment.