Skip to content

Add tests for the file list modes & add some auto collapse logic for the tree view #8342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 30, 2025

Conversation

estib-vega
Copy link
Contributor

Description

  • Added Cypress tests for toggling between list and tree view modes in the file list.
  • Created a new mock scenario with many file changes to simulate addition, deletion, modification, and renaming.
  • Enhanced mock backend with helpers for top-level directories/files and typeguards for file tree testing.
  • Introduced new test IDs for file list and tree components to improve test reliability.
  • Improved file tree node expansion logic with auto-collapse based on depth and child count.
  • Updated components to use keyed each blocks and pass testId props for better test targeting.

Adds a test to verify toggling between list and tree view in the file list.
- Add lotsOfFileChanges.ts scenario for simulating many file changes
- Add helpers and mock data for addition, deletion, modification, and rename tree changes in mock/changes.ts
Add helpers for top-level dirs/files and import typeguard for file tree scenarios.
Add UncommittedChanges_Header, FileListModeOption, and FileListTreeFolder to testIds.ts.
- Add test IDs to file list and tree Svelte components
- Improve file tree node expansion logic based on depth and child count
- Use keyed each blocks for children
- Pass testId prop through relevant components
Copy link

vercel bot commented Apr 30, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
gitbutler-components ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 30, 2025 10:15am
gitbutler-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 30, 2025 10:15am

@estib-vega
Copy link
Contributor Author

@Byron this is more of a band-aid fix, for now.

In the near future, the FE should virtualize the file-tree view

@estib-vega estib-vega merged commit 8b1cc22 into master Apr 30, 2025
19 of 20 checks passed
@estib-vega estib-vega deleted the test-file-list-modes branch April 30, 2025 10:15
@Byron
Copy link
Collaborator

Byron commented May 2, 2025

Actually, band-aid or not, it works perfectly (on the latest master), and I can open my GitLab repository without a hitch basically!

Screen.Recording.2025-05-02.at.07.31.08.mov

Thank you! 🙏

@estib-vega
Copy link
Contributor Author

Actually, band-aid or not, it works perfectly (on the latest master), and I can open my GitLab repository without a hitch basically!

Screen.Recording.2025-05-02.at.07.31.08.mov
Thank you! 🙏

Very glad to hear that! :)

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

Successfully merging this pull request may close these issues.

2 participants