Skip to content
Projects
Groups
Snippets
Help
Sign in / Register
Toggle navigation
Minds Mobile
Project overview
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
180
Merge Requests
13
Security & Compliance
Packages
Wiki
Snippets
Members
Collapse sidebar
Close sidebar
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Minds
Minds Mobile
Commits
d3cd9778
Commit
d3cd9778
authored
33 minutes ago
by
Juan Manuel Solaro
Browse files
Options
Download
(feat) comment flow
parent
eb82804f
new-e2e-tests-for-mobile
1 merge request
!426
New e2e tests for mobile
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
63 additions
and
5 deletions
+63
-5
e2e/comment.spec.js
0 → 100644
View file @
d3cd9778
import
sleep
from
'
../src/common/helpers/sleep
'
;
import
capturePoster
from
'
./actions/capturePoster
'
;
import
{
waitForElement
,
waitForAndType
,
tapElement
,
waitForAndTap
}
from
'
./helpers/waitFor
'
;
const
deletePost
=
async
()
=>
{
await
waitForAndTap
(
by
.
id
,
'
ActivityMoreButton
'
);
await
waitForAndTap
(
by
.
id
,
'
deleteOption
'
);
await
waitForAndTap
(
by
.
text
,
'
Ok
'
);
await
waitForAndTap
(
by
.
text
,
'
Ok
'
);
}
describe
(
'
Comment Flow
'
,
()
=>
{
beforeEach
(
async
()
=>
{
await
device
.
launchApp
({
newInstance
:
true
,
permissions
:
{
notifications
:
'
YES
'
,
camera
:
'
YES
'
,
medialibrary
:
'
YES
'
,
photos
:
'
YES
'
,
},
});
await
capturePoster
();
});
it
(
'
should be able to create post and comment
'
,
async
()
=>
{
const
text
=
'
e2eTest
'
;
const
commentText
=
'
commentE2ETest
'
;
const
replyText
=
'
replyE2ETest
'
;
// create post
await
waitForAndType
(
by
.
id
,
'
PostInput
'
,
text
);
await
tapElement
(
by
.
id
,
'
CapturePostButton
'
);
// wait for newsfeed
await
waitForElement
(
by
.
id
,
'
NewsfeedScreen
'
);
// add comment
await
waitForAndTap
(
by
.
id
,
'
ActivityCommentButton
'
);
await
waitForAndType
(
by
.
id
,
'
CommentText
'
,
commentText
);
await
tapElement
(
by
.
id
,
'
PostCommentButton
'
);
// add reply
await
waitForAndTap
(
by
.
id
,
'
ReplyCommentButton
'
);
await
waitFor
(
element
(
by
.
id
(
'
CommentText
'
).
withAncestor
(
by
.
id
(
'
CommentParentView
'
)))).
toBeVisible
().
withTimeout
(
10000
);
await
element
(
by
.
id
(
'
CommentText
'
).
withAncestor
(
by
.
id
(
'
CommentParentView
'
))).
typeText
(
replyText
);
await
element
(
by
.
id
(
'
PostCommentButton
'
).
withAncestor
(
by
.
id
(
'
CommentParentView
'
))).
tap
();
// check reply
await
waitFor
(
element
(
by
.
label
(
`@
${
process
.
env
.
loginUser
}
${
replyText
}
`
))).
toBeVisible
().
withTimeout
(
10000
);
// finish
await
deletePost
();
});
});
This diff is collapsed.
src/comments/CommentList.js
View file @
d3cd9778
...
...
@@ -337,7 +337,7 @@ class CommentList extends React.Component<PropsType, StateType> {
return
(
<
View
>
<
View
style
=
{[
CS
.
rowJustifyCenter
,
CS
.
margin
,
CS
.
padding
,
CS
.
backgroundWhite
,
CS
.
borderRadius12x
,
CS
.
borderGreyed
,
CS
.
borderHair
]}
>
<
View
style
=
{[
CS
.
rowJustifyCenter
,
CS
.
margin
,
CS
.
padding
,
CS
.
backgroundWhite
,
CS
.
borderRadius12x
,
CS
.
borderGreyed
,
CS
.
borderHair
]}
testID
=
{
this
.
props
.
parent
?
'
CommentParentView
'
:
''
}
>
<
Image
source
=
{
avatarImg
}
style
=
{
CmpStyle
.
posterAvatar
}
/
>
<
TextInput
style
=
{[
CS
.
flexContainer
,
CS
.
marginLeft
,
inputStyle
,
{
paddingVertical
:
2
}]}
...
...
@@ -352,6 +352,7 @@ class CommentList extends React.Component<PropsType, StateType> {
maxHeight
=
{
110
}
value
=
{
comments
.
text
}
onSelectionChange
=
{
this
.
onSelectionChanges
}
testID
=
'
CommentText
'
/>
{
attachment
.
uploading
?
<
Progress
.
Pie
progress
=
{
attachment
.
progress
}
size
=
{
36
}
/>
:
...
...
@@ -359,7 +360,7 @@ class CommentList extends React.Component<PropsType, StateType> {
<
ActivityIndicator
size
=
{
'
large
'
}
/>
:
<
View
style
=
{[
CS
.
rowJustifyEnd
,
CS
.
centered
]}
>
<
TouchableOpacity
onPress
=
{
this
.
showAttachment
}
style
=
{
CS
.
paddingRight2x
}
><
Icon
name
=
"
md-attach
"
size
=
{
24
}
style
=
{
CS
.
paddingRight2x
}
/></
TouchableOpacity
>
<
TouchableOpacity
onPress
=
{
this
.
postComment
}
style
=
{
CS
.
paddingRight2x
}
><
Icon
name
=
"
md-send
"
size
=
{
24
}
/></
TouchableOpacity
>
<
TouchableOpacity
onPress
=
{
this
.
postComment
}
style
=
{
CS
.
paddingRight2x
}
testID
=
'
PostCommentButton
'
><
Icon
name
=
"
md-send
"
size
=
{
24
}
/></
TouchableOpacity
>
<
/View
>
}
<
/View
>
...
...
This diff is collapsed.
src/comments/ReplyAction.js
View file @
d3cd9778
...
...
@@ -49,7 +49,7 @@ export default class ReplyAction extends Component {
const
textStyle
=
{
color
};
return
(
<
TouchableOpacityCustom
style
=
{[
CommonStyle
.
flexContainer
,
CommonStyle
.
centered
,
CommonStyle
.
paddingRight2x
,
this
.
props
.
orientation
==
'
column
'
?
CommonStyle
.
columnAlignCenter
:
CommonStyle
.
rowJustifyCenter
]}
onPress
=
{
this
.
toggleExpand
}
>
<
TouchableOpacityCustom
style
=
{[
CommonStyle
.
flexContainer
,
CommonStyle
.
centered
,
CommonStyle
.
paddingRight2x
,
this
.
props
.
orientation
==
'
column
'
?
CommonStyle
.
columnAlignCenter
:
CommonStyle
.
rowJustifyCenter
]}
onPress
=
{
this
.
toggleExpand
}
testID
=
'
ReplyCommentButton
'
>
<
Icon
color
=
{
color
}
name
=
{
this
.
iconName
}
size
=
{
this
.
props
.
size
}
/
>
<
Text
style
=
{
textStyle
}
>
{
i18n
.
t
(
'
reply
'
)}
<
/Text
>
<
Counter
size
=
{
this
.
props
.
size
*
0.75
}
count
=
{
entity
.
replies_count
}
orientation
=
{
this
.
props
.
orientation
}
/
>
...
...
This diff is collapsed.
src/newsfeed/activity/Actions.js
View file @
d3cd9778
...
...
@@ -37,7 +37,7 @@ export default class Actions extends PureComponent {
<
ThumbUpAction
entity
=
{
entity
}
me
=
{
this
.
props
.
user
.
me
}
/
>
<
ThumbDownAction
entity
=
{
entity
}
me
=
{
this
.
props
.
user
.
me
}
/
>
{
!
isOwner
&&
hasCrypto
&&
<
WireAction
owner
=
{
entity
.
ownerObj
}
navigation
=
{
this
.
props
.
navigation
}
/>
}
<
CommentsAction
entity
=
{
entity
}
navigation
=
{
this
.
props
.
navigation
}
/
>
<
CommentsAction
entity
=
{
entity
}
navigation
=
{
this
.
props
.
navigation
}
testID
=
{
this
.
props
.
entity
.
text
===
'
e2eTest
'
?
'
ActivityCommentButton
'
:
''
}
/
>
<
RemindAction
entity
=
{
entity
}
navigation
=
{
this
.
props
.
navigation
}
/
>
{
isOwner
&&
hasCrypto
&&
!
isScheduled
&&
<
BoostAction
entity
=
{
entity
}
navigation
=
{
this
.
props
.
navigation
}
/>
}
<
/View>
}
...
...
This diff is collapsed.
src/newsfeed/activity/actions/CommentsAction.js
View file @
d3cd9778
...
...
@@ -39,7 +39,7 @@ class CommentsAction extends Component {
const
color
=
canComment
?
(
this
.
props
.
entity
[
'
comments:count
'
]
>
0
?
CS
.
colorPrimary
:
CS
.
colorAction
)
:
CS
.
colorLightGreyed
;
return
(
<
TouchableOpacityCustom
style
=
{[
CS
.
flexContainer
,
CS
.
centered
,
CS
.
rowJustifyCenter
]}
onPress
=
{
this
.
openComments
}
>
<
TouchableOpacityCustom
style
=
{[
CS
.
flexContainer
,
CS
.
centered
,
CS
.
rowJustifyCenter
]}
onPress
=
{
this
.
openComments
}
testID
=
{
this
.
props
.
testID
}
>
<
Icon
style
=
{[
color
,
CS
.
marginRight
]}
name
=
{
icon
}
size
=
{
this
.
props
.
size
}
/
>
<
Counter
size
=
{
this
.
props
.
size
*
0.70
}
count
=
{
this
.
props
.
entity
[
'
comments:count
'
]}
/
>
<
/TouchableOpacityCustom
>
...
...
This diff is collapsed.
Please
register
or
sign in
to comment