You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a Quasar app extension that provides UI components that extend Quasar components, the components exhibit mixed behaviour when run inside a Vitest testing environment (which they do not exhibit when simply used in a host app).
Example
Writing a simple test that uses q-btn to increment a counter with clicks works fine and tests pass. However, switching these components with ones from an AE's UI Kit (i.e. my-button) that do nothing but return a q-btn from their render function causes the click function to no longer get called properly. Similarly, a q-btn-dropdown works fine and tests pass but a custom my-button-dropdown that simply returns a q-btn-dropdown causes a strange error that seems to originate from the Platform plugin.
Install dependencies and build the ui portion of the quasar-test-ui repo using npm run build
Ensure the quasar-test-ui repo is properly linked as a dependency in the quasar-test-app and install dependencies
Run npm run test:unit in the quasar-test-app and play around with the examples commented in/out under the tests/vitest/* directory (switch q-btn for my-button, q-btn-dropdown for my-button-dropdown, etc)
The text was updated successfully, but these errors were encountered:
Description
When using a Quasar app extension that provides UI components that extend Quasar components, the components exhibit mixed behaviour when run inside a Vitest testing environment (which they do not exhibit when simply used in a host app).
Example
Writing a simple test that uses
q-btn
to increment a counter with clicks works fine and tests pass. However, switching these components with ones from an AE's UI Kit (i.e.my-button
) that do nothing but return aq-btn
from their render function causes the click function to no longer get called properly. Similarly, aq-btn-dropdown
works fine and tests pass but a custommy-button-dropdown
that simply returns aq-btn-dropdown
causes a strange error that seems to originate from the Platform plugin.From app extension's UI Kit:
Simple test case in host app using Vitest
The test for this case:
results in:
or this with
q-btn-dropdown
case:Reproduction
This issue spans two repos: one for the app extension/UI kit, and another for the Vitest test case that uses the component from the UI kit.
To reproduce:
ui
portion of thequasar-test-ui
repo usingnpm run build
quasar-test-ui
repo is properly linked as a dependency in thequasar-test-app
and install dependenciesnpm run test:unit
in thequasar-test-app
and play around with the examples commented in/out under thetests/vitest/*
directory (switchq-btn
formy-button
,q-btn-dropdown
formy-button-dropdown
, etc)The text was updated successfully, but these errors were encountered: