An ATproto social media client -- with an independent Appview.

Add report dialog e2e tests (#7913)

authored by

Eric Bailey and committed by
GitHub
3be87fbf 9fde3957

+124 -2
+1 -1
__e2e__/config.yml
··· 1 flows: 2 - - "flows/*"
··· 1 flows: 2 + - "flows/**"
+24
__e2e__/flows/report-dialog/account.default.yml
···
··· 1 + appId: xyz.blueskyweb.app 2 + --- 3 + - runScript: 4 + file: ../../setupServer.js 5 + env: 6 + SERVER_PATH: ?users&follows&posts&feeds 7 + - runFlow: 8 + file: ../../setupApp.yml 9 + - tapOn: 10 + id: "e2eSignInAlice" 11 + 12 + - tapOn: "Carla's avatar" 13 + - tapOn: 14 + id: "profileHeaderDropdownBtn" 15 + - tapOn: 16 + id: "profileHeaderDropdownReportBtn" 17 + - tapOn: 18 + id: "report:option:com.atproto.moderation.defs#reasonSpam" 19 + - assertVisible: 20 + id: "report:labeler:mod-authority.test" 21 + - tapOn: 22 + id: "report:submit" 23 + - assertNotVisible: 24 + id: "report:dialog"
+24
__e2e__/flows/report-dialog/post:default.yml
···
··· 1 + appId: xyz.blueskyweb.app 2 + --- 3 + - runScript: 4 + file: ../../setupServer.js 5 + env: 6 + SERVER_PATH: ?users&follows&posts&feeds 7 + - runFlow: 8 + file: ../../setupApp.yml 9 + - tapOn: 10 + id: "e2eSignInAlice" 11 + 12 + - tapOn: 13 + id: "postDropdownBtn" 14 + index: 0 15 + - tapOn: 16 + id: "postDropdownReportBtn" 17 + - tapOn: 18 + id: "report:option:com.atproto.moderation.defs#reasonSpam" 19 + - assertVisible: 20 + id: "report:labeler:mod-authority.test" 21 + - tapOn: 22 + id: "report:submit" 23 + - assertNotVisible: 24 + id: "report:dialog"
+35
__e2e__/flows/report-dialog/post:edit-reason.yml
···
··· 1 + appId: xyz.blueskyweb.app 2 + --- 3 + - runScript: 4 + file: ../../setupServer.js 5 + env: 6 + SERVER_PATH: ?users&follows&posts&feeds 7 + - runFlow: 8 + file: ../../setupApp.yml 9 + - tapOn: 10 + id: "e2eSignInAlice" 11 + 12 + - tapOn: 13 + id: "postDropdownBtn" 14 + index: 0 15 + - tapOn: 16 + id: "postDropdownReportBtn" 17 + - tapOn: 18 + id: "report:option:com.atproto.moderation.defs#reasonOther" 19 + - assertVisible: 20 + id: "report:labeler:mod-authority.test" 21 + # reason "other" defaults with details open 22 + - assertVisible: 23 + id: "report:details" 24 + - tapOn: 25 + id: "report:clearOption" 26 + - assertNotVisible: 27 + id: "report:details" 28 + - tapOn: 29 + id: "report:option:com.atproto.moderation.defs#reasonSpam" 30 + - assertVisible: 31 + id: "report:labeler:mod-authority.test" 32 + - tapOn: 33 + id: "report:submit" 34 + - assertNotVisible: 35 + id: "report:dialog"
+30
__e2e__/flows/report-dialog/post:reason-other.yml
···
··· 1 + appId: xyz.blueskyweb.app 2 + --- 3 + - runScript: 4 + file: ../../setupServer.js 5 + env: 6 + SERVER_PATH: ?users&follows&posts&feeds 7 + - runFlow: 8 + file: ../../setupApp.yml 9 + - tapOn: 10 + id: "e2eSignInAlice" 11 + 12 + - tapOn: 13 + id: "postDropdownBtn" 14 + index: 0 15 + - tapOn: 16 + id: "postDropdownReportBtn" 17 + - tapOn: 18 + id: "report:option:com.atproto.moderation.defs#reasonOther" 19 + - assertVisible: 20 + id: "report:labeler:mod-authority.test" 21 + # reason "other" defaults with details open 22 + - assertVisible: 23 + id: "report:details" 24 + - tapOn: 25 + id: "report:details" 26 + - inputText: "This is a test report" 27 + - tapOn: 28 + id: "report:submit" 29 + - assertNotVisible: 30 + id: "report:dialog"
+4 -1
src/components/Dialog/types.ts
··· 68 testID?: string 69 } 70 71 - type DialogInnerPropsBase<T> = React.PropsWithChildren<ViewStyleProp> & T 72 export type DialogInnerProps = 73 | DialogInnerPropsBase<{ 74 label?: undefined
··· 68 testID?: string 69 } 70 71 + type DialogInnerPropsBase<T> = React.PropsWithChildren<ViewStyleProp> & 72 + T & { 73 + testID?: string 74 + } 75 export type DialogInnerProps = 76 | DialogInnerPropsBase<{ 77 label?: undefined
+6
src/components/moderation/ReportDialog/index.tsx
··· 186 187 return ( 188 <Dialog.ScrollableInner 189 label={_(msg`Report dialog`)} 190 ref={ref} 191 style={[a.w_full, {maxWidth: 500}]}> ··· 231 <OptionCard option={state.selectedOption} /> 232 </View> 233 <Button 234 label={_(msg`Change report reason`)} 235 size="tiny" 236 variant="solid" ··· 399 {state.detailsOpen && ( 400 <View> 401 <Dialog.Input 402 multiline 403 value={state.details} 404 onChangeText={details => { ··· 426 )} 427 </View> 428 <Button 429 label={_(msg`Submit report`)} 430 size="large" 431 variant="solid" ··· 566 }, [onSelect, option]) 567 return ( 568 <Button 569 label={_(msg`Create report for ${option.title}`)} 570 onPress={onPress} 571 disabled={!onSelect}> ··· 629 }) 630 return ( 631 <Button 632 label={_(msg`Send report to ${title}`)} 633 onPress={onPress} 634 disabled={!onSelect}>
··· 186 187 return ( 188 <Dialog.ScrollableInner 189 + testID="report:dialog" 190 label={_(msg`Report dialog`)} 191 ref={ref} 192 style={[a.w_full, {maxWidth: 500}]}> ··· 232 <OptionCard option={state.selectedOption} /> 233 </View> 234 <Button 235 + testID="report:clearOption" 236 label={_(msg`Change report reason`)} 237 size="tiny" 238 variant="solid" ··· 401 {state.detailsOpen && ( 402 <View> 403 <Dialog.Input 404 + testID="report:details" 405 multiline 406 value={state.details} 407 onChangeText={details => { ··· 429 )} 430 </View> 431 <Button 432 + testID="report:submit" 433 label={_(msg`Submit report`)} 434 size="large" 435 variant="solid" ··· 570 }, [onSelect, option]) 571 return ( 572 <Button 573 + testID={`report:option:${option.reason}`} 574 label={_(msg`Create report for ${option.title}`)} 575 onPress={onPress} 576 disabled={!onSelect}> ··· 634 }) 635 return ( 636 <Button 637 + testID={`report:labeler:${labeler.creator.handle}`} 638 label={_(msg`Send report to ${title}`)} 639 onPress={onPress} 640 disabled={!onSelect}>