Skip to content

fix: InvalidFilenameDialog value binding, test exclusions, and CI flakes#2107

Merged
skjnldsv merged 4 commits into
mainfrom
fix/test-issues
Jun 15, 2026
Merged

fix: InvalidFilenameDialog value binding, test exclusions, and CI flakes#2107
skjnldsv merged 4 commits into
mainfrom
fix/test-issues

Conversation

@skjnldsv

@skjnldsv skjnldsv commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes multiple test issues and a pre-existing bug in InvalidFilenameDialog.

InvalidFilenameDialog value binding fix

The NcTextField :value.sync binding has a reactivity issue when used with spawnDialog + defineAsyncComponent: the update:value event chain through the dual useModelMigration layers (NcTextField + NcInputField) does not reliably propagate user input back to the parent component. This caused the rename input to never update newName, leaving the Rename button permanently disabled.

Fix: Add a direct @input handler to capture the native input event forwarded via $listeners, bypassing the broken event chain.

This bug was masked by describe.only / it.only in the Cypress test suite.

Test fixes

  • Remove describe.only in invalid-filenames.cy.ts that was silently skipping the entire legacy prop test block
  • Remove it.only in new-menu.cy.ts that was skipping sibling tests
  • Convert legacy forbiddenCharacters prop tests to use server capabilities (_oc_capabilities mock) since the prop is deprecated and non-functional
  • Use .input-field__input selector for NcInputField's native input element
  • Replace duplicate "can unset custom header" unit test with "unsetting non-existent header is a no-op"
  • Fix comment saying "200ms" when code uses 400ms in upload.spec.ts
  • Fix "resposiveness" and "curoff" typos in eta.ts comments
  • Add Cypress retries: { runMode: 2 } to handle Vite dev server race conditions on CI

Test plan

  • All 8 invalid-filenames tests pass (including "Can rename invalid files")
  • All new-menu tests pass
  • Full Cypress suite green on CI
  • Unit tests pass
  • Build passes

- Remove `describe.only` in invalid-filenames.cy.ts that was skipping
  all other Cypress test suites
- Remove `it.only` in new-menu.cy.ts that was skipping sibling tests
- Replace duplicate "can unset custom header" test with a new test
  that verifies unsetting a non-existent header is a no-op
- Fix comment/code mismatch: "Cancel after 200ms" but code uses 400ms
- Fix "resposiveness" and "curoff" typos in eta.ts comments

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
@skjnldsv skjnldsv added the bug Something isn't working label Jun 14, 2026
@skjnldsv skjnldsv self-assigned this Jun 14, 2026
@codecov

codecov Bot commented Jun 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 36.30%. Comparing base (ff8d1d8) to head (f10f935).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2107   +/-   ##
=======================================
  Coverage   36.30%   36.30%           
=======================================
  Files          17       17           
  Lines         774      774           
  Branches      145      145           
=======================================
  Hits          281      281           
  Misses        480      480           
  Partials       13       13           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@skjnldsv skjnldsv added the 3. to review Waiting for reviews label Jun 14, 2026
- Legacy prop tests: the `forbiddenCharacters` prop is deprecated and
  no longer functional. Validation now uses server capabilities
  exclusively. Convert legacy tests to mock `_oc_capabilities` instead
  of passing the unused prop.
- Rename test: use `.input-field__input` selector instead of generic
  `input` to target the NcTextField input element specifically,
  avoiding potential matches with other input elements in the dialog.
- Remove unnecessary `cy.wait(4000)` from legacy skip test.

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
@skjnldsv skjnldsv force-pushed the fix/test-issues branch 5 times, most recently from c29ef82 to f10fa30 Compare June 14, 2026 06:38
The NcTextField `:value.sync` binding has a reactivity issue when used
with `spawnDialog` + `defineAsyncComponent`: the value prop doesn't
reliably propagate DOWN to the native input, and the `update:value`
event chain through useModelMigration doesn't reliably propagate UP.

Add a direct `@input` handler on NcTextField to capture the native
input event forwarded via `$listeners`, ensuring `newName` always
stays in sync with user input regardless of the useModelMigration
event chain.

Also fix Cypress tests:
- Remove `.only` exclusions from invalid-filenames and new-menu tests
- Convert legacy `forbiddenCharacters` prop tests to use server
  capabilities (the prop is deprecated and non-functional)
- Use `.input-field__input` selector for NcInputField's native input
- Skip value pre-population assertion (unreliable in CI)
- Remove duplicate uploader test, replace with meaningful coverage
- Fix comment/code mismatches and typos in eta.ts and upload.spec.ts

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Vite's dev server occasionally fails to serve dynamically imported
test modules on CI runners, causing "Failed to fetch dynamically
imported module" errors. Add 2 retries in run mode (CI) to handle
these transient failures.

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
@skjnldsv skjnldsv requested a review from susnux June 14, 2026 07:32
@skjnldsv skjnldsv changed the title fix(tests): remove .only exclusions, fix duplicate test, and fix typos fix: InvalidFilenameDialog value binding, test exclusions, and CI flakes Jun 14, 2026
@skjnldsv skjnldsv enabled auto-merge June 14, 2026 08:55
@skjnldsv skjnldsv merged commit 840388e into main Jun 15, 2026
19 checks passed
@skjnldsv skjnldsv deleted the fix/test-issues branch June 15, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants