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

feat: Vue unit tests - remove hard requirement of a navManager injection when not using any navigation #22506

Closed
kensodemann opened this issue Nov 16, 2020 · 2 comments · Fixed by #22532
Labels
package: vue @ionic/vue package type: bug a confirmed bug report
Milestone

Comments

@kensodemann
Copy link
Member

Feature Request

Ionic version:

[x] 5.x

Describe the Feature Request
When doing unit testing with @ionic/vue, provide a way to not have to mount a component with the router if the component is not actually using any routing.

Currently, the following warning is raised in these situations:

  console.warn node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:40
    [Vue warn]: injection "navManager" not found.
      at <Anonymous>
      at <Anonymous size="3" key=7 >
      at <Anonymous class="ion-align-items-stretch" key=1 >
      at <Anonymous>
      at <Anonymous fullscreen=true >
      at <IonPage>
      at <Tea ref="VTU_COMPONENT" >
      at <VTUROOT>

Related Code
The following tests raise the above warning:
https://github.com/kensodemann/tea-taster-vue/blob/main/tests/unit/views/Tea.spec.ts

However, the code itself is not (yet) doing any routing:

            <ion-card>
              <ion-img :src="tea.image"></ion-img>
              <ion-card-header>
                <ion-card-title>{{ tea.name }}</ion-card-title>
              </ion-card-header>
              <ion-card-content> {{ tea.description }} </ion-card-content>
            </ion-card>
@liamdebeasi
Copy link
Contributor

Resolved via #22532

liamdebeasi added a commit that referenced this issue Nov 23, 2020
@ionitron-bot
Copy link

ionitron-bot bot commented Dec 23, 2020

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Dec 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: vue @ionic/vue package type: bug a confirmed bug report
Projects
None yet
2 participants