Skip to content

test: migrate FilesList header specs to testing Pinia - #7945

Merged
vitormattos merged 2 commits into
LibreSign:mainfrom
ColumbusLabs:test/7940-testing-pinia
Jul 23, 2026
Merged

test: migrate FilesList header specs to testing Pinia#7945
vitormattos merged 2 commits into
LibreSign:mainfrom
ColumbusLabs:test/7940-testing-pinia

Conversation

@ColumbusLabs

Copy link
Copy Markdown
Contributor

Resolves: #7940

📝 Summary

  • migrate the FilesList table header component tests from real Pinia instances to createTestingPinia()
  • provide isolated store state through initialState for sorting, file, and selection scenarios
  • keep sorting actions stubbed when tests only verify calls
  • preserve real file and selection action behavior where rendering or state transitions are under test

🧪 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 test

Local results with Node 24.18.0:

  • 31/31 affected tests passed
  • 3,040/3,040 frontend tests passed
  • TypeScript check passed
  • ESLint passed

✅ Checklist

  • I have read and followed the contribution guide.
  • The change is limited to the two test suites named in the issue.
  • Existing test intent and application behavior are preserved.
  • The commit includes the required DCO sign-off.

🤖 AI (if applicable)

  • The content of this PR was partially or fully generated using AI

OpenAI Codex assisted with repository inspection, the test migration, and verification. I reviewed the changes and take responsibility for the submission.

Signed-off-by: ColumbusLabs <287001685+ColumbusLabs@users.noreply.github.com>
@github-project-automation github-project-automation Bot moved this to 0. Needs triage in Roadmap Jul 22, 2026

@vitormattos vitormattos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/tests/views/FilesList/FilesListTableHeader.spec.ts Outdated
Comment thread src/tests/views/FilesList/FilesListTableHeader.spec.ts Outdated
@github-project-automation github-project-automation Bot moved this from 0. Needs triage to 1. to do in Roadmap Jul 23, 2026
Signed-off-by: ColumbusLabs <287001685+ColumbusLabs@users.noreply.github.com>
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
see 173 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vitormattos

Copy link
Copy Markdown
Member

/backport to stable34

@vitormattos

Copy link
Copy Markdown
Member

/backport to stable33

@vitormattos

Copy link
Copy Markdown
Member

/backport to stable32

@vitormattos vitormattos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! The previous review points have been addressed.

@vitormattos
vitormattos merged commit d426966 into LibreSign:main Jul 23, 2026
64 checks passed
@github-project-automation github-project-automation Bot moved this from 1. to do to 4. to release in Roadmap Jul 23, 2026
@backportbot-libresign

Copy link
Copy Markdown

The backport to stable32 failed. Please do this backport manually.

# 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/stable32

Error: Failed to push branch backport/7945/stable32: remote: Invalid username or token. Password authentication is not supported for Git operations.
fatal: Authentication failed for 'https://github.com/LibreSign/libresign.git/'


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@vitormattos

Copy link
Copy Markdown
Member

/backport to stable32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 4. to release

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Migrate FilesList table header tests to createTestingPinia()

3 participants