Skip to content

Commit

Permalink
Update desktop tests
Browse files Browse the repository at this point in the history
  • Loading branch information
islathehut committed Mar 19, 2024
1 parent 926535a commit f498f04
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 93 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('FileComponent', () => {
<body>
<div>
<div
class="css-4fpo3t"
class="css-17r12jj"
data-testid="QmWUCSApiy76nW9DAk5M9QbH1nkW5XCYwxUHRSULjATyqs-fileComponent"
>
<span>
Expand Down Expand Up @@ -83,6 +83,7 @@ describe('FileComponent', () => {
</div>
</span>
<div
class=""
style="padding-top: 16px; display: block;"
>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('UploadedFile', () => {
<body>
<div>
<div
class="css-gd4qex"
class="css-1clc91l"
>
<div
class="css-ytr8bc"
Expand Down Expand Up @@ -129,7 +129,7 @@ describe('UploadedFile', () => {
<body>
<div>
<div
class="css-gd4qex"
class="css-1clc91l"
>
<div
class="UploadedImagecontainer"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('MathMessageComponent', () => {
<body>
<div>
<span
class="MathMessagemessage MathMessagebeginning css-y9v6re"
class="MathMessagemessage MathMessagebeginning css-e17gp5"
>
<mjx-container
class="MathJax"
Expand Down Expand Up @@ -114,13 +114,13 @@ describe('MathMessageComponent', () => {
<body>
<div>
<span
class="MuiTypography-root MuiTypography-body1 TextMessagemessage css-1vefsqk-MuiTypography-root"
class="MuiTypography-root MuiTypography-body1 TextMessagemessage css-nx1df2-MuiTypography-root"
data-testid="messagesGroupContent-1-0"
>
It is
</span>
<span
class="MathMessagemessage MathMessagemiddle css-y9v6re"
class="MathMessagemessage MathMessagemiddle css-e17gp5"
>
<mjx-container
class="MathJax"
Expand Down Expand Up @@ -194,13 +194,13 @@ describe('MathMessageComponent', () => {
</mjx-container>
</span>
<span
class="MuiTypography-root MuiTypography-body1 TextMessagemessage css-1vefsqk-MuiTypography-root"
class="MuiTypography-root MuiTypography-body1 TextMessagemessage css-nx1df2-MuiTypography-root"
data-testid="messagesGroupContent-1-2"
>
and
</span>
<span
class="MathMessagemessage MathMessagemiddle css-y9v6re"
class="MathMessagemessage MathMessagemiddle css-e17gp5"
>
<mjx-container
class="MathJax"
Expand Down Expand Up @@ -295,7 +295,7 @@ describe('MathMessageComponent', () => {
<body>
<div>
<span
class="MathMessagemessage MathMessagebeginning css-y9v6re"
class="MathMessagemessage MathMessagebeginning css-e17gp5"
>
<mjx-container
class="MathJax"
Expand Down Expand Up @@ -492,7 +492,7 @@ describe('MathMessageComponent', () => {
</mjx-container>
</span>
<span
class="MuiTypography-root MuiTypography-body1 TextMessagemessage css-1vefsqk-MuiTypography-root"
class="MuiTypography-root MuiTypography-body1 TextMessagemessage css-nx1df2-MuiTypography-root"
data-testid="messagesGroupContent-1-1"
>
<ul
Expand Down
Original file line number Diff line number Diff line change
@@ -1,51 +1,48 @@
// import React from 'react'
import React from 'react'

// import each from 'jest-each'
import each from 'jest-each'

// import { AnimatedEllipsis } from './AnimatedEllipsis'
// import { renderComponent } from '../../../testUtils/renderComponent'
import { AnimatedEllipsis } from './AnimatedEllipsis'
import { renderComponent } from '../../../testUtils/renderComponent'

// describe('Elipsis', () => {
// each(['bottom-start', 'bottom', 'bottom-end']).test('renders with placement %s', placement => {
// const result = renderComponent(
// <AnimatedEllipsis content={'this is a sample text'} length={5} tooltipPlacement={placement} />
// )
// expect(result.baseElement).toMatchSnapshot()
// })

// it('renders with custom size', () => {
// const result = renderComponent(<AnimatedEllipsis content={'this is a sample text'} length={5} />)
// expect(result.baseElement).toMatchInlineSnapshot(`
// <body>
// <div>
// <span>
// <span
// class="MuiTypography-root MuiTypography-caption Elipsiscontent css-1d4bzk2-MuiTypography-root"
// data-mui-internal-clone-element="true"
// >
// this ...
// </span>
// </span>
// </div>
// </body>
// `)
// })

// it('disables if shorter than limit', () => {
// const result = renderComponent(<AnimatedEllipsis content={'this is a sample text'} length={50} />)
// expect(result.baseElement).toMatchInlineSnapshot(`
// <body>
// <div>
// <span>
// <span
// class="MuiTypography-root MuiTypography-caption Elipsiscontent css-1d4bzk2-MuiTypography-root"
// data-mui-internal-clone-element="true"
// >
// this is a sample text
// </span>
// </span>
// </div>
// </body>
// `)
// })
// })
describe('AnimatedEllipsis', () => {
it('renders text followed by animated ellipsis', () => {
const result = renderComponent(
<AnimatedEllipsis content={'Sending'} color={'black'} fontSize={12} fontWeight={'regular'} />
)
expect(result.baseElement).toMatchInlineSnapshot(`
<body>
<div>
<div
class="MuiGrid-root MuiGrid-item css-1hr8piw-MuiGrid-root"
>
<div
class="MuiGrid-root MuiGrid-item AnimatedEllipsis-wrapper css-13i4rnv-MuiGrid-root"
>
<p
class="MuiTypography-root MuiTypography-body1 AnimatedEllipsis-content css-1w9s1dh-MuiTypography-root"
>
Sending
</p>
<p
class="MuiTypography-root MuiTypography-body1 AnimatedEllipsis-dot1 css-1w9s1dh-MuiTypography-root"
>
.
</p>
<p
class="MuiTypography-root MuiTypography-body1 AnimatedEllipsis-dot2 css-1w9s1dh-MuiTypography-root"
>
.
</p>
<p
class="MuiTypography-root MuiTypography-body1 AnimatedEllipsis-dot3 css-1w9s1dh-MuiTypography-root"
>
.
</p>
</div>
</div>
</div>
</body>
`)
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('BasicMessage', () => {
duplicatedUsernameModalHandleOpen={jest.fn()}
unregisteredUsernameModalHandleOpen={jest.fn()}
messages={messages}
lastConnectedTime={DateTime.utc().toSeconds()}
lastConnectedTime={DateTime.utc().toSeconds() - 1000}
allPeersDisconnectedTime={undefined}
isConnectedToOtherPeers={true}
communityHasPeers={true}
Expand All @@ -36,7 +36,7 @@ describe('BasicMessage', () => {
<body>
<div>
<li
class="MuiListItem-root MuiListItem-gutters MuiListItem-padding BasicMessageComponentwrapper css-13gdcvl-MuiListItem-root"
class="MuiListItem-root MuiListItem-gutters MuiListItem-padding BasicMessageComponentwrapper css-6oh3yy-MuiListItem-root"
>
<div
class="MuiListItemText-root BasicMessageComponentmessageCard css-tlelie-MuiListItemText-root"
Expand Down Expand Up @@ -89,10 +89,10 @@ describe('BasicMessage', () => {
style="margin-top: -3px;"
>
<div
class="MuiGrid-root MuiGrid-item css-15myz84-MuiGrid-root"
class="MuiGrid-root MuiGrid-item css-8e83yq-MuiGrid-root"
>
<span
class="MuiTypography-root MuiTypography-body1 TextMessagemessage css-1vefsqk-MuiTypography-root"
class="MuiTypography-root MuiTypography-body1 TextMessagemessage css-nx1df2-MuiTypography-root"
data-testid="messagesGroupContent-0"
>
message0
Expand All @@ -115,7 +115,7 @@ describe('BasicMessage', () => {
<BasicMessageComponent
duplicatedUsernameModalHandleOpen={jest.fn()}
unregisteredUsernameModalHandleOpen={jest.fn()}
lastConnectedTime={DateTime.utc().toSeconds()}
lastConnectedTime={DateTime.utc().toSeconds() - 1000}
allPeersDisconnectedTime={undefined}
messages={messages}
isConnectedToOtherPeers={true}
Expand All @@ -129,7 +129,7 @@ describe('BasicMessage', () => {
<body>
<div>
<li
class="MuiListItem-root MuiListItem-gutters MuiListItem-padding BasicMessageComponentwrapper css-13gdcvl-MuiListItem-root"
class="MuiListItem-root MuiListItem-gutters MuiListItem-padding BasicMessageComponentwrapper css-6oh3yy-MuiListItem-root"
>
<div
class="MuiListItemText-root BasicMessageComponentmessageCard css-tlelie-MuiListItemText-root"
Expand Down Expand Up @@ -182,20 +182,20 @@ describe('BasicMessage', () => {
style="margin-top: -3px;"
>
<div
class="MuiGrid-root MuiGrid-item css-15myz84-MuiGrid-root"
class="MuiGrid-root MuiGrid-item css-8e83yq-MuiGrid-root"
>
<span
class="MuiTypography-root MuiTypography-body1 TextMessagemessage css-1vefsqk-MuiTypography-root"
class="MuiTypography-root MuiTypography-body1 TextMessagemessage css-nx1df2-MuiTypography-root"
data-testid="messagesGroupContent-0"
>
message0
</span>
</div>
<div
class="MuiGrid-root MuiGrid-item css-15myz84-MuiGrid-root"
class="MuiGrid-root MuiGrid-item css-8e83yq-MuiGrid-root"
>
<span
class="MuiTypography-root MuiTypography-body1 TextMessagemessage css-1vefsqk-MuiTypography-root"
class="MuiTypography-root MuiTypography-body1 TextMessagemessage css-nx1df2-MuiTypography-root"
data-testid="messagesGroupContent-1"
>
message1
Expand All @@ -218,7 +218,7 @@ describe('BasicMessage', () => {
<BasicMessageComponent
duplicatedUsernameModalHandleOpen={jest.fn()}
unregisteredUsernameModalHandleOpen={jest.fn()}
lastConnectedTime={DateTime.utc().toSeconds()}
lastConnectedTime={DateTime.utc().toSeconds() - 1000}
allPeersDisconnectedTime={undefined}
messages={messages}
isConnectedToOtherPeers={true}
Expand All @@ -232,7 +232,7 @@ describe('BasicMessage', () => {
<body>
<div>
<li
class="MuiListItem-root MuiListItem-gutters MuiListItem-padding css-13gdcvl-MuiListItem-root"
class="MuiListItem-root MuiListItem-gutters MuiListItem-padding css-6oh3yy-MuiListItem-root"
>
<div
class="MuiListItemText-root BasicMessageComponentmessageCard css-tlelie-MuiListItemText-root"
Expand Down Expand Up @@ -288,20 +288,20 @@ describe('BasicMessage', () => {
style="margin-top: -3px;"
>
<div
class="MuiGrid-root MuiGrid-item css-15myz84-MuiGrid-root"
class="MuiGrid-root MuiGrid-item css-8e83yq-MuiGrid-root"
>
<span
class="MuiTypography-root MuiTypography-body1 TextMessagemessage css-1vefsqk-MuiTypography-root"
class="MuiTypography-root MuiTypography-body1 TextMessagemessage css-nx1df2-MuiTypography-root"
data-testid="messagesGroupContent-0"
>
message0
</span>
</div>
<div
class="MuiGrid-root MuiGrid-item css-15myz84-MuiGrid-root"
class="MuiGrid-root MuiGrid-item css-8e83yq-MuiGrid-root"
>
<span
class="MuiTypography-root MuiTypography-body1 TextMessagemessage css-1vefsqk-MuiTypography-root"
class="MuiTypography-root MuiTypography-body1 TextMessagemessage css-nx1df2-MuiTypography-root"
data-testid="messagesGroupContent-1"
>
message1
Expand All @@ -325,7 +325,7 @@ describe('BasicMessage', () => {
<BasicMessageComponent
duplicatedUsernameModalHandleOpen={jest.fn()}
unregisteredUsernameModalHandleOpen={jest.fn()}
lastConnectedTime={DateTime.utc().toSeconds()}
lastConnectedTime={DateTime.utc().toSeconds() - 1000}
allPeersDisconnectedTime={undefined}
messages={[...message1, ...message2]}
isConnectedToOtherPeers={true}
Expand All @@ -339,7 +339,7 @@ describe('BasicMessage', () => {
<body>
<div>
<li
class="MuiListItem-root MuiListItem-gutters MuiListItem-padding BasicMessageComponentwrapper css-13gdcvl-MuiListItem-root"
class="MuiListItem-root MuiListItem-gutters MuiListItem-padding BasicMessageComponentwrapper css-6oh3yy-MuiListItem-root"
>
<div
class="MuiListItemText-root BasicMessageComponentmessageCard css-tlelie-MuiListItemText-root"
Expand Down Expand Up @@ -392,20 +392,20 @@ describe('BasicMessage', () => {
style="margin-top: -3px;"
>
<div
class="MuiGrid-root MuiGrid-item css-15myz84-MuiGrid-root"
class="MuiGrid-root MuiGrid-item css-8e83yq-MuiGrid-root"
>
<span
class="MuiTypography-root MuiTypography-body1 TextMessagemessage css-1vefsqk-MuiTypography-root"
class="MuiTypography-root MuiTypography-body1 TextMessagemessage css-nx1df2-MuiTypography-root"
data-testid="messagesGroupContent-0"
>
message0
</span>
</div>
<div
class="MuiGrid-root MuiGrid-item css-15myz84-MuiGrid-root"
class="MuiGrid-root MuiGrid-item css-8e83yq-MuiGrid-root"
>
<span
class="MuiTypography-root MuiTypography-body1 TextMessagemessage css-1vefsqk-MuiTypography-root"
class="MuiTypography-root MuiTypography-body1 TextMessagemessage css-nx1df2-MuiTypography-root"
data-testid="messagesGroupContent-0"
>
message0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ describe('ChannelMessages', () => {
</div>
</div>
<li
class="MuiListItem-root MuiListItem-gutters MuiListItem-padding BasicMessageComponentwrapper css-13gdcvl-MuiListItem-root"
class="MuiListItem-root MuiListItem-gutters MuiListItem-padding BasicMessageComponentwrapper css-6oh3yy-MuiListItem-root"
>
<div
class="MuiListItemText-root BasicMessageComponentmessageCard css-tlelie-MuiListItemText-root"
Expand Down Expand Up @@ -140,10 +140,10 @@ describe('ChannelMessages', () => {
style="margin-top: -3px;"
>
<div
class="MuiGrid-root MuiGrid-item css-15myz84-MuiGrid-root"
class="MuiGrid-root MuiGrid-item css-8e83yq-MuiGrid-root"
>
<span
class="MuiTypography-root MuiTypography-body1 TextMessagemessage css-1vefsqk-MuiTypography-root"
class="MuiTypography-root MuiTypography-body1 TextMessagemessage css-nx1df2-MuiTypography-root"
data-testid="messagesGroupContent-string"
>
string
Expand Down
Loading

0 comments on commit f498f04

Please sign in to comment.