quasarframework / quasar-testing

Testing Harness App Extensions for the Quasar Framework 2.0+
https://testing.quasar.dev
MIT License
180 stars 65 forks source link

"addnotification is not a function" when using create from the Notify plugin #201

Closed frisch-raphael closed 2 years ago

frisch-raphael commented 2 years ago

Software version

Currently using

    "@quasar/app": "^3.0.0",
    "@quasar/quasar-app-extension-testing": "^2.0.0-beta.3",
    "@quasar/quasar-app-extension-testing-e2e-cypress": "^4.0.0-beta.9",
    "@quasar/quasar-app-extension-testing-unit-jest": "^3.0.0-alpha.7",

What did you get as the error?

I'm using cypress to do component testing. When I mount a component that uses the create function from the Notify plugin, I get the following error: image Everything works perfectly when doing e2e tests.

What steps did you take, to get the error?

Install the unit test AE Install Notify Mount a component that uses the create function If needed I can create a repository, or I can try to dig myself if you tell me where to look at

IlCallo commented 2 years ago

To start, update @quasar/quasar-app-extension-testing to its stable release, since the new version exited beta some months ago Could you create a repro for me? Have you used installQuasarPlugin to register Notify plugin?

You can find it used into test/cypress/support/unit, by default we only scaffold it registering Dialog plugin as example You'd need to change it as

import { Dialog, Notify } from 'quasar';

installQuasarPlugin({ plugins: { Dialog, Notify } });

Component testing only mount the bare minimum of Quasar goodies, as opposed to e2e tests which load your full app, and you're in charge of registering what you actually use

frisch-raphael commented 2 years ago

Hi @IlCallo,

You're absolutly right. It should have been obvious that it had to do with installQuasarPlugin but it somehow did not occur to me. Thanks for the quick and effective answer.