Skip to content

Add unit tests for handleRecaptchaFlow #7699

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 35 commits into from
Nov 1, 2023
Merged

Add unit tests for handleRecaptchaFlow #7699

merged 35 commits into from
Nov 1, 2023

Conversation

renkelvin
Copy link

@renkelvin renkelvin commented Oct 14, 2023

Unit tests for #7666

@changeset-bot
Copy link

changeset-bot bot commented Oct 14, 2023

⚠️ No Changeset found

Latest commit: 6b71639

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Oct 14, 2023

Size Report 1

Affected Products

  • @firebase/auth

    TypeBase (12ad9f1)Merge (f762ef7)Diff
    browser176 kB176 kB+202 B (+0.1%)
    cordova204 kB204 kB+297 B (+0.1%)
    esm5229 kB229 kB+297 B (+0.1%)
    main173 kB174 kB+309 B (+0.2%)
    module176 kB176 kB+202 B (+0.1%)
    react-native192 kB193 kB+313 B (+0.2%)
  • @firebase/auth/cordova

    TypeBase (12ad9f1)Merge (f762ef7)Diff
    browser204 kB204 kB+297 B (+0.1%)
    module204 kB204 kB+297 B (+0.1%)
  • @firebase/auth/internal

    TypeBase (12ad9f1)Merge (f762ef7)Diff
    browser187 kB187 kB+202 B (+0.1%)
    esm5242 kB243 kB+297 B (+0.1%)
    main210 kB210 kB+313 B (+0.1%)
    module187 kB187 kB+202 B (+0.1%)
  • @firebase/firestore-compat

    TypeBase (12ad9f1)Merge (f762ef7)Diff
    browser20.5 kB20.6 kB+48 B (+0.2%)
    esm527.6 kB27.7 kB+48 B (+0.2%)
    main20.9 kB21.0 kB+48 B (+0.2%)
    module20.5 kB20.6 kB+48 B (+0.2%)
    react-native20.5 kB20.6 kB+48 B (+0.2%)
  • bundle

    TypeBase (12ad9f1)Merge (f762ef7)Diff
    auth (EmailAndPassword)80.9 kB80.9 kB+59 B (+0.1%)
  • firebase

    TypeBase (12ad9f1)Merge (f762ef7)Diff
    firebase-auth-compat.js136 kB136 kB+111 B (+0.1%)
    firebase-auth-cordova.js173 kB173 kB+261 B (+0.2%)
    firebase-auth.js146 kB146 kB+143 B (+0.1%)
    firebase-compat.js778 kB778 kB+138 B (+0.0%)
    firebase-firestore-compat.js340 kB340 kB+27 B (+0.0%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/XFEF3HZzxr.html

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Oct 14, 2023

Size Analysis Report 1

Affected Products

  • @firebase/auth

    • EmailAuthCredential

      Size

      TypeBase (12ad9f1)Merge (f762ef7)Diff
      size42.6 kB42.6 kB+59 B (+0.1%)
      size-with-ext-deps63.4 kB63.4 kB+59 B (+0.1%)

      Dependency

      TypeBase (12ad9f1)Merge (f762ef7)Diff
      functions

      63 dependencies

      _addTidIfNecessary
      _assert
      _castAuth
      _createError
      _emulatorUrl
      _errorWithCustomMessage
      _fail
      _getBrowserName
      _getClientVersion
      _getCurrentScheme
      _getFinalTarget
      _getInstance
      _getPasswordPolicy
      _getUserLanguage
      _initializeAuthInstance
      _isAndroid
      _isBlackBerry
      _isChromeIOS
      _isFirefox
      _isHttpOrHttps
      _isIEMobile
      _isOnline
      _isSafari
      _isWebOS
      _loadJS
      _logError
      _logWarn
      _logoutIfInvalidated
      _makeTaggedError
      _parseEnforcementState
      _parseToken
      _performApiRequest
      _performFetchWithErrorHandling
      _performSignInRequest
      _persistenceKeyName
      _prodErrorMap
      _reloadWithoutSaving
      _tokenExpiresIn
      assertStringOrUndefined
      createErrorInternal
      debugAssert
      debugFail
      deleteAccount
      extractProviderData
      getAccountInfo
      getIdTokenResult
      getRecaptchaConfig
      getScriptParentElement
      getVersionForPlatform
      handleRecaptchaFlow
      injectRecaptchaFields
      isEnterprise
      isUserInvalidated
      mergeProviderData
      registerAuth
      reload
      requestStsToken
      secondsStringToMilliseconds
      signInWithEmailLink$1
      signInWithEmailLinkForLinking
      signInWithPassword
      updateEmailPassword
      utcTimestampToDateString

      63 dependencies

      _addTidIfNecessary
      _assert
      _castAuth
      _createError
      _emulatorUrl
      _errorWithCustomMessage
      _fail
      _getBrowserName
      _getClientVersion
      _getCurrentScheme
      _getFinalTarget
      _getInstance
      _getPasswordPolicy
      _getUserLanguage
      _initializeAuthInstance
      _isAndroid
      _isBlackBerry
      _isChromeIOS
      _isFirefox
      _isHttpOrHttps
      _isIEMobile
      _isOnline
      _isSafari
      _isWebOS
      _loadJS
      _logError
      _logWarn
      _logoutIfInvalidated
      _makeTaggedError
      _parseEnforcementState
      _parseToken
      _performApiRequest
      _performFetchWithErrorHandling
      _performSignInRequest
      _persistenceKeyName
      _prodErrorMap
      _reloadWithoutSaving
      _tokenExpiresIn
      assertStringOrUndefined
      createErrorInternal
      debugAssert
      debugFail
      deleteAccount
      extractProviderData
      getAccountInfo
      getIdTokenResult
      getRecaptchaConfig
      getScriptParentElement
      getVersionForPlatform
      handleRecaptchaFlow
      injectRecaptchaFields
      isEnterprise
      isUserInvalidated
      linkEmailPassword
      mergeProviderData
      registerAuth
      reload
      requestStsToken
      secondsStringToMilliseconds
      signInWithEmailLink$1
      signInWithEmailLinkForLinking
      signInWithPassword
      utcTimestampToDateString

      + linkEmailPassword
      - updateEmailPassword

    • EmailAuthProvider

      Size

      TypeBase (12ad9f1)Merge (f762ef7)Diff
      size44.0 kB44.1 kB+59 B (+0.1%)
      size-with-ext-deps65.0 kB65.1 kB+59 B (+0.1%)

      Dependency

      TypeBase (12ad9f1)Merge (f762ef7)Diff
      functions

      65 dependencies

      _addTidIfNecessary
      _assert
      _castAuth
      _createError
      _emulatorUrl
      _errorWithCustomMessage
      _fail
      _getBrowserName
      _getClientVersion
      _getCurrentScheme
      _getFinalTarget
      _getInstance
      _getPasswordPolicy
      _getUserLanguage
      _initializeAuthInstance
      _isAndroid
      _isBlackBerry
      _isChromeIOS
      _isFirefox
      _isHttpOrHttps
      _isIEMobile
      _isOnline
      _isSafari
      _isWebOS
      _loadJS
      _logError
      _logWarn
      _logoutIfInvalidated
      _makeTaggedError
      _parseEnforcementState
      _parseToken
      _performApiRequest
      _performFetchWithErrorHandling
      _performSignInRequest
      _persistenceKeyName
      _prodErrorMap
      _reloadWithoutSaving
      _tokenExpiresIn
      assertStringOrUndefined
      createErrorInternal
      debugAssert
      debugFail
      deleteAccount
      extractProviderData
      getAccountInfo
      getIdTokenResult
      getRecaptchaConfig
      getScriptParentElement
      getVersionForPlatform
      handleRecaptchaFlow
      injectRecaptchaFields
      isEnterprise
      isUserInvalidated
      mergeProviderData
      parseDeepLink
      parseMode
      registerAuth
      reload
      requestStsToken
      secondsStringToMilliseconds
      signInWithEmailLink$1
      signInWithEmailLinkForLinking
      signInWithPassword
      updateEmailPassword
      utcTimestampToDateString

      65 dependencies

      _addTidIfNecessary
      _assert
      _castAuth
      _createError
      _emulatorUrl
      _errorWithCustomMessage
      _fail
      _getBrowserName
      _getClientVersion
      _getCurrentScheme
      _getFinalTarget
      _getInstance
      _getPasswordPolicy
      _getUserLanguage
      _initializeAuthInstance
      _isAndroid
      _isBlackBerry
      _isChromeIOS
      _isFirefox
      _isHttpOrHttps
      _isIEMobile
      _isOnline
      _isSafari
      _isWebOS
      _loadJS
      _logError
      _logWarn
      _logoutIfInvalidated
      _makeTaggedError
      _parseEnforcementState
      _parseToken
      _performApiRequest
      _performFetchWithErrorHandling
      _performSignInRequest
      _persistenceKeyName
      _prodErrorMap
      _reloadWithoutSaving
      _tokenExpiresIn
      assertStringOrUndefined
      createErrorInternal
      debugAssert
      debugFail
      deleteAccount
      extractProviderData
      getAccountInfo
      getIdTokenResult
      getRecaptchaConfig
      getScriptParentElement
      getVersionForPlatform
      handleRecaptchaFlow
      injectRecaptchaFields
      isEnterprise
      isUserInvalidated
      linkEmailPassword
      mergeProviderData
      parseDeepLink
      parseMode
      registerAuth
      reload
      requestStsToken
      secondsStringToMilliseconds
      signInWithEmailLink$1
      signInWithEmailLinkForLinking
      signInWithPassword
      utcTimestampToDateString

      + linkEmailPassword
      - updateEmailPassword

    • signInWithEmailAndPassword

      Size

      TypeBase (12ad9f1)Merge (f762ef7)Diff
      size45.7 kB45.7 kB+59 B (+0.1%)
      size-with-ext-deps66.7 kB66.8 kB+59 B (+0.1%)

      Dependency

      TypeBase (12ad9f1)Merge (f762ef7)Diff
      functions

      71 dependencies

      _addTidIfNecessary
      _assert
      _castAuth
      _createError
      _emulatorUrl
      _errorWithCustomMessage
      _fail
      _getBrowserName
      _getClientVersion
      _getCurrentScheme
      _getFinalTarget
      _getInstance
      _getPasswordPolicy
      _getUserLanguage
      _initializeAuthInstance
      _isAndroid
      _isBlackBerry
      _isChromeIOS
      _isFirefox
      _isHttpOrHttps
      _isIEMobile
      _isOnline
      _isSafari
      _isWebOS
      _loadJS
      _logError
      _logWarn
      _logoutIfInvalidated
      _makeTaggedError
      _parseEnforcementState
      _parseToken
      _performApiRequest
      _performFetchWithErrorHandling
      _performSignInRequest
      _persistenceKeyName
      _processCredentialSavingMfaContextIfNecessary
      _prodErrorMap
      _reloadWithoutSaving
      _signInWithCredential
      _tokenExpiresIn
      assertStringOrUndefined
      createErrorInternal
      debugAssert
      debugFail
      deleteAccount
      extractProviderData
      getAccountInfo
      getIdTokenResult
      getRecaptchaConfig
      getScriptParentElement
      getVersionForPlatform
      handleRecaptchaFlow
      injectRecaptchaFields
      isEnterprise
      isUserInvalidated
      mergeProviderData
      parseDeepLink
      parseMode
      providerIdForResponse
      recachePasswordPolicy
      registerAuth
      reload
      requestStsToken
      secondsStringToMilliseconds
      signInWithCredential
      signInWithEmailAndPassword
      signInWithEmailLink$1
      signInWithEmailLinkForLinking
      signInWithPassword
      updateEmailPassword
      utcTimestampToDateString

      71 dependencies

      _addTidIfNecessary
      _assert
      _castAuth
      _createError
      _emulatorUrl
      _errorWithCustomMessage
      _fail
      _getBrowserName
      _getClientVersion
      _getCurrentScheme
      _getFinalTarget
      _getInstance
      _getPasswordPolicy
      _getUserLanguage
      _initializeAuthInstance
      _isAndroid
      _isBlackBerry
      _isChromeIOS
      _isFirefox
      _isHttpOrHttps
      _isIEMobile
      _isOnline
      _isSafari
      _isWebOS
      _loadJS
      _logError
      _logWarn
      _logoutIfInvalidated
      _makeTaggedError
      _parseEnforcementState
      _parseToken
      _performApiRequest
      _performFetchWithErrorHandling
      _performSignInRequest
      _persistenceKeyName
      _processCredentialSavingMfaContextIfNecessary
      _prodErrorMap
      _reloadWithoutSaving
      _signInWithCredential
      _tokenExpiresIn
      assertStringOrUndefined
      createErrorInternal
      debugAssert
      debugFail
      deleteAccount
      extractProviderData
      getAccountInfo
      getIdTokenResult
      getRecaptchaConfig
      getScriptParentElement
      getVersionForPlatform
      handleRecaptchaFlow
      injectRecaptchaFields
      isEnterprise
      isUserInvalidated
      linkEmailPassword
      mergeProviderData
      parseDeepLink
      parseMode
      providerIdForResponse
      recachePasswordPolicy
      registerAuth
      reload
      requestStsToken
      secondsStringToMilliseconds
      signInWithCredential
      signInWithEmailAndPassword
      signInWithEmailLink$1
      signInWithEmailLinkForLinking
      signInWithPassword
      utcTimestampToDateString

      + linkEmailPassword
      - updateEmailPassword

    • signInWithEmailLink

      Size

      TypeBase (12ad9f1)Merge (f762ef7)Diff
      size45.7 kB45.7 kB+59 B (+0.1%)
      size-with-ext-deps66.7 kB66.8 kB+59 B (+0.1%)

      Dependency

      TypeBase (12ad9f1)Merge (f762ef7)Diff
      functions

      71 dependencies

      _addTidIfNecessary
      _assert
      _castAuth
      _createError
      _emulatorUrl
      _errorWithCustomMessage
      _fail
      _getBrowserName
      _getClientVersion
      _getCurrentScheme
      _getCurrentUrl
      _getFinalTarget
      _getInstance
      _getPasswordPolicy
      _getUserLanguage
      _initializeAuthInstance
      _isAndroid
      _isBlackBerry
      _isChromeIOS
      _isFirefox
      _isHttpOrHttps
      _isIEMobile
      _isOnline
      _isSafari
      _isWebOS
      _loadJS
      _logError
      _logWarn
      _logoutIfInvalidated
      _makeTaggedError
      _parseEnforcementState
      _parseToken
      _performApiRequest
      _performFetchWithErrorHandling
      _performSignInRequest
      _persistenceKeyName
      _processCredentialSavingMfaContextIfNecessary
      _prodErrorMap
      _reloadWithoutSaving
      _signInWithCredential
      _tokenExpiresIn
      assertStringOrUndefined
      createErrorInternal
      debugAssert
      debugFail
      deleteAccount
      extractProviderData
      getAccountInfo
      getIdTokenResult
      getRecaptchaConfig
      getScriptParentElement
      getVersionForPlatform
      handleRecaptchaFlow
      injectRecaptchaFields
      isEnterprise
      isUserInvalidated
      mergeProviderData
      parseDeepLink
      parseMode
      providerIdForResponse
      registerAuth
      reload
      requestStsToken
      secondsStringToMilliseconds
      signInWithCredential
      signInWithEmailLink
      signInWithEmailLink$1
      signInWithEmailLinkForLinking
      signInWithPassword
      updateEmailPassword
      utcTimestampToDateString

      71 dependencies

      _addTidIfNecessary
      _assert
      _castAuth
      _createError
      _emulatorUrl
      _errorWithCustomMessage
      _fail
      _getBrowserName
      _getClientVersion
      _getCurrentScheme
      _getCurrentUrl
      _getFinalTarget
      _getInstance
      _getPasswordPolicy
      _getUserLanguage
      _initializeAuthInstance
      _isAndroid
      _isBlackBerry
      _isChromeIOS
      _isFirefox
      _isHttpOrHttps
      _isIEMobile
      _isOnline
      _isSafari
      _isWebOS
      _loadJS
      _logError
      _logWarn
      _logoutIfInvalidated
      _makeTaggedError
      _parseEnforcementState
      _parseToken
      _performApiRequest
      _performFetchWithErrorHandling
      _performSignInRequest
      _persistenceKeyName
      _processCredentialSavingMfaContextIfNecessary
      _prodErrorMap
      _reloadWithoutSaving
      _signInWithCredential
      _tokenExpiresIn
      assertStringOrUndefined
      createErrorInternal
      debugAssert
      debugFail
      deleteAccount
      extractProviderData
      getAccountInfo
      getIdTokenResult
      getRecaptchaConfig
      getScriptParentElement
      getVersionForPlatform
      handleRecaptchaFlow
      injectRecaptchaFields
      isEnterprise
      isUserInvalidated
      linkEmailPassword
      mergeProviderData
      parseDeepLink
      parseMode
      providerIdForResponse
      registerAuth
      reload
      requestStsToken
      secondsStringToMilliseconds
      signInWithCredential
      signInWithEmailLink
      signInWithEmailLink$1
      signInWithEmailLinkForLinking
      signInWithPassword
      utcTimestampToDateString

      + linkEmailPassword
      - updateEmailPassword

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/tuynqRdzMu.html

@renkelvin renkelvin marked this pull request as ready for review October 16, 2023 03:42
@renkelvin renkelvin requested review from lisajian, prameshj, sam-gc and a team as code owners October 16, 2023 03:42
@renkelvin
Copy link
Author

@prameshj please take a look.

Copy link
Contributor

@prameshj prameshj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this!

@renkelvin renkelvin requested review from a team as code owners October 27, 2023 23:56
@github-actions
Copy link
Contributor

github-actions bot commented Oct 30, 2023

Changeset File Check ✅

  • No modified packages are missing from the changeset file.
  • No changeset formatting errors detected.

@renkelvin renkelvin changed the base branch from master to WebOTP October 30, 2023 17:57
@renkelvin renkelvin changed the base branch from WebOTP to master October 30, 2023 17:57
@renkelvin
Copy link
Author

Hey @hsubox76 , could you help take a look? Thanks!

Copy link
Contributor

@hsubox76 hsubox76 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it's just unit tests and doesn't need a release, I don't think it needs a changeset.

@renkelvin renkelvin merged commit ff1a6ec into master Nov 1, 2023
@renkelvin renkelvin deleted the re-tests branch November 1, 2023 20:45
prameshj pushed a commit that referenced this pull request Nov 13, 2023
@firebase firebase locked and limited conversation to collaborators Dec 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants