oruga icon indicating copy to clipboard operation
oruga copied to clipboard

feat: vue 3 testing

Open astagi opened this issue 3 years ago • 1 comments
trafficstars

Proposed Changes

  • Cypress component testing for Oruga Next

astagi avatar Mar 09 '22 22:03 astagi

Codecov Report

Base: 66.31% // Head: 63.43% // Decreases project coverage by -2.87% :warning:

Coverage data is based on head (10b73dc) compared to base (69a3d0f). Patch coverage: 44.44% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #312      +/-   ##
===========================================
- Coverage    66.31%   63.43%   -2.88%     
===========================================
  Files           64       79      +15     
  Lines         4497     5467     +970     
  Branches      1182     1513     +331     
===========================================
+ Hits          2982     3468     +486     
- Misses        1413     1897     +484     
  Partials       102      102              
Flag Coverage Δ
oruga 66.31% <ø> (?)
oruga-next 50.10% <44.44%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/oruga-next/src/utils/FormElementMixin.ts 62.31% <0.00%> (ø)
...es/oruga-next/src/components/checkbox/Checkbox.vue 89.47% <33.33%> (ø)
packages/oruga-next/src/components/input/Input.vue 53.92% <60.00%> (ø)
packages/oruga-next/src/utils/CheckRadioMixin.ts 63.63% <0.00%> (ø)
packages/oruga-next/src/utils/helpers.ts 9.03% <0.00%> (ø)
packages/oruga-next/src/utils/config.ts 54.54% <0.00%> (ø)
...ages/oruga-next/src/components/field/FieldBody.vue 6.25% <0.00%> (ø)
packages/oruga-next/src/utils/icons.ts 90.90% <0.00%> (ø)
...-next/src/components/autocomplete/Autocomplete.vue 52.05% <0.00%> (ø)
packages/oruga-next/src/components/icon/Icon.vue 75.51% <0.00%> (ø)
... and 8 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Mar 09 '22 22:03 codecov[bot]

Deploy Preview for oruga-documentation-preview ready!

Name Link
Latest commit 10b73dca91d8698f2e2a525e859a1e2d81447936
Latest deploy log https://app.netlify.com/sites/oruga-documentation-preview/deploys/63ae0a6c87eb3700094d49be
Deploy Preview https://deploy-preview-312--oruga-documentation-preview.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Nov 03 '22 21:11 netlify[bot]

Problems I was experiencing:

  • trying to build npx lerna run build:lib --parallel --scope @oruga-ui/oruga-next I get
[!] (plugin rpt2) Error: oruga/packages/oruga-next/src/components/inputitems/Inputitems.vue?vue&type=script&lang.ts(155,39): semantic error TS2339: Property 'modelValue' does not exist on type 'never'.
  The intersection 'CreateComponentPublicInstance<Readonly<ExtractPropTypes<{ modelValue: ArrayConstructor; size: StringConstructor; data: { type: ArrayConstructor; default: () => any[]; }; variant: StringConstructor; ... 28 more ...; autocompleteClasses: { ...; }; }>> & { ...; }, ... 16 more ..., { ...; } & { ...; }>' was reduced to 'never' because property 'autocomplete' has conflicting types in some constituents.
src/components/inputitems/Inputitems.vue?vue&type=script&lang.ts
Error: /Users/andreastagi/w/oruga/packages/oruga-next/src/components/inputitems/Inputitems.vue?vue&type=script&lang.ts(155,39): semantic error TS2339: Property 'modelValue' does not exist on type 'never'.
  The intersection 'CreateComponentPublicInstance<Readonly<ExtractPropTypes<{ modelValue: ArrayConstructor; size: StringConstructor; data: { type: ArrayConstructor; default: () => any[]; }; variant: StringConstructor; ... 28 more ...; autocompleteClasses: { ...; }; }>> & { ...; }, ... 16 more ..., { ...; } & { ...; }>' was reduced to 'never' because property 'autocomplete' has conflicting types in some constituents.

After updating TS, Rollup and its plugins I understood the problem and fixed in https://github.com/oruga-ui/oruga/pull/312/commits/782cde8ede34f5a51cc99d5b5ed4457d8766147d

Explanation: we were trying to mix FormElementMixin with InputItems, both have autocomplete prop with different types (and different purpose)! Ref: https://github.com/microsoft/TypeScript/issues/3375#issuecomment-109018799.

As @jtommy suggested we need to make a breaking change and use a different name for InputItems autocomplete prop.

Thanks @D4RKAR117 for introducing me Volar!

astagi avatar Nov 28 '22 19:11 astagi

Problem I'm still experiencing: trying to run vue-tsc checks I still get a lot of issues (many of them related to type never) (https://github.com/oruga-ui/oruga/actions/runs/3569490839/jobs/5999504792). We need to investigate further.

astagi avatar Nov 28 '22 23:11 astagi