-
Notifications
You must be signed in to change notification settings - Fork 1
Migrate to ng-mock
#883
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
base: main
Are you sure you want to change the base?
Migrate to ng-mock
#883
Conversation
555318f to
245fe0f
Compare
08b325a to
c3c009b
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #883 +/- ##
==========================================
+ Coverage 47.13% 47.85% +0.72%
==========================================
Files 372 351 -21
Lines 11495 11292 -203
Branches 1913 1888 -25
==========================================
- Hits 5418 5404 -14
+ Misses 5889 5695 -194
- Partials 188 193 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Replace shallow-render with ng-mocks for Angular component testing. ng-mocks provides better TypeScript support and more flexible mocking capabilities. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
It passes! I'm going to have Claude attempt to organize things into better clumps of commits that we can review in pieces, and then it's possible would still want to squash them into changes. |
- Replace shallow-render configuration with ng-mocks equivalents
- Add ngMocks.autoSpy('jasmine') for automatic spy creation
- Configure globalReplace for RouterModule -> RouterTestingModule
- Add globalKeep for NgBootstrap modules and CountUp directive
- Add custom Jasmine matchers (toHaveFoundOne, toHaveFound) for
ng-mocks compatibility with existing test assertions
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Migrate button, checkbox, form-input, and toggle component tests from shallow-render to ng-mocks using MockBuilder and TestBed patterns. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Migrate auth and login component tests from shallow-render to ng-mocks. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Migrate android-app-notify and announcement component tests from shallow-render to ng-mocks. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Migrate manage-metadata and all subcomponent tests (category-add, category-edit, form-create, form-edit, value-add, value-edit) from shallow-render to ng-mocks. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Migrate account-settings, advanced-settings, archive-settings-dialog, billing-settings, gift-storage, invitations-dialog, manage-tags, public-settings, redeem-gift, storage-dialog, two-factor-auth, and upload-progress component tests from shallow-render to ng-mocks. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Migrate directive-display, directive-edit, legacy-contact-display, and legacy-contact-edit component tests from shallow-render to ng-mocks. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Migrate edit-tags, file-viewer, publish, sharing-dialog, and sidebar component tests from shallow-render to ng-mocks. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Migrate featured-archive, gallery-header, gallery, and public-archives-list component tests from shallow-render to ng-mocks. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Migrate all onboarding component tests from shallow-render to ng-mocks, including archive-creation-with-share, create-new-archive, glam-pending-archives, all glam subcomponents, header, onboarding, and welcome-screen. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Migrate new-pledge, public-archive, and search-box component tests from shallow-render to ng-mocks. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Migrate mobile-banner, new-archive-form, thumbnail, and zooming-image-viewer component tests from shallow-render to ng-mocks. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Migrate account.service, refreshAccount, device.service, event.service, mobile-banner.service, and profile.service tests from shallow-render to ng-mocks. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Migrate task-icon and user-checklist component tests from shallow-render to ng-mocks. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
c3c009b to
804017f
Compare
This PR removes our use of
shallow-renderand replaces it withng-mockwhich is a commonly used mocking library with more community support.This is an extensive set of changes, so it's broken into smaller parts for easier review; ultimately, however, we will want to squash the commits into a single migration commit.
Resolves #879