Skip to content
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

[tests-only] set user object in LocationPicker unit tests #6420

Conversation

individual-it
Copy link
Member

Description

give the test a user id, so that it does not try to get it from undefined
that line was added in #6287
@janackermann is it OK to mock the user that way and reuse the existing object in getStore?

Related Issue

part of #6337

Motivation and Context

get rid of error logs during unit test runs

    console.error
      [Vue warn]: Error in v-on handler (Promise/async): "TypeError: Cannot read property 'id' of undefined"

      found in

      ---> <OcButton>
             <OcGrid>
               <Anonymous>
                 <Root>

      at warn (node_modules/vue/dist/vue.runtime.common.dev.js:621:15)
      at logError (node_modules/vue/dist/vue.runtime.common.dev.js:1889:5)
      at globalHandleError (node_modules/vue/dist/vue.runtime.common.dev.js:1884:3)
      at handleError (node_modules/vue/dist/vue.runtime.common.dev.js:1844:5)
      at node_modules/vue/dist/vue.runtime.common.dev.js:1861:39

    console.error
      TypeError: Cannot read property 'id' of undefined

How Has This Been Tested?

  • run unit tests locally
  • 🤖

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Open tasks:

  • ...

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@kulmann kulmann merged commit ef95737 into master Feb 11, 2022
@delete-merged-branch delete-merged-branch bot deleted the reduceLogOutput/web-app-files/tests/unit/views/LocationPicker.spec.js branch February 11, 2022 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants