mirror of
https://github.com/ever-co/ever-gauzy.git
synced 2026-10-02 01:54:50 +08:00
test: app-wide TestBed defaults for the Angular projects; fix their stub specs (WIP)
Once the Angular suites loaded, most failures were CLI-generated `should create` stubs that had never run, failing on the first injection (TranslateService, NbToastrService, NbDialogRef, ActivatedRoute, the translate pipe, the default icon pack). - jest.angular-defaults.ts (setupFilesAfterEnv, after each project's test-setup): a top-level beforeEach adds what the app's root module provides - TranslateModule.forRoot, the Nebular forRoot modules, NgxPermissionsModule.forRoot, the Tabler/eva icon pack, HttpClient testing, router, noop animations, a NbDialogRef stub, GAUZY_ENV - and a matchMedia stand-in (jsdom has none). configureTestingModule merges, so a spec's own providers still win. It imports no ui-core/core: that would cache real modules a spec later jest.mock()s. - jest.preset.js maps dayjs/esm (imported by ngx-daterangepicker-material's .mjs bundle) to dayjs's CommonJS build. - Specs of non-standalone components import the NgModule that declares them, provide what the host feature module provides (EmployeesService, AuthService, NbAuthModule.forRoot, PipesModule), and set the inputs / route data / date-picker config the app always supplies before render. - Two stubs imported classes their files do not export (GauzyRangePickerComponent, ViewComponent) and declared `undefined`. - desktop-ui-lib's test-setup installs an inert `window.electronAPI` preload bridge of the shape apps/agent exposes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
02c4289f5f
commit
d3d8687ac1
Reference in New Issue
Block a user