diff options
author | Eric Bailey <git@esb.lol> | 2025-03-05 18:31:55 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-05 16:31:55 -0800 |
commit | 3be87fbf3b9ab354cf8c439c6aeeb28ec2c2d764 (patch) | |
tree | a66e09248e9669b72c2c794ed347acdefbe1ac3c /src | |
parent | 9fde3957e76050a78c04509c84e5091f20975555 (diff) | |
download | voidsky-3be87fbf3b9ab354cf8c439c6aeeb28ec2c2d764.tar.zst |
Add report dialog e2e tests (#7913)
Diffstat (limited to 'src')
-rw-r--r-- | src/components/Dialog/types.ts | 5 | ||||
-rw-r--r-- | src/components/moderation/ReportDialog/index.tsx | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/components/Dialog/types.ts b/src/components/Dialog/types.ts index 32886f3ce..3ca64a321 100644 --- a/src/components/Dialog/types.ts +++ b/src/components/Dialog/types.ts @@ -68,7 +68,10 @@ export type DialogOuterProps = { testID?: string } -type DialogInnerPropsBase<T> = React.PropsWithChildren<ViewStyleProp> & T +type DialogInnerPropsBase<T> = React.PropsWithChildren<ViewStyleProp> & + T & { + testID?: string + } export type DialogInnerProps = | DialogInnerPropsBase<{ label?: undefined diff --git a/src/components/moderation/ReportDialog/index.tsx b/src/components/moderation/ReportDialog/index.tsx index 291699380..c785e8c5e 100644 --- a/src/components/moderation/ReportDialog/index.tsx +++ b/src/components/moderation/ReportDialog/index.tsx @@ -186,6 +186,7 @@ function Inner(props: ReportDialogProps) { return ( <Dialog.ScrollableInner + testID="report:dialog" label={_(msg`Report dialog`)} ref={ref} style={[a.w_full, {maxWidth: 500}]}> @@ -231,6 +232,7 @@ function Inner(props: ReportDialogProps) { <OptionCard option={state.selectedOption} /> </View> <Button + testID="report:clearOption" label={_(msg`Change report reason`)} size="tiny" variant="solid" @@ -399,6 +401,7 @@ function Inner(props: ReportDialogProps) { {state.detailsOpen && ( <View> <Dialog.Input + testID="report:details" multiline value={state.details} onChangeText={details => { @@ -426,6 +429,7 @@ function Inner(props: ReportDialogProps) { )} </View> <Button + testID="report:submit" label={_(msg`Submit report`)} size="large" variant="solid" @@ -566,6 +570,7 @@ function OptionCard({ }, [onSelect, option]) return ( <Button + testID={`report:option:${option.reason}`} label={_(msg`Create report for ${option.title}`)} onPress={onPress} disabled={!onSelect}> @@ -629,6 +634,7 @@ function LabelerCard({ }) return ( <Button + testID={`report:labeler:${labeler.creator.handle}`} label={_(msg`Send report to ${title}`)} onPress={onPress} disabled={!onSelect}> |