Add report dialog e2e tests (#7913)
This commit is contained in:
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
flows:
|
flows:
|
||||||
- "flows/*"
|
- "flows/**"
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
appId: xyz.blueskyweb.app
|
||||||
|
---
|
||||||
|
- runScript:
|
||||||
|
file: ../../setupServer.js
|
||||||
|
env:
|
||||||
|
SERVER_PATH: ?users&follows&posts&feeds
|
||||||
|
- runFlow:
|
||||||
|
file: ../../setupApp.yml
|
||||||
|
- tapOn:
|
||||||
|
id: "e2eSignInAlice"
|
||||||
|
|
||||||
|
- tapOn: "Carla's avatar"
|
||||||
|
- tapOn:
|
||||||
|
id: "profileHeaderDropdownBtn"
|
||||||
|
- tapOn:
|
||||||
|
id: "profileHeaderDropdownReportBtn"
|
||||||
|
- tapOn:
|
||||||
|
id: "report:option:com.atproto.moderation.defs#reasonSpam"
|
||||||
|
- assertVisible:
|
||||||
|
id: "report:labeler:mod-authority.test"
|
||||||
|
- tapOn:
|
||||||
|
id: "report:submit"
|
||||||
|
- assertNotVisible:
|
||||||
|
id: "report:dialog"
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
appId: xyz.blueskyweb.app
|
||||||
|
---
|
||||||
|
- runScript:
|
||||||
|
file: ../../setupServer.js
|
||||||
|
env:
|
||||||
|
SERVER_PATH: ?users&follows&posts&feeds
|
||||||
|
- runFlow:
|
||||||
|
file: ../../setupApp.yml
|
||||||
|
- tapOn:
|
||||||
|
id: "e2eSignInAlice"
|
||||||
|
|
||||||
|
- tapOn:
|
||||||
|
id: "postDropdownBtn"
|
||||||
|
index: 0
|
||||||
|
- tapOn:
|
||||||
|
id: "postDropdownReportBtn"
|
||||||
|
- tapOn:
|
||||||
|
id: "report:option:com.atproto.moderation.defs#reasonSpam"
|
||||||
|
- assertVisible:
|
||||||
|
id: "report:labeler:mod-authority.test"
|
||||||
|
- tapOn:
|
||||||
|
id: "report:submit"
|
||||||
|
- assertNotVisible:
|
||||||
|
id: "report:dialog"
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
appId: xyz.blueskyweb.app
|
||||||
|
---
|
||||||
|
- runScript:
|
||||||
|
file: ../../setupServer.js
|
||||||
|
env:
|
||||||
|
SERVER_PATH: ?users&follows&posts&feeds
|
||||||
|
- runFlow:
|
||||||
|
file: ../../setupApp.yml
|
||||||
|
- tapOn:
|
||||||
|
id: "e2eSignInAlice"
|
||||||
|
|
||||||
|
- tapOn:
|
||||||
|
id: "postDropdownBtn"
|
||||||
|
index: 0
|
||||||
|
- tapOn:
|
||||||
|
id: "postDropdownReportBtn"
|
||||||
|
- tapOn:
|
||||||
|
id: "report:option:com.atproto.moderation.defs#reasonOther"
|
||||||
|
- assertVisible:
|
||||||
|
id: "report:labeler:mod-authority.test"
|
||||||
|
# reason "other" defaults with details open
|
||||||
|
- assertVisible:
|
||||||
|
id: "report:details"
|
||||||
|
- tapOn:
|
||||||
|
id: "report:clearOption"
|
||||||
|
- assertNotVisible:
|
||||||
|
id: "report:details"
|
||||||
|
- tapOn:
|
||||||
|
id: "report:option:com.atproto.moderation.defs#reasonSpam"
|
||||||
|
- assertVisible:
|
||||||
|
id: "report:labeler:mod-authority.test"
|
||||||
|
- tapOn:
|
||||||
|
id: "report:submit"
|
||||||
|
- assertNotVisible:
|
||||||
|
id: "report:dialog"
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
appId: xyz.blueskyweb.app
|
||||||
|
---
|
||||||
|
- runScript:
|
||||||
|
file: ../../setupServer.js
|
||||||
|
env:
|
||||||
|
SERVER_PATH: ?users&follows&posts&feeds
|
||||||
|
- runFlow:
|
||||||
|
file: ../../setupApp.yml
|
||||||
|
- tapOn:
|
||||||
|
id: "e2eSignInAlice"
|
||||||
|
|
||||||
|
- tapOn:
|
||||||
|
id: "postDropdownBtn"
|
||||||
|
index: 0
|
||||||
|
- tapOn:
|
||||||
|
id: "postDropdownReportBtn"
|
||||||
|
- tapOn:
|
||||||
|
id: "report:option:com.atproto.moderation.defs#reasonOther"
|
||||||
|
- assertVisible:
|
||||||
|
id: "report:labeler:mod-authority.test"
|
||||||
|
# reason "other" defaults with details open
|
||||||
|
- assertVisible:
|
||||||
|
id: "report:details"
|
||||||
|
- tapOn:
|
||||||
|
id: "report:details"
|
||||||
|
- inputText: "This is a test report"
|
||||||
|
- tapOn:
|
||||||
|
id: "report:submit"
|
||||||
|
- assertNotVisible:
|
||||||
|
id: "report:dialog"
|
||||||
@@ -68,7 +68,10 @@ export type DialogOuterProps = {
|
|||||||
testID?: string
|
testID?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
type DialogInnerPropsBase<T> = React.PropsWithChildren<ViewStyleProp> & T
|
type DialogInnerPropsBase<T> = React.PropsWithChildren<ViewStyleProp> &
|
||||||
|
T & {
|
||||||
|
testID?: string
|
||||||
|
}
|
||||||
export type DialogInnerProps =
|
export type DialogInnerProps =
|
||||||
| DialogInnerPropsBase<{
|
| DialogInnerPropsBase<{
|
||||||
label?: undefined
|
label?: undefined
|
||||||
|
|||||||
@@ -186,6 +186,7 @@ function Inner(props: ReportDialogProps) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog.ScrollableInner
|
<Dialog.ScrollableInner
|
||||||
|
testID="report:dialog"
|
||||||
label={_(msg`Report dialog`)}
|
label={_(msg`Report dialog`)}
|
||||||
ref={ref}
|
ref={ref}
|
||||||
style={[a.w_full, {maxWidth: 500}]}>
|
style={[a.w_full, {maxWidth: 500}]}>
|
||||||
@@ -231,6 +232,7 @@ function Inner(props: ReportDialogProps) {
|
|||||||
<OptionCard option={state.selectedOption} />
|
<OptionCard option={state.selectedOption} />
|
||||||
</View>
|
</View>
|
||||||
<Button
|
<Button
|
||||||
|
testID="report:clearOption"
|
||||||
label={_(msg`Change report reason`)}
|
label={_(msg`Change report reason`)}
|
||||||
size="tiny"
|
size="tiny"
|
||||||
variant="solid"
|
variant="solid"
|
||||||
@@ -399,6 +401,7 @@ function Inner(props: ReportDialogProps) {
|
|||||||
{state.detailsOpen && (
|
{state.detailsOpen && (
|
||||||
<View>
|
<View>
|
||||||
<Dialog.Input
|
<Dialog.Input
|
||||||
|
testID="report:details"
|
||||||
multiline
|
multiline
|
||||||
value={state.details}
|
value={state.details}
|
||||||
onChangeText={details => {
|
onChangeText={details => {
|
||||||
@@ -426,6 +429,7 @@ function Inner(props: ReportDialogProps) {
|
|||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
<Button
|
<Button
|
||||||
|
testID="report:submit"
|
||||||
label={_(msg`Submit report`)}
|
label={_(msg`Submit report`)}
|
||||||
size="large"
|
size="large"
|
||||||
variant="solid"
|
variant="solid"
|
||||||
@@ -566,6 +570,7 @@ function OptionCard({
|
|||||||
}, [onSelect, option])
|
}, [onSelect, option])
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
|
testID={`report:option:${option.reason}`}
|
||||||
label={_(msg`Create report for ${option.title}`)}
|
label={_(msg`Create report for ${option.title}`)}
|
||||||
onPress={onPress}
|
onPress={onPress}
|
||||||
disabled={!onSelect}>
|
disabled={!onSelect}>
|
||||||
@@ -629,6 +634,7 @@ function LabelerCard({
|
|||||||
})
|
})
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
|
testID={`report:labeler:${labeler.creator.handle}`}
|
||||||
label={_(msg`Send report to ${title}`)}
|
label={_(msg`Send report to ${title}`)}
|
||||||
onPress={onPress}
|
onPress={onPress}
|
||||||
disabled={!onSelect}>
|
disabled={!onSelect}>
|
||||||
|
|||||||
Reference in New Issue
Block a user