test: migrate FilesList header specs to testing Pinia - #7945
Conversation
Signed-off-by: ColumbusLabs <287001685+ColumbusLabs@users.noreply.github.com>
vitormattos
left a comment
There was a problem hiding this comment.
Thanks for the contribution! The migration in FilesListTableHeaderButton.spec.ts is mostly aligned with the issue, but I think the PR needs another simplification pass.
The current diff is quite large for migrating only two test suites. Please keep the changes focused on:
- replacing real Pinia with
createTestingPinia(); - providing pre-mount state through
initialState; - selectively preserving only the action behavior required by existing tests;
- using Testing Pinia action spies where the test only verifies a call.
Please avoid unrelated restructuring, additional local abstractions, or cleanup that is not required by the migration. The existing test intent and behavioral coverage should remain unchanged.
The main blocking point is the suite-wide stubActions: false, because it executes substantially more real store behavior than these component tests require.
Please compare the final diff with main and revert any new local types, JSDoc, helper structure, or test rewrites that are not strictly required for the createTestingPinia() migration. The resulting diff should be materially smaller than the current one and should satisfy every acceptance criterion from issue #7940.
Signed-off-by: ColumbusLabs <287001685+ColumbusLabs@users.noreply.github.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
|
/backport to stable34 |
|
/backport to stable33 |
|
/backport to stable32 |
vitormattos
left a comment
There was a problem hiding this comment.
Thanks! The previous review points have been addressed.
|
The backport to # Switch to the target branch and update it
git checkout stable32
git pull origin stable32
# Create the new backport branch
git checkout -b backport/7945/stable32
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 54e03932 bca74aae
# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/7945/stable32Error: Failed to push branch backport/7945/stable32: remote: Invalid username or token. Password authentication is not supported for Git operations. Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports. |
|
/backport to stable32 |
Resolves: #7940
📝 Summary
createTestingPinia()initialStatefor sorting, file, and selection scenarios🧪 How to test
npm run ts:check npx vitest run \ src/tests/views/FilesList/FilesListTableHeaderButton.spec.ts \ src/tests/views/FilesList/FilesListTableHeader.spec.ts npm run lint npm testLocal results with Node 24.18.0:
✅ Checklist
🤖 AI (if applicable)
OpenAI Codex assisted with repository inspection, the test migration, and verification. I reviewed the changes and take responsibility for the submission.