-
Notifications
You must be signed in to change notification settings - Fork 280
Description
Is your feature request related to a problem? Please describe.
We'd like to test if the right Toast message is shown using Detox end to end tests.
please see details on this stackoverflow question
Describe the solution you'd like
The solution today is to check with Detox for the internal testIDs ( testID={getTestId('TouchableContainer')} )
Wich can be broken by id update (they are internal ids) and cannot be configured to check which type of toast is shown.
Describe alternatives you've considered
BaseToast should accept a testID props, defaulting to "toast" So the final test id could be
testID=${testID}${elementName}
;
Users would then be able to set their own test Ids on Base/Success/Error Toasts.
like so :
export const toastConfig = {
/*
Overwrite 'success' type,
by modifying the existing `BaseToast` component
*/
success: (props) => (
<BaseToast
{...props}
testID="Toast.success" // not found by detox
/>
),...
If that's alright I might create the PR myself.