Skip to content

Instantly share code, notes, and snippets.

@Frank1234
Last active November 23, 2019 13:06
Show Gist options
  • Select an option

  • Save Frank1234/ab5eacf58a153b606f9c0ed01257e18a to your computer and use it in GitHub Desktop.

Select an option

Save Frank1234/ab5eacf58a153b606f9c0ed01257e18a to your computer and use it in GitHub Desktop.

Revisions

  1. Frank1234 revised this gist Jun 29, 2018. No changes.
  2. Frank1234 revised this gist Jun 29, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion testUtils.js
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@ const getPlatformTestId = (id: string) =>
    Platform.OS === 'ios' ? {testID: id} : {accessible: true, accessibilityLabel: id};

    /**
    * Adds a testID to the views on Android and iOS in their specific ways. On android,
    * Adds a testID to the views on Android and iOS in their specific ways. On Android,
    * this will result in a ContentDescription on Debug builds (and no changes on live builds).
    */
    const setTestID = (id : string) =>
  3. Frank1234 revised this gist Jun 29, 2018. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions testUtils.js
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,13 @@
    import {Platform} from 'react-native';

    const getPlatformTestId = (id?: ?string) =>
    const getPlatformTestId = (id: string) =>
    Platform.OS === 'ios' ? {testID: id} : {accessible: true, accessibilityLabel: id};

    /**
    * Adds a testID to the views on Android and iOS in their specific ways. On android,
    * this will result in a ContentDescription on Debug builds (and no changes on live builds).
    */
    const setTestID = (id? : ?string) =>
    const setTestID = (id : string) =>
    __DEV__ ? getPlatformTestId(id) : null;

    export default setTestID;
  4. Frank1234 created this gist Jun 29, 2018.
    13 changes: 13 additions & 0 deletions testUtils.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    import {Platform} from 'react-native';

    const getPlatformTestId = (id?: ?string) =>
    Platform.OS === 'ios' ? {testID: id} : {accessible: true, accessibilityLabel: id};

    /**
    * Adds a testID to the views on Android and iOS in their specific ways. On android,
    * this will result in a ContentDescription on Debug builds (and no changes on live builds).
    */
    const setTestID = (id? : ?string) =>
    __DEV__ ? getPlatformTestId(id) : null;

    export default setTestID;