spreed icon indicating copy to clipboard operation
spreed copied to clipboard

feat(vue3): fix automated tests

Open Antreesy opened this issue 1 year ago • 1 comments

☑️ Resolves

  • Ref #9448
  • Fix #12363
    • Migrate to vue-test-utils v2 (https://test-utils.vuejs.org/migration/)
    • Disable tests for @nextcloud/dialogs and nextcloud/upload
    • Rest tests are working

🖌️ UI Checklist

🖼️ Screenshots / Screencasts

image

🚧 Tasks

  • [ ] Bring back tests for components when nextcloud/vue lib is migrated
  • [ ] Uninstall flush-promises

Antreesy avatar May 15 '24 15:05 Antreesy

Note, you don't need to always import t in components for tests, it is not required. We can setup component's globals in the mount function, including installing plugins: See:

  • mountOptions.global.plugins to install plugins: https://test-utils.vuejs.org/api/#global
  • config.global to make it globally: https://test-utils.vuejs.org/api/#config-global

ShGKme avatar May 19 '24 21:05 ShGKme

Can you describe the fix(vue3): fix double emitting commit?

ShGKme avatar May 27 '24 14:05 ShGKme

Can you describe the fix(vue3): fix double emitting commit?

As was discussed in the office: Vue2 and Vue3 behave differently at this moment:

  • in Vue 2 component is destroyed before bubbling event is triggered
  • in Vue 3 event bubbles, (and fires twice), then got destroyed

Antreesy avatar May 28 '24 17:05 Antreesy