mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	Chore: update to Angular v18 (#7106)
This commit is contained in:
		| @@ -77,7 +77,6 @@ | ||||
|             "scripts": [], | ||||
|             "allowedCommonJsDependencies": [ | ||||
|               "ng2-pdf-viewer", | ||||
|               "filesize", | ||||
|               "file-saver" | ||||
|             ], | ||||
|             "vendorChunk": true, | ||||
|   | ||||
							
								
								
									
										5081
									
								
								src-ui/package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										5081
									
								
								src-ui/package-lock.json
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -11,17 +11,17 @@ | ||||
|   }, | ||||
|   "private": true, | ||||
|   "dependencies": { | ||||
|     "@angular/cdk": "^17.3.10", | ||||
|     "@angular/common": "~17.3.9", | ||||
|     "@angular/compiler": "~17.3.9", | ||||
|     "@angular/core": "~17.3.9", | ||||
|     "@angular/forms": "~17.3.9", | ||||
|     "@angular/localize": "~17.3.9", | ||||
|     "@angular/platform-browser": "~17.3.9", | ||||
|     "@angular/platform-browser-dynamic": "~17.3.9", | ||||
|     "@angular/router": "~17.3.9", | ||||
|     "@ng-bootstrap/ng-bootstrap": "^16.0.0", | ||||
|     "@ng-select/ng-select": "^12.0.7", | ||||
|     "@angular/cdk": "^18.0.3", | ||||
|     "@angular/common": "~18.0.3", | ||||
|     "@angular/compiler": "~18.0.3", | ||||
|     "@angular/core": "~18.0.3", | ||||
|     "@angular/forms": "~18.0.3", | ||||
|     "@angular/localize": "~18.0.3", | ||||
|     "@angular/platform-browser": "~18.0.3", | ||||
|     "@angular/platform-browser-dynamic": "~18.0.3", | ||||
|     "@angular/router": "~18.0.3", | ||||
|     "@ng-bootstrap/ng-bootstrap": "^17.0.0", | ||||
|     "@ng-select/ng-select": "^13.2.0", | ||||
|     "@ngneat/dirty-check-forms": "^3.0.3", | ||||
|     "@popperjs/core": "^2.11.8", | ||||
|     "bootstrap": "^5.3.3", | ||||
| @@ -30,35 +30,37 @@ | ||||
|     "ng2-pdf-viewer": "^10.2.2", | ||||
|     "ngx-bootstrap-icons": "^1.9.3", | ||||
|     "ngx-color": "^9.0.0", | ||||
|     "ngx-cookie-service": "^17.1.0", | ||||
|     "ngx-cookie-service": "^18.0.0", | ||||
|     "ngx-file-drop": "^16.0.0", | ||||
|     "ngx-filesize": "^3.0.3", | ||||
|     "ngx-ui-tour-ng-bootstrap": "^14.0.3", | ||||
|     "ngx-ui-tour-ng-bootstrap": "^15.0.0", | ||||
|     "rxjs": "^7.8.1", | ||||
|     "tslib": "^2.6.2", | ||||
|     "uuid": "^9.0.1", | ||||
|     "zone.js": "^0.14.4" | ||||
|   }, | ||||
|   "devDependencies": { | ||||
|     "@angular-builders/jest": "17.0.3", | ||||
|     "@angular-devkit/build-angular": "~17.3.7", | ||||
|     "@angular-eslint/builder": "17.4.1", | ||||
|     "@angular-eslint/eslint-plugin": "17.4.1", | ||||
|     "@angular-eslint/eslint-plugin-template": "17.4.1", | ||||
|     "@angular-eslint/schematics": "17.4.1", | ||||
|     "@angular-eslint/template-parser": "17.4.1", | ||||
|     "@angular/cli": "~17.3.7", | ||||
|     "@angular/compiler-cli": "~17.3.2", | ||||
|     "@angular-builders/jest": "^18.0.0-beta.3", | ||||
|     "@angular-devkit/build-angular": "^18.0.4", | ||||
|     "@angular-devkit/core": "^18.0.4", | ||||
|     "@angular-devkit/schematics": "^18.0.4", | ||||
|     "@angular-eslint/builder": "18.0.1", | ||||
|     "@angular-eslint/eslint-plugin": "18.0.1", | ||||
|     "@angular-eslint/eslint-plugin-template": "18.0.1", | ||||
|     "@angular-eslint/schematics": "18.0.1", | ||||
|     "@angular-eslint/template-parser": "18.0.1", | ||||
|     "@angular/cli": "~18.0.4", | ||||
|     "@angular/compiler-cli": "~18.0.3", | ||||
|     "@playwright/test": "^1.42.1", | ||||
|     "@types/jest": "^29.5.12", | ||||
|     "@types/node": "^20.12.2", | ||||
|     "@typescript-eslint/eslint-plugin": "^7.4.0", | ||||
|     "@typescript-eslint/parser": "^7.4.0", | ||||
|     "@typescript-eslint/utils": "^7.13.0", | ||||
|     "concurrently": "^8.2.2", | ||||
|     "eslint": "^8.57.0", | ||||
|     "jest": "29.7.0", | ||||
|     "jest-environment-jsdom": "^29.7.0", | ||||
|     "jest-preset-angular": "^14.1.0", | ||||
|     "jest-preset-angular": "^14.0.0", | ||||
|     "jest-websocket-mock": "^2.5.0", | ||||
|     "patch-package": "^8.0.0", | ||||
|     "ts-node": "~10.9.1", | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { | ||||
|   ComponentFixture, | ||||
|   TestBed, | ||||
| @@ -24,6 +24,7 @@ import { NgbModalModule } from '@ng-bootstrap/ng-bootstrap' | ||||
| import { HotKeyService } from './services/hot-key.service' | ||||
| import { PermissionsGuard } from './guards/permissions.guard' | ||||
| import { DirtySavedViewGuard } from './guards/dirty-saved-view.guard' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('AppComponent', () => { | ||||
|   let component: AppComponent | ||||
| @@ -39,14 +40,18 @@ describe('AppComponent', () => { | ||||
|   beforeEach(async () => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       declarations: [AppComponent, ToastsComponent, FileDropComponent], | ||||
|       providers: [PermissionsGuard, DirtySavedViewGuard], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         TourNgBootstrapModule, | ||||
|         RouterModule.forRoot(routes), | ||||
|         NgxFileDropModule, | ||||
|         NgbModalModule, | ||||
|       ], | ||||
|       providers: [ | ||||
|         PermissionsGuard, | ||||
|         DirtySavedViewGuard, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|     tourService = TestBed.inject(TourService) | ||||
|   | ||||
| @@ -7,7 +7,11 @@ import { | ||||
|   NgbDateParserFormatter, | ||||
|   NgbModule, | ||||
| } from '@ng-bootstrap/ng-bootstrap' | ||||
| import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http' | ||||
| import { | ||||
|   HTTP_INTERCEPTORS, | ||||
|   provideHttpClient, | ||||
|   withInterceptorsFromDi, | ||||
| } from '@angular/common/http' | ||||
| import { DocumentListComponent } from './components/document-list/document-list.component' | ||||
| import { DocumentDetailComponent } from './components/document-detail/document-detail.component' | ||||
| import { DashboardComponent } from './components/dashboard/dashboard.component' | ||||
| @@ -115,7 +119,6 @@ import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons' | ||||
| import { ConfirmButtonComponent } from './components/common/confirm-button/confirm-button.component' | ||||
| import { MonetaryComponent } from './components/common/input/monetary/monetary.component' | ||||
| import { SystemStatusDialogComponent } from './components/common/system-status-dialog/system-status-dialog.component' | ||||
| import { NgxFilesizeModule } from 'ngx-filesize' | ||||
| import { RotateConfirmDialogComponent } from './components/common/confirm-dialog/rotate-confirm-dialog/rotate-confirm-dialog.component' | ||||
| import { MergeConfirmDialogComponent } from './components/common/confirm-dialog/merge-confirm-dialog/merge-confirm-dialog.component' | ||||
| import { SplitConfirmDialogComponent } from './components/common/confirm-dialog/split-confirm-dialog/split-confirm-dialog.component' | ||||
| @@ -500,11 +503,11 @@ function initializeApp(settings: SettingsService) { | ||||
|     DeletePagesConfirmDialogComponent, | ||||
|     TrashComponent, | ||||
|   ], | ||||
|   bootstrap: [AppComponent], | ||||
|   imports: [ | ||||
|     BrowserModule, | ||||
|     AppRoutingModule, | ||||
|     NgbModule, | ||||
|     HttpClientModule, | ||||
|     FormsModule, | ||||
|     ReactiveFormsModule, | ||||
|     PdfViewerModule, | ||||
| @@ -514,7 +517,6 @@ function initializeApp(settings: SettingsService) { | ||||
|     TourNgBootstrapModule, | ||||
|     DragDropModule, | ||||
|     NgxBootstrapIconsModule.pick(icons), | ||||
|     NgxFilesizeModule, | ||||
|   ], | ||||
|   providers: [ | ||||
|     { | ||||
| @@ -543,7 +545,7 @@ function initializeApp(settings: SettingsService) { | ||||
|     DirtyDocGuard, | ||||
|     DirtySavedViewGuard, | ||||
|     UsernamePipe, | ||||
|     provideHttpClient(withInterceptorsFromDi()), | ||||
|   ], | ||||
|   bootstrap: [AppComponent], | ||||
| }) | ||||
| export class AppModule {} | ||||
|   | ||||
| @@ -5,7 +5,7 @@ import { ConfigService } from 'src/app/services/config.service' | ||||
| import { ToastService } from 'src/app/services/toast.service' | ||||
| import { of, throwError } from 'rxjs' | ||||
| import { OutputTypeConfig } from 'src/app/data/paperless-config' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { BrowserModule } from '@angular/platform-browser' | ||||
| import { NgbModule } from '@ng-bootstrap/ng-bootstrap' | ||||
| import { NgSelectModule } from '@ng-select/ng-select' | ||||
| @@ -18,6 +18,7 @@ import { SelectComponent } from '../../common/input/select/select.component' | ||||
| import { FileComponent } from '../../common/input/file/file.component' | ||||
| import { SettingsService } from 'src/app/services/settings.service' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('ConfigComponent', () => { | ||||
|   let component: ConfigComponent | ||||
| @@ -38,7 +39,6 @@ describe('ConfigComponent', () => { | ||||
|         PageHeaderComponent, | ||||
|       ], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         BrowserModule, | ||||
|         NgbModule, | ||||
|         NgSelectModule, | ||||
| @@ -46,6 +46,10 @@ describe('ConfigComponent', () => { | ||||
|         ReactiveFormsModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|       ], | ||||
|       providers: [ | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|     configService = TestBed.inject(ConfigService) | ||||
|   | ||||
| @@ -8,10 +8,11 @@ import { LogService } from 'src/app/services/rest/log.service' | ||||
| import { PageHeaderComponent } from '../../common/page-header/page-header.component' | ||||
| import { LogsComponent } from './logs.component' | ||||
| import { of, throwError } from 'rxjs' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { NgbModule, NgbNavLink } from '@ng-bootstrap/ng-bootstrap' | ||||
| import { BrowserModule, By } from '@angular/platform-browser' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| const paperless_logs = [ | ||||
|   '[2023-05-29 03:05:01,224] [DEBUG] [paperless.tasks] Training data unchanged.', | ||||
| @@ -37,13 +38,15 @@ describe('LogsComponent', () => { | ||||
|   beforeEach(async () => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       declarations: [LogsComponent, PageHeaderComponent], | ||||
|       providers: [], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         BrowserModule, | ||||
|         NgbModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|       ], | ||||
|       providers: [ | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|     logService = TestBed.inject(LogService) | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| import { ViewportScroller, DatePipe } from '@angular/common' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing' | ||||
| import { FormsModule, ReactiveFormsModule } from '@angular/forms' | ||||
| import { By } from '@angular/platform-browser' | ||||
| @@ -50,6 +50,7 @@ import { | ||||
| } from 'src/app/data/system-status' | ||||
| import { DragDropSelectComponent } from '../../common/input/drag-drop-select/drag-drop-select.component' | ||||
| import { DragDropModule } from '@angular/cdk/drag-drop' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| const savedViews = [ | ||||
|   { id: 1, name: 'view1', show_in_sidebar: true, show_on_dashboard: true }, | ||||
| @@ -100,10 +101,8 @@ describe('SettingsComponent', () => { | ||||
|         ConfirmButtonComponent, | ||||
|         DragDropSelectComponent, | ||||
|       ], | ||||
|       providers: [CustomDatePipe, DatePipe, PermissionsGuard], | ||||
|       imports: [ | ||||
|         NgbModule, | ||||
|         HttpClientTestingModule, | ||||
|         RouterTestingModule.withRoutes(routes), | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
| @@ -113,6 +112,13 @@ describe('SettingsComponent', () => { | ||||
|         NgbModalModule, | ||||
|         DragDropModule, | ||||
|       ], | ||||
|       providers: [ | ||||
|         CustomDatePipe, | ||||
|         DatePipe, | ||||
|         PermissionsGuard, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|     router = TestBed.inject(Router) | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| import { DatePipe } from '@angular/common' | ||||
| import { | ||||
|   HttpTestingController, | ||||
|   HttpClientTestingModule, | ||||
|   provideHttpClientTesting, | ||||
| } from '@angular/common/http/testing' | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing' | ||||
| import { By } from '@angular/platform-browser' | ||||
| @@ -30,6 +30,7 @@ import { TasksComponent } from './tasks.component' | ||||
| import { PermissionsGuard } from 'src/app/guards/permissions.guard' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { FormsModule } from '@angular/forms' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| const tasks: PaperlessTask[] = [ | ||||
|   { | ||||
| @@ -125,6 +126,12 @@ describe('TasksComponent', () => { | ||||
|         CustomDatePipe, | ||||
|         ConfirmDialogComponent, | ||||
|       ], | ||||
|       imports: [ | ||||
|         NgbModule, | ||||
|         RouterTestingModule.withRoutes(routes), | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|         FormsModule, | ||||
|       ], | ||||
|       providers: [ | ||||
|         { | ||||
|           provide: PermissionsService, | ||||
| @@ -135,13 +142,8 @@ describe('TasksComponent', () => { | ||||
|         CustomDatePipe, | ||||
|         DatePipe, | ||||
|         PermissionsGuard, | ||||
|       ], | ||||
|       imports: [ | ||||
|         NgbModule, | ||||
|         HttpClientTestingModule, | ||||
|         RouterTestingModule.withRoutes(routes), | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|         FormsModule, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|   | ||||
| @@ -14,6 +14,7 @@ import { TrashService } from 'src/app/services/trash.service' | ||||
| import { of } from 'rxjs' | ||||
| import { ConfirmDialogComponent } from '../../common/confirm-dialog/confirm-dialog.component' | ||||
| import { By } from '@angular/platform-browser' | ||||
| import { SafeHtmlPipe } from 'src/app/pipes/safehtml.pipe' | ||||
|  | ||||
| const documentsInTrash = [ | ||||
|   { | ||||
| @@ -42,6 +43,7 @@ describe('TrashComponent', () => { | ||||
|         TrashComponent, | ||||
|         PageHeaderComponent, | ||||
|         ConfirmDialogComponent, | ||||
|         SafeHtmlPipe, | ||||
|       ], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| import { DatePipe } from '@angular/common' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { | ||||
|   ComponentFixture, | ||||
|   TestBed, | ||||
| @@ -44,6 +44,7 @@ import { UsersAndGroupsComponent } from './users-groups.component' | ||||
| import { User } from 'src/app/data/user' | ||||
| import { Group } from 'src/app/data/group' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| const users = [ | ||||
|   { id: 1, username: 'user1', is_superuser: false }, | ||||
| @@ -84,10 +85,8 @@ describe('UsersAndGroupsComponent', () => { | ||||
|         PermissionsGroupComponent, | ||||
|         IfOwnerDirective, | ||||
|       ], | ||||
|       providers: [CustomDatePipe, DatePipe, PermissionsGuard], | ||||
|       imports: [ | ||||
|         NgbModule, | ||||
|         HttpClientTestingModule, | ||||
|         RouterTestingModule.withRoutes(routes), | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
| @@ -95,6 +94,13 @@ describe('UsersAndGroupsComponent', () => { | ||||
|         NgSelectModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|       ], | ||||
|       providers: [ | ||||
|         CustomDatePipe, | ||||
|         DatePipe, | ||||
|         PermissionsGuard, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|     fixture = TestBed.createComponent(UsersAndGroupsComponent) | ||||
|     settingsService = TestBed.inject(SettingsService) | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| import { | ||||
|   HttpClientTestingModule, | ||||
|   HttpTestingController, | ||||
|   provideHttpClientTesting, | ||||
| } from '@angular/common/http/testing' | ||||
| import { AppFrameComponent } from './app-frame.component' | ||||
| import { | ||||
| @@ -37,6 +37,7 @@ import { SavedView } from 'src/app/data/saved-view' | ||||
| import { ProfileEditDialogComponent } from '../common/profile-edit-dialog/profile-edit-dialog.component' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { GlobalSearchComponent } from './global-search/global-search.component' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| const saved_views = [ | ||||
|   { | ||||
| @@ -100,7 +101,6 @@ describe('AppFrameComponent', () => { | ||||
|         GlobalSearchComponent, | ||||
|       ], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         BrowserModule, | ||||
|         RouterTestingModule.withRoutes(routes), | ||||
|         NgbModule, | ||||
| @@ -150,6 +150,8 @@ describe('AppFrameComponent', () => { | ||||
|           }, | ||||
|         }, | ||||
|         PermissionsGuard, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|   | ||||
| @@ -17,7 +17,7 @@ import { | ||||
| import { CorrespondentEditDialogComponent } from '../../common/edit-dialog/correspondent-edit-dialog/correspondent-edit-dialog.component' | ||||
| import { UserEditDialogComponent } from '../../common/edit-dialog/user-edit-dialog/user-edit-dialog.component' | ||||
| import { DocumentListViewService } from 'src/app/services/document-list-view.service' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { FormsModule, ReactiveFormsModule } from '@angular/forms' | ||||
| import { | ||||
|   FILTER_FULLTEXT_QUERY, | ||||
| @@ -40,6 +40,7 @@ import { DataType } from 'src/app/data/datatype' | ||||
| import { queryParamsFromFilterRules } from 'src/app/utils/query-params' | ||||
| import { SettingsService } from 'src/app/services/settings.service' | ||||
| import { GlobalSearchType, SETTINGS_KEYS } from 'src/app/data/ui-settings' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| const searchResults = { | ||||
|   total: 11, | ||||
| @@ -139,13 +140,16 @@ describe('GlobalSearchComponent', () => { | ||||
|     await TestBed.configureTestingModule({ | ||||
|       declarations: [GlobalSearchComponent], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         NgbModalModule, | ||||
|         NgbDropdownModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|       ], | ||||
|       providers: [ | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|     searchService = TestBed.inject(SearchService) | ||||
|   | ||||
| @@ -1,11 +1,12 @@ | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing' | ||||
| import { DeletePagesConfirmDialogComponent } from './delete-pages-confirm-dialog.component' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { SafeHtmlPipe } from 'src/app/pipes/safehtml.pipe' | ||||
| import { FormsModule, ReactiveFormsModule } from '@angular/forms' | ||||
| import { PdfViewerComponent } from 'ng2-pdf-viewer' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('DeletePagesConfirmDialogComponent', () => { | ||||
|   let component: DeletePagesConfirmDialogComponent | ||||
| @@ -14,13 +15,17 @@ describe('DeletePagesConfirmDialogComponent', () => { | ||||
|   beforeEach(async () => { | ||||
|     await TestBed.configureTestingModule({ | ||||
|       declarations: [DeletePagesConfirmDialogComponent, PdfViewerComponent], | ||||
|       providers: [NgbActiveModal, SafeHtmlPipe], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|       ], | ||||
|       providers: [ | ||||
|         NgbActiveModal, | ||||
|         SafeHtmlPipe, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|     fixture = TestBed.createComponent(DeletePagesConfirmDialogComponent) | ||||
|     component = fixture.componentInstance | ||||
|   | ||||
| @@ -1,11 +1,12 @@ | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing' | ||||
| import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap' | ||||
| import { MergeConfirmDialogComponent } from './merge-confirm-dialog.component' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { of } from 'rxjs' | ||||
| import { DocumentService } from 'src/app/services/rest/document.service' | ||||
| import { FormsModule, ReactiveFormsModule } from '@angular/forms' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('MergeConfirmDialogComponent', () => { | ||||
|   let component: MergeConfirmDialogComponent | ||||
| @@ -15,13 +16,16 @@ describe('MergeConfirmDialogComponent', () => { | ||||
|   beforeEach(async () => { | ||||
|     await TestBed.configureTestingModule({ | ||||
|       declarations: [MergeConfirmDialogComponent], | ||||
|       providers: [NgbActiveModal], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|         ReactiveFormsModule, | ||||
|         FormsModule, | ||||
|       ], | ||||
|       providers: [ | ||||
|         NgbActiveModal, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|     fixture = TestBed.createComponent(MergeConfirmDialogComponent) | ||||
|   | ||||
| @@ -2,8 +2,9 @@ import { ComponentFixture, TestBed } from '@angular/core/testing' | ||||
| import { RotateConfirmDialogComponent } from './rotate-confirm-dialog.component' | ||||
| import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap' | ||||
| import { SafeHtmlPipe } from 'src/app/pipes/safehtml.pipe' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('RotateConfirmDialogComponent', () => { | ||||
|   let component: RotateConfirmDialogComponent | ||||
| @@ -12,10 +13,12 @@ describe('RotateConfirmDialogComponent', () => { | ||||
|   beforeEach(async () => { | ||||
|     await TestBed.configureTestingModule({ | ||||
|       declarations: [RotateConfirmDialogComponent, SafeHtmlPipe], | ||||
|       providers: [NgbActiveModal, SafeHtmlPipe], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|       imports: [NgxBootstrapIconsModule.pick(allIcons)], | ||||
|       providers: [ | ||||
|         NgbActiveModal, | ||||
|         SafeHtmlPipe, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|   | ||||
| @@ -1,13 +1,14 @@ | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing' | ||||
|  | ||||
| import { SplitConfirmDialogComponent } from './split-confirm-dialog.component' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { ReactiveFormsModule, FormsModule } from '@angular/forms' | ||||
| import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { DocumentService } from 'src/app/services/rest/document.service' | ||||
| import { PdfViewerModule } from 'ng2-pdf-viewer' | ||||
| import { of } from 'rxjs' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('SplitConfirmDialogComponent', () => { | ||||
|   let component: SplitConfirmDialogComponent | ||||
| @@ -17,14 +18,17 @@ describe('SplitConfirmDialogComponent', () => { | ||||
|   beforeEach(async () => { | ||||
|     await TestBed.configureTestingModule({ | ||||
|       declarations: [SplitConfirmDialogComponent], | ||||
|       providers: [NgbActiveModal], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|         ReactiveFormsModule, | ||||
|         FormsModule, | ||||
|         PdfViewerModule, | ||||
|       ], | ||||
|       providers: [ | ||||
|         NgbActiveModal, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|     fixture = TestBed.createComponent(SplitConfirmDialogComponent) | ||||
|   | ||||
| @@ -4,8 +4,9 @@ import { CustomField, CustomFieldDataType } from 'src/app/data/custom-field' | ||||
| import { DocumentService } from 'src/app/services/rest/document.service' | ||||
| import { CustomFieldDisplayComponent } from './custom-field-display.component' | ||||
| import { DisplayField, Document } from 'src/app/data/document' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { CustomFieldsService } from 'src/app/services/rest/custom-fields.service' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| const customFields: CustomField[] = [ | ||||
|   { id: 1, name: 'Field 1', data_type: CustomFieldDataType.String }, | ||||
| @@ -31,8 +32,12 @@ describe('CustomFieldDisplayComponent', () => { | ||||
|   beforeEach(async () => { | ||||
|     await TestBed.configureTestingModule({ | ||||
|       declarations: [CustomFieldDisplayComponent], | ||||
|       providers: [DocumentService], | ||||
|       imports: [HttpClientTestingModule], | ||||
|       imports: [], | ||||
|       providers: [ | ||||
|         DocumentService, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|   }) | ||||
|  | ||||
|   | ||||
| @@ -5,7 +5,7 @@ import { | ||||
|   tick, | ||||
| } from '@angular/core/testing' | ||||
| import { CustomFieldsDropdownComponent } from './custom-fields-dropdown.component' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { ToastService } from 'src/app/services/toast.service' | ||||
| import { CustomFieldsService } from 'src/app/services/rest/custom-fields.service' | ||||
| import { of } from 'rxjs' | ||||
| @@ -22,6 +22,7 @@ import { | ||||
| import { CustomFieldEditDialogComponent } from '../edit-dialog/custom-field-edit-dialog/custom-field-edit-dialog.component' | ||||
| import { By } from '@angular/platform-browser' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| const fields: CustomField[] = [ | ||||
|   { | ||||
| @@ -47,7 +48,6 @@ describe('CustomFieldsDropdownComponent', () => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       declarations: [CustomFieldsDropdownComponent, SelectComponent], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         NgSelectModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
| @@ -55,6 +55,10 @@ describe('CustomFieldsDropdownComponent', () => { | ||||
|         NgbDropdownModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|       ], | ||||
|       providers: [ | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }) | ||||
|     customFieldService = TestBed.inject(CustomFieldsService) | ||||
|     toastService = TestBed.inject(ToastService) | ||||
|   | ||||
| @@ -10,7 +10,7 @@ import { | ||||
|   DateSelection, | ||||
|   RelativeDate, | ||||
| } from './dates-dropdown.component' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { NgbModule } from '@ng-bootstrap/ng-bootstrap' | ||||
| import { SettingsService } from 'src/app/services/settings.service' | ||||
| import { ClearableBadgeComponent } from '../clearable-badge/clearable-badge.component' | ||||
| @@ -18,6 +18,7 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms' | ||||
| import { CustomDatePipe } from 'src/app/pipes/custom-date.pipe' | ||||
| import { DatePipe } from '@angular/common' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('DatesDropdownComponent', () => { | ||||
|   let component: DatesDropdownComponent | ||||
| @@ -31,14 +32,19 @@ describe('DatesDropdownComponent', () => { | ||||
|         ClearableBadgeComponent, | ||||
|         CustomDatePipe, | ||||
|       ], | ||||
|       providers: [SettingsService, CustomDatePipe, DatePipe], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         NgbModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|       ], | ||||
|       providers: [ | ||||
|         SettingsService, | ||||
|         CustomDatePipe, | ||||
|         DatePipe, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|     settingsService = TestBed.inject(SettingsService) | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing' | ||||
| import { FormsModule, ReactiveFormsModule } from '@angular/forms' | ||||
| import { NgbActiveModal, NgbModule } from '@ng-bootstrap/ng-bootstrap' | ||||
| @@ -11,6 +11,7 @@ import { SelectComponent } from '../../input/select/select.component' | ||||
| import { TextComponent } from '../../input/text/text.component' | ||||
| import { EditDialogMode } from '../edit-dialog.component' | ||||
| import { CorrespondentEditDialogComponent } from './correspondent-edit-dialog.component' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('CorrespondentEditDialogComponent', () => { | ||||
|   let component: CorrespondentEditDialogComponent | ||||
| @@ -27,13 +28,11 @@ describe('CorrespondentEditDialogComponent', () => { | ||||
|         TextComponent, | ||||
|         PermissionsFormComponent, | ||||
|       ], | ||||
|       providers: [NgbActiveModal], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgSelectModule, | ||||
|         NgbModule, | ||||
|       imports: [FormsModule, ReactiveFormsModule, NgSelectModule, NgbModule], | ||||
|       providers: [ | ||||
|         NgbActiveModal, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing' | ||||
|  | ||||
| import { CustomFieldEditDialogComponent } from './custom-field-edit-dialog.component' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { FormsModule, ReactiveFormsModule } from '@angular/forms' | ||||
| import { NgbActiveModal, NgbModule } from '@ng-bootstrap/ng-bootstrap' | ||||
| import { NgSelectModule } from '@ng-select/ng-select' | ||||
| @@ -12,6 +12,7 @@ import { SettingsService } from 'src/app/services/settings.service' | ||||
| import { SelectComponent } from '../../input/select/select.component' | ||||
| import { TextComponent } from '../../input/text/text.component' | ||||
| import { EditDialogMode } from '../edit-dialog.component' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('CustomFieldEditDialogComponent', () => { | ||||
|   let component: CustomFieldEditDialogComponent | ||||
| @@ -28,13 +29,11 @@ describe('CustomFieldEditDialogComponent', () => { | ||||
|         TextComponent, | ||||
|         SafeHtmlPipe, | ||||
|       ], | ||||
|       providers: [NgbActiveModal], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgSelectModule, | ||||
|         NgbModule, | ||||
|       imports: [FormsModule, ReactiveFormsModule, NgSelectModule, NgbModule], | ||||
|       providers: [ | ||||
|         NgbActiveModal, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing' | ||||
| import { FormsModule, ReactiveFormsModule } from '@angular/forms' | ||||
| import { NgbActiveModal, NgbModule } from '@ng-bootstrap/ng-bootstrap' | ||||
| @@ -11,6 +11,7 @@ import { SelectComponent } from '../../input/select/select.component' | ||||
| import { TextComponent } from '../../input/text/text.component' | ||||
| import { EditDialogMode } from '../edit-dialog.component' | ||||
| import { DocumentTypeEditDialogComponent } from './document-type-edit-dialog.component' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('DocumentTypeEditDialogComponent', () => { | ||||
|   let component: DocumentTypeEditDialogComponent | ||||
| @@ -27,13 +28,11 @@ describe('DocumentTypeEditDialogComponent', () => { | ||||
|         TextComponent, | ||||
|         PermissionsFormComponent, | ||||
|       ], | ||||
|       providers: [NgbActiveModal], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgSelectModule, | ||||
|         NgbModule, | ||||
|       imports: [FormsModule, ReactiveFormsModule, NgSelectModule, NgbModule], | ||||
|       providers: [ | ||||
|         NgbActiveModal, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| import { | ||||
|   HttpTestingController, | ||||
|   HttpClientTestingModule, | ||||
|   provideHttpClientTesting, | ||||
| } from '@angular/common/http/testing' | ||||
| import { Component } from '@angular/core' | ||||
| import { | ||||
| @@ -30,6 +30,7 @@ import { UserService } from 'src/app/services/rest/user.service' | ||||
| import { SettingsService } from 'src/app/services/settings.service' | ||||
| import { environment } from 'src/environments/environment' | ||||
| import { EditDialogComponent, EditDialogMode } from './edit-dialog.component' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| @Component({ | ||||
|   template: ` | ||||
| @@ -96,6 +97,7 @@ describe('EditDialogComponent', () => { | ||||
|   beforeEach(async () => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       declarations: [TestComponent], | ||||
|       imports: [FormsModule, ReactiveFormsModule], | ||||
|       providers: [ | ||||
|         NgbActiveModal, | ||||
|         { | ||||
| @@ -114,8 +116,9 @@ describe('EditDialogComponent', () => { | ||||
|         }, | ||||
|         SettingsService, | ||||
|         TagService, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|       imports: [HttpClientTestingModule, FormsModule, ReactiveFormsModule], | ||||
|     }).compileComponents() | ||||
|  | ||||
|     tagService = TestBed.inject(TagService) | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing' | ||||
| import { FormsModule, ReactiveFormsModule } from '@angular/forms' | ||||
| import { NgbActiveModal, NgbModule } from '@ng-bootstrap/ng-bootstrap' | ||||
| @@ -12,6 +12,7 @@ import { TextComponent } from '../../input/text/text.component' | ||||
| import { PermissionsSelectComponent } from '../../permissions-select/permissions-select.component' | ||||
| import { EditDialogMode } from '../edit-dialog.component' | ||||
| import { GroupEditDialogComponent } from './group-edit-dialog.component' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('GroupEditDialogComponent', () => { | ||||
|   let component: GroupEditDialogComponent | ||||
| @@ -29,13 +30,11 @@ describe('GroupEditDialogComponent', () => { | ||||
|         PermissionsFormComponent, | ||||
|         PermissionsSelectComponent, | ||||
|       ], | ||||
|       providers: [NgbActiveModal], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgSelectModule, | ||||
|         NgbModule, | ||||
|       imports: [FormsModule, ReactiveFormsModule, NgSelectModule, NgbModule], | ||||
|       providers: [ | ||||
|         NgbActiveModal, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| import { | ||||
|   HttpTestingController, | ||||
|   HttpClientTestingModule, | ||||
|   provideHttpClientTesting, | ||||
| } from '@angular/common/http/testing' | ||||
| import { | ||||
|   ComponentFixture, | ||||
| @@ -23,6 +23,7 @@ import { SelectComponent } from '../../input/select/select.component' | ||||
| import { TextComponent } from '../../input/text/text.component' | ||||
| import { EditDialogMode } from '../edit-dialog.component' | ||||
| import { MailAccountEditDialogComponent } from './mail-account-edit-dialog.component' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('MailAccountEditDialogComponent', () => { | ||||
|   let component: MailAccountEditDialogComponent | ||||
| @@ -42,13 +43,11 @@ describe('MailAccountEditDialogComponent', () => { | ||||
|         PermissionsFormComponent, | ||||
|         PasswordComponent, | ||||
|       ], | ||||
|       providers: [NgbActiveModal], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgSelectModule, | ||||
|         NgbModule, | ||||
|       imports: [FormsModule, ReactiveFormsModule, NgSelectModule, NgbModule], | ||||
|       providers: [ | ||||
|         NgbActiveModal, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing' | ||||
| import { FormsModule, ReactiveFormsModule } from '@angular/forms' | ||||
| import { NgbActiveModal, NgbModule } from '@ng-bootstrap/ng-bootstrap' | ||||
| @@ -23,6 +23,7 @@ import { TagsComponent } from '../../input/tags/tags.component' | ||||
| import { TextComponent } from '../../input/text/text.component' | ||||
| import { EditDialogMode } from '../edit-dialog.component' | ||||
| import { MailRuleEditDialogComponent } from './mail-rule-edit-dialog.component' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('MailRuleEditDialogComponent', () => { | ||||
|   let component: MailRuleEditDialogComponent | ||||
| @@ -43,6 +44,7 @@ describe('MailRuleEditDialogComponent', () => { | ||||
|         SafeHtmlPipe, | ||||
|         CheckComponent, | ||||
|       ], | ||||
|       imports: [FormsModule, ReactiveFormsModule, NgSelectModule, NgbModule], | ||||
|       providers: [ | ||||
|         NgbActiveModal, | ||||
|         { | ||||
| @@ -63,13 +65,8 @@ describe('MailRuleEditDialogComponent', () => { | ||||
|             listAll: () => of([]), | ||||
|           }, | ||||
|         }, | ||||
|       ], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgSelectModule, | ||||
|         NgbModule, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing' | ||||
| import { FormsModule, ReactiveFormsModule } from '@angular/forms' | ||||
| import { NgbActiveModal, NgbModule } from '@ng-bootstrap/ng-bootstrap' | ||||
| @@ -12,6 +12,7 @@ import { SelectComponent } from '../../input/select/select.component' | ||||
| import { TextComponent } from '../../input/text/text.component' | ||||
| import { EditDialogMode } from '../edit-dialog.component' | ||||
| import { StoragePathEditDialogComponent } from './storage-path-edit-dialog.component' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('StoragePathEditDialogComponent', () => { | ||||
|   let component: StoragePathEditDialogComponent | ||||
| @@ -29,13 +30,11 @@ describe('StoragePathEditDialogComponent', () => { | ||||
|         PermissionsFormComponent, | ||||
|         SafeHtmlPipe, | ||||
|       ], | ||||
|       providers: [NgbActiveModal], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgSelectModule, | ||||
|         NgbModule, | ||||
|       imports: [FormsModule, ReactiveFormsModule, NgSelectModule, NgbModule], | ||||
|       providers: [ | ||||
|         NgbActiveModal, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing' | ||||
| import { FormsModule, ReactiveFormsModule } from '@angular/forms' | ||||
| import { NgbActiveModal, NgbModule } from '@ng-bootstrap/ng-bootstrap' | ||||
| @@ -14,6 +14,7 @@ import { TextComponent } from '../../input/text/text.component' | ||||
| import { EditDialogMode } from '../edit-dialog.component' | ||||
| import { TagEditDialogComponent } from './tag-edit-dialog.component' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('TagEditDialogComponent', () => { | ||||
|   let component: TagEditDialogComponent | ||||
| @@ -32,15 +33,19 @@ describe('TagEditDialogComponent', () => { | ||||
|         ColorComponent, | ||||
|         CheckComponent, | ||||
|       ], | ||||
|       providers: [NgbActiveModal, SettingsService], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgSelectModule, | ||||
|         NgbModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|       ], | ||||
|       providers: [ | ||||
|         NgbActiveModal, | ||||
|         SettingsService, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|     fixture = TestBed.createComponent(TagEditDialogComponent) | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing' | ||||
| import { | ||||
|   FormsModule, | ||||
| @@ -19,6 +19,7 @@ import { TextComponent } from '../../input/text/text.component' | ||||
| import { PermissionsSelectComponent } from '../../permissions-select/permissions-select.component' | ||||
| import { EditDialogMode } from '../edit-dialog.component' | ||||
| import { UserEditDialogComponent } from './user-edit-dialog.component' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('UserEditDialogComponent', () => { | ||||
|   let component: UserEditDialogComponent | ||||
| @@ -37,6 +38,7 @@ describe('UserEditDialogComponent', () => { | ||||
|         PermissionsFormComponent, | ||||
|         PermissionsSelectComponent, | ||||
|       ], | ||||
|       imports: [FormsModule, ReactiveFormsModule, NgSelectModule, NgbModule], | ||||
|       providers: [ | ||||
|         NgbActiveModal, | ||||
|         { | ||||
| @@ -54,13 +56,8 @@ describe('UserEditDialogComponent', () => { | ||||
|           }, | ||||
|         }, | ||||
|         SettingsService, | ||||
|       ], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgSelectModule, | ||||
|         NgbModule, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing' | ||||
| import { FormsModule, ReactiveFormsModule } from '@angular/forms' | ||||
| import { NgbActiveModal, NgbModule } from '@ng-bootstrap/ng-bootstrap' | ||||
| @@ -39,6 +39,7 @@ import { | ||||
| } from 'src/app/data/workflow-action' | ||||
| import { MATCHING_ALGORITHMS, MATCH_AUTO } from 'src/app/data/matching-model' | ||||
| import { ConfirmButtonComponent } from '../../confirm-button/confirm-button.component' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| const workflow: Workflow = { | ||||
|   name: 'Workflow 1', | ||||
| @@ -88,6 +89,7 @@ describe('WorkflowEditDialogComponent', () => { | ||||
|         SafeHtmlPipe, | ||||
|         ConfirmButtonComponent, | ||||
|       ], | ||||
|       imports: [FormsModule, ReactiveFormsModule, NgSelectModule, NgbModule], | ||||
|       providers: [ | ||||
|         NgbActiveModal, | ||||
|         { | ||||
| @@ -150,13 +152,8 @@ describe('WorkflowEditDialogComponent', () => { | ||||
|               }), | ||||
|           }, | ||||
|         }, | ||||
|       ], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgSelectModule, | ||||
|         NgbModule, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|   | ||||
| @@ -5,7 +5,7 @@ import { | ||||
|   ReactiveFormsModule, | ||||
| } from '@angular/forms' | ||||
| import { DateComponent } from './date.component' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { | ||||
|   NgbDateParserFormatter, | ||||
|   NgbDatepickerModule, | ||||
| @@ -13,6 +13,7 @@ import { | ||||
| import { RouterTestingModule } from '@angular/router/testing' | ||||
| import { LocalizedDateParserFormatter } from 'src/app/utils/ngb-date-parser-formatter' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('DateComponent', () => { | ||||
|   let component: DateComponent | ||||
| @@ -22,19 +23,20 @@ describe('DateComponent', () => { | ||||
|   beforeEach(async () => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       declarations: [DateComponent], | ||||
|       imports: [ | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgbDatepickerModule, | ||||
|         RouterTestingModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|       ], | ||||
|       providers: [ | ||||
|         { | ||||
|           provide: NgbDateParserFormatter, | ||||
|           useClass: LocalizedDateParserFormatter, | ||||
|         }, | ||||
|       ], | ||||
|       imports: [ | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         HttpClientTestingModule, | ||||
|         NgbDatepickerModule, | ||||
|         RouterTestingModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing' | ||||
| import { | ||||
|   FormsModule, | ||||
| @@ -10,6 +10,7 @@ import { of, throwError } from 'rxjs' | ||||
| import { DocumentService } from 'src/app/services/rest/document.service' | ||||
| import { DocumentLinkComponent } from './document-link.component' | ||||
| import { FILTER_TITLE } from 'src/app/data/filter-rule-type' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| const documents = [ | ||||
|   { | ||||
| @@ -38,11 +39,10 @@ describe('DocumentLinkComponent', () => { | ||||
|   beforeEach(() => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       declarations: [DocumentLinkComponent], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         NgSelectModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|       imports: [NgSelectModule, FormsModule, ReactiveFormsModule], | ||||
|       providers: [ | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }) | ||||
|     documentService = TestBed.inject(DocumentService) | ||||
|   | ||||
| @@ -1,8 +1,9 @@ | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing' | ||||
|  | ||||
| import { FileComponent } from './file.component' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { FormsModule, ReactiveFormsModule } from '@angular/forms' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('FileComponent', () => { | ||||
|   let component: FileComponent | ||||
| @@ -11,7 +12,11 @@ describe('FileComponent', () => { | ||||
|   beforeEach(async () => { | ||||
|     await TestBed.configureTestingModule({ | ||||
|       declarations: [FileComponent], | ||||
|       imports: [FormsModule, ReactiveFormsModule, HttpClientTestingModule], | ||||
|       imports: [FormsModule, ReactiveFormsModule], | ||||
|       providers: [ | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|     fixture = TestBed.createComponent(FileComponent) | ||||
|   | ||||
| @@ -4,9 +4,10 @@ import { | ||||
|   NG_VALUE_ACCESSOR, | ||||
|   ReactiveFormsModule, | ||||
| } from '@angular/forms' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { CurrencyPipe } from '@angular/common' | ||||
| import { MonetaryComponent } from './monetary.component' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('MonetaryComponent', () => { | ||||
|   let component: MonetaryComponent | ||||
| @@ -15,8 +16,12 @@ describe('MonetaryComponent', () => { | ||||
|   beforeEach(async () => { | ||||
|     await TestBed.configureTestingModule({ | ||||
|       declarations: [MonetaryComponent], | ||||
|       providers: [CurrencyPipe], | ||||
|       imports: [FormsModule, ReactiveFormsModule, HttpClientTestingModule], | ||||
|       imports: [FormsModule, ReactiveFormsModule], | ||||
|       providers: [ | ||||
|         CurrencyPipe, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|     fixture = TestBed.createComponent(MonetaryComponent) | ||||
|   | ||||
| @@ -6,8 +6,9 @@ import { | ||||
| } from '@angular/forms' | ||||
| import { NumberComponent } from './number.component' | ||||
| import { DocumentService } from 'src/app/services/rest/document.service' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { of } from 'rxjs' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('NumberComponent', () => { | ||||
|   let component: NumberComponent | ||||
| @@ -18,8 +19,12 @@ describe('NumberComponent', () => { | ||||
|   beforeEach(async () => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       declarations: [NumberComponent], | ||||
|       providers: [DocumentService], | ||||
|       imports: [FormsModule, ReactiveFormsModule, HttpClientTestingModule], | ||||
|       imports: [FormsModule, ReactiveFormsModule], | ||||
|       providers: [ | ||||
|         DocumentService, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|     fixture = TestBed.createComponent(NumberComponent) | ||||
|   | ||||
| @@ -9,8 +9,9 @@ import { SelectComponent } from '../../select/select.component' | ||||
| import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap' | ||||
| import { PermissionsGroupComponent } from '../permissions-group/permissions-group.component' | ||||
| import { PermissionsUserComponent } from '../permissions-user/permissions-user.component' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { NgSelectModule } from '@ng-select/ng-select' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('PermissionsFormComponent', () => { | ||||
|   let component: PermissionsFormComponent | ||||
| @@ -24,14 +25,16 @@ describe('PermissionsFormComponent', () => { | ||||
|         PermissionsGroupComponent, | ||||
|         PermissionsUserComponent, | ||||
|       ], | ||||
|       providers: [], | ||||
|       imports: [ | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgbAccordionModule, | ||||
|         HttpClientTestingModule, | ||||
|         NgSelectModule, | ||||
|       ], | ||||
|       providers: [ | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|     fixture = TestBed.createComponent(PermissionsFormComponent) | ||||
|   | ||||
| @@ -5,10 +5,11 @@ import { | ||||
|   ReactiveFormsModule, | ||||
| } from '@angular/forms' | ||||
| import { PermissionsGroupComponent } from './permissions-group.component' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { NgSelectModule } from '@ng-select/ng-select' | ||||
| import { GroupService } from 'src/app/services/rest/group.service' | ||||
| import { of } from 'rxjs' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('PermissionsGroupComponent', () => { | ||||
|   let component: PermissionsGroupComponent | ||||
| @@ -19,12 +20,11 @@ describe('PermissionsGroupComponent', () => { | ||||
|   beforeEach(async () => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       declarations: [PermissionsGroupComponent], | ||||
|       providers: [GroupService], | ||||
|       imports: [ | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         HttpClientTestingModule, | ||||
|         NgSelectModule, | ||||
|       imports: [FormsModule, ReactiveFormsModule, NgSelectModule], | ||||
|       providers: [ | ||||
|         GroupService, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|   | ||||
| @@ -5,11 +5,12 @@ import { | ||||
|   ReactiveFormsModule, | ||||
| } from '@angular/forms' | ||||
| import { PermissionsUserComponent } from './permissions-user.component' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { NgSelectModule } from '@ng-select/ng-select' | ||||
| import { GroupService } from 'src/app/services/rest/group.service' | ||||
| import { of } from 'rxjs' | ||||
| import { UserService } from 'src/app/services/rest/user.service' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('PermissionsUserComponent', () => { | ||||
|   let component: PermissionsUserComponent | ||||
| @@ -20,12 +21,11 @@ describe('PermissionsUserComponent', () => { | ||||
|   beforeEach(async () => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       declarations: [PermissionsUserComponent], | ||||
|       providers: [UserService], | ||||
|       imports: [ | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         HttpClientTestingModule, | ||||
|         NgSelectModule, | ||||
|       imports: [FormsModule, ReactiveFormsModule, NgSelectModule], | ||||
|       providers: [ | ||||
|         UserService, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|   | ||||
| @@ -49,7 +49,7 @@ | ||||
|       @if (getSuggestions().length > 0) { | ||||
|         <small class="position-absolute top-100"> | ||||
|           <span i18n>Suggestions:</span>  | ||||
|           @for (tag of getSuggestions(); track tag) { | ||||
|           @for (tag of getSuggestions(); track tag.id) { | ||||
|             <a (click)="addTag(tag.id)" [routerLink]="[]">{{tag?.name}}</a>  | ||||
|           } | ||||
|         </small> | ||||
|   | ||||
| @@ -12,7 +12,7 @@ import { | ||||
| } from 'src/app/data/matching-model' | ||||
| import { NgSelectModule } from '@ng-select/ng-select' | ||||
| import { RouterTestingModule } from '@angular/router/testing' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { of } from 'rxjs' | ||||
| import { TagService } from 'src/app/services/rest/tag.service' | ||||
| import { | ||||
| @@ -31,6 +31,7 @@ import { PermissionsFormComponent } from '../permissions/permissions-form/permis | ||||
| import { SelectComponent } from '../select/select.component' | ||||
| import { SettingsService } from 'src/app/services/settings.service' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| const tags: Tag[] = [ | ||||
|   { | ||||
| @@ -74,6 +75,16 @@ describe('TagsComponent', () => { | ||||
|         ColorComponent, | ||||
|         CheckComponent, | ||||
|       ], | ||||
|       imports: [ | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgSelectModule, | ||||
|         RouterTestingModule, | ||||
|         NgbModalModule, | ||||
|         NgbAccordionModule, | ||||
|         NgbPopoverModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|       ], | ||||
|       providers: [ | ||||
|         { | ||||
|           provide: TagService, | ||||
| @@ -90,17 +101,8 @@ describe('TagsComponent', () => { | ||||
|               }), | ||||
|           }, | ||||
|         }, | ||||
|       ], | ||||
|       imports: [ | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgSelectModule, | ||||
|         RouterTestingModule, | ||||
|         HttpClientTestingModule, | ||||
|         NgbModalModule, | ||||
|         NgbAccordionModule, | ||||
|         NgbPopoverModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|   | ||||
| @@ -2,9 +2,10 @@ import { ComponentFixture, TestBed } from '@angular/core/testing' | ||||
|  | ||||
| import { LogoComponent } from './logo.component' | ||||
| import { By } from '@angular/platform-browser' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { SettingsService } from 'src/app/services/settings.service' | ||||
| import { SETTINGS_KEYS } from 'src/app/data/ui-settings' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('LogoComponent', () => { | ||||
|   let component: LogoComponent | ||||
| @@ -14,7 +15,11 @@ describe('LogoComponent', () => { | ||||
|   beforeEach(() => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       declarations: [LogoComponent], | ||||
|       imports: [HttpClientTestingModule], | ||||
|       imports: [], | ||||
|       providers: [ | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }) | ||||
|     settingsService = TestBed.inject(SettingsService) | ||||
|     fixture = TestBed.createComponent(LogoComponent) | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing' | ||||
| import { PermissionsDialogComponent } from './permissions-dialog.component' | ||||
| import { NgbActiveModal, NgbModule } from '@ng-bootstrap/ng-bootstrap' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { SafeHtmlPipe } from 'src/app/pipes/safehtml.pipe' | ||||
| import { UserService } from 'src/app/services/rest/user.service' | ||||
| import { of } from 'rxjs' | ||||
| @@ -12,6 +12,7 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms' | ||||
| import { PermissionsUserComponent } from '../input/permissions/permissions-user/permissions-user.component' | ||||
| import { PermissionsGroupComponent } from '../input/permissions/permissions-group/permissions-group.component' | ||||
| import { SwitchComponent } from '../input/switch/switch.component' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| const set_permissions = { | ||||
|   owner: 10, | ||||
| @@ -43,6 +44,7 @@ describe('PermissionsDialogComponent', () => { | ||||
|         PermissionsUserComponent, | ||||
|         PermissionsGroupComponent, | ||||
|       ], | ||||
|       imports: [NgSelectModule, FormsModule, ReactiveFormsModule, NgbModule], | ||||
|       providers: [ | ||||
|         NgbActiveModal, | ||||
|         { | ||||
| @@ -63,13 +65,8 @@ describe('PermissionsDialogComponent', () => { | ||||
|               }), | ||||
|           }, | ||||
|         }, | ||||
|       ], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         NgSelectModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgbModule, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing' | ||||
| import { FormsModule, ReactiveFormsModule } from '@angular/forms' | ||||
| import { NgbModule } from '@ng-bootstrap/ng-bootstrap' | ||||
| @@ -15,6 +15,7 @@ import { ClearableBadgeComponent } from '../clearable-badge/clearable-badge.comp | ||||
| import { SettingsService } from 'src/app/services/settings.service' | ||||
| import { IfPermissionsDirective } from 'src/app/directives/if-permissions.directive' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| const currentUserID = 13 | ||||
|  | ||||
| @@ -30,6 +31,13 @@ describe('PermissionsFilterDropdownComponent', () => { | ||||
|         ClearableBadgeComponent, | ||||
|         IfPermissionsDirective, | ||||
|       ], | ||||
|       imports: [ | ||||
|         NgSelectModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgbModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|       ], | ||||
|       providers: [ | ||||
|         { | ||||
|           provide: UserService, | ||||
| @@ -63,14 +71,8 @@ describe('PermissionsFilterDropdownComponent', () => { | ||||
|             }, | ||||
|           }, | ||||
|         }, | ||||
|       ], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         NgSelectModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgbModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|   | ||||
| @@ -14,7 +14,8 @@ import { By } from '@angular/platform-browser' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { SettingsService } from 'src/app/services/settings.service' | ||||
| import { SETTINGS_KEYS } from 'src/app/data/ui-settings' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| const permissions = [ | ||||
|   'add_document', | ||||
| @@ -36,13 +37,15 @@ describe('PermissionsSelectComponent', () => { | ||||
|   beforeEach(async () => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       declarations: [PermissionsSelectComponent], | ||||
|       providers: [], | ||||
|       imports: [ | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgbModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|         HttpClientTestingModule, | ||||
|       ], | ||||
|       providers: [ | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|   | ||||
| @@ -5,10 +5,11 @@ import { By } from '@angular/platform-browser' | ||||
| import { SafeUrlPipe } from 'src/app/pipes/safeurl.pipe' | ||||
| import { SettingsService } from 'src/app/services/settings.service' | ||||
| import { SETTINGS_KEYS } from 'src/app/data/ui-settings' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { DocumentService } from 'src/app/services/rest/document.service' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { PdfViewerModule } from 'ng2-pdf-viewer' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| const doc = { | ||||
|   id: 10, | ||||
| @@ -26,10 +27,10 @@ describe('PreviewPopupComponent', () => { | ||||
|   beforeEach(() => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       declarations: [PreviewPopupComponent, SafeUrlPipe], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|         PdfViewerModule, | ||||
|       imports: [NgxBootstrapIconsModule.pick(allIcons), PdfViewerModule], | ||||
|       providers: [ | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }) | ||||
|     settingsService = TestBed.inject(SettingsService) | ||||
|   | ||||
| @@ -14,7 +14,7 @@ import { | ||||
|   NgbModalModule, | ||||
|   NgbPopoverModule, | ||||
| } from '@ng-bootstrap/ng-bootstrap' | ||||
| import { HttpClientModule } from '@angular/common/http' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
| import { TextComponent } from '../input/text/text.component' | ||||
| import { PasswordComponent } from '../input/password/password.component' | ||||
| import { of, throwError } from 'rxjs' | ||||
| @@ -55,9 +55,7 @@ describe('ProfileEditDialogComponent', () => { | ||||
|         PasswordComponent, | ||||
|         ConfirmButtonComponent, | ||||
|       ], | ||||
|       providers: [NgbActiveModal], | ||||
|       imports: [ | ||||
|         HttpClientModule, | ||||
|         ReactiveFormsModule, | ||||
|         FormsModule, | ||||
|         NgbModalModule, | ||||
| @@ -65,6 +63,7 @@ describe('ProfileEditDialogComponent', () => { | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|         NgbPopoverModule, | ||||
|       ], | ||||
|       providers: [NgbActiveModal, provideHttpClient(withInterceptorsFromDi())], | ||||
|     }) | ||||
|     profileService = TestBed.inject(ProfileService) | ||||
|     toastService = TestBed.inject(ToastService) | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| import { | ||||
|   HttpTestingController, | ||||
|   HttpClientTestingModule, | ||||
|   provideHttpClientTesting, | ||||
| } from '@angular/common/http/testing' | ||||
| import { | ||||
|   ComponentFixture, | ||||
| @@ -18,6 +18,7 @@ import { ShareLinksDropdownComponent } from './share-links-dropdown.component' | ||||
| import { Clipboard } from '@angular/cdk/clipboard' | ||||
| import { By } from '@angular/platform-browser' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('ShareLinksDropdownComponent', () => { | ||||
|   let component: ShareLinksDropdownComponent | ||||
| @@ -31,11 +32,14 @@ describe('ShareLinksDropdownComponent', () => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       declarations: [ShareLinksDropdownComponent], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|       ], | ||||
|       providers: [ | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }) | ||||
|  | ||||
|     fixture = TestBed.createComponent(ShareLinksDropdownComponent) | ||||
|   | ||||
| @@ -28,7 +28,7 @@ | ||||
|               <dt i18n>Media Storage</dt> | ||||
|               <dd> | ||||
|                 <ngb-progressbar style="height: 4px;" class="mt-2 mb-1" type="primary" [max]="status.storage.total" [value]="status.storage.total - status.storage.available"></ngb-progressbar> | ||||
|                 <span class="small">{{status.storage.available | filesize}} <ng-container i18n>available</ng-container> ({{status.storage.total | filesize}} <ng-container i18n>total</ng-container>)</span> | ||||
|                 <span class="small">{{status.storage.available | fileSize}} <ng-container i18n>available</ng-container> ({{status.storage.total | fileSize}} <ng-container i18n>total</ng-container>)</span> | ||||
|               </dd> | ||||
|             </dl> | ||||
|           </div> | ||||
|   | ||||
| @@ -17,9 +17,10 @@ import { | ||||
|   InstallType, | ||||
|   SystemStatus, | ||||
| } from 'src/app/data/system-status' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { NgxFilesizeModule } from 'ngx-filesize' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
| import { FileSizePipe } from 'src/app/pipes/file-size.pipe' | ||||
|  | ||||
| const status: SystemStatus = { | ||||
|   pngx_version: '2.4.3', | ||||
| @@ -57,17 +58,19 @@ describe('SystemStatusDialogComponent', () => { | ||||
|  | ||||
|   beforeEach(async () => { | ||||
|     await TestBed.configureTestingModule({ | ||||
|       declarations: [SystemStatusDialogComponent], | ||||
|       providers: [NgbActiveModal], | ||||
|       declarations: [SystemStatusDialogComponent, FileSizePipe], | ||||
|       imports: [ | ||||
|         NgbModalModule, | ||||
|         ClipboardModule, | ||||
|         HttpClientTestingModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|         NgxFilesizeModule, | ||||
|         NgbPopoverModule, | ||||
|         NgbProgressbarModule, | ||||
|       ], | ||||
|       providers: [ | ||||
|         NgbActiveModal, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|     fixture = TestBed.createComponent(SystemStatusDialogComponent) | ||||
|   | ||||
| @@ -8,11 +8,12 @@ import { | ||||
| import { ToastService } from 'src/app/services/toast.service' | ||||
| import { ToastsComponent } from './toasts.component' | ||||
| import { ComponentFixture } from '@angular/core/testing' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { of } from 'rxjs' | ||||
| import { NgbModule } from '@ng-bootstrap/ng-bootstrap' | ||||
| import { Clipboard } from '@angular/cdk/clipboard' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| const toasts = [ | ||||
|   { | ||||
| @@ -46,11 +47,7 @@ describe('ToastsComponent', () => { | ||||
|   beforeEach(async () => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       declarations: [ToastsComponent], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         NgbModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|       ], | ||||
|       imports: [NgbModule, NgxBootstrapIconsModule.pick(allIcons)], | ||||
|       providers: [ | ||||
|         { | ||||
|           provide: ToastService, | ||||
| @@ -58,6 +55,8 @@ describe('ToastsComponent', () => { | ||||
|             getToasts: () => of(toasts), | ||||
|           }, | ||||
|         }, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|   | ||||
| @@ -2,7 +2,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing' | ||||
| import { NgbAlertModule } from '@ng-bootstrap/ng-bootstrap' | ||||
| import { PermissionsGuard } from 'src/app/guards/permissions.guard' | ||||
| import { DashboardComponent } from './dashboard.component' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { SettingsService } from 'src/app/services/settings.service' | ||||
| import { StatisticsWidgetComponent } from './widgets/statistics-widget/statistics-widget.component' | ||||
| import { PageHeaderComponent } from '../common/page-header/page-header.component' | ||||
| @@ -22,6 +22,7 @@ import { SETTINGS_KEYS } from 'src/app/data/ui-settings' | ||||
| import { CdkDragDrop, DragDropModule } from '@angular/cdk/drag-drop' | ||||
| import { SavedView } from 'src/app/data/saved-view' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| const saved_views = [ | ||||
|   { | ||||
| @@ -81,6 +82,13 @@ describe('DashboardComponent', () => { | ||||
|         SavedViewWidgetComponent, | ||||
|         LogoComponent, | ||||
|       ], | ||||
|       imports: [ | ||||
|         NgbAlertModule, | ||||
|         RouterTestingModule, | ||||
|         TourNgBootstrapModule, | ||||
|         DragDropModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|       ], | ||||
|       providers: [ | ||||
|         PermissionsGuard, | ||||
|         { | ||||
| @@ -101,14 +109,8 @@ describe('DashboardComponent', () => { | ||||
|             dashboardViews: saved_views.filter((v) => v.show_on_dashboard), | ||||
|           }, | ||||
|         }, | ||||
|       ], | ||||
|       imports: [ | ||||
|         NgbAlertModule, | ||||
|         HttpClientTestingModule, | ||||
|         RouterTestingModule, | ||||
|         TourNgBootstrapModule, | ||||
|         DragDropModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| import { DatePipe } from '@angular/common' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { | ||||
|   ComponentFixture, | ||||
|   TestBed, | ||||
| @@ -41,6 +41,7 @@ import { CustomFieldsService } from 'src/app/services/rest/custom-fields.service | ||||
| import { CustomFieldDataType } from 'src/app/data/custom-field' | ||||
| import { CustomFieldDisplayComponent } from 'src/app/components/common/custom-field-display/custom-field-display.component' | ||||
| import { DisplayMode, DisplayField } from 'src/app/data/document' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| const savedView: SavedView = { | ||||
|   id: 1, | ||||
| @@ -125,6 +126,12 @@ describe('SavedViewWidgetComponent', () => { | ||||
|         PreviewPopupComponent, | ||||
|         CustomFieldDisplayComponent, | ||||
|       ], | ||||
|       imports: [ | ||||
|         NgbModule, | ||||
|         RouterTestingModule.withRoutes(routes), | ||||
|         DragDropModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|       ], | ||||
|       providers: [ | ||||
|         PermissionsGuard, | ||||
|         DocumentService, | ||||
| @@ -163,13 +170,8 @@ describe('SavedViewWidgetComponent', () => { | ||||
|               }), | ||||
|           }, | ||||
|         }, | ||||
|       ], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         NgbModule, | ||||
|         RouterTestingModule.withRoutes(routes), | ||||
|         DragDropModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|   | ||||
| @@ -2,8 +2,8 @@ import { TestBed } from '@angular/core/testing' | ||||
| import { StatisticsWidgetComponent } from './statistics-widget.component' | ||||
| import { ComponentFixture } from '@angular/core/testing' | ||||
| import { | ||||
|   HttpClientTestingModule, | ||||
|   HttpTestingController, | ||||
|   provideHttpClientTesting, | ||||
| } from '@angular/common/http/testing' | ||||
| import { NgbModule } from '@ng-bootstrap/ng-bootstrap' | ||||
| import { WidgetFrameComponent } from '../widget-frame/widget-frame.component' | ||||
| @@ -18,6 +18,7 @@ import { | ||||
| } from 'src/app/services/consumer-status.service' | ||||
| import { Subject } from 'rxjs' | ||||
| import { DragDropModule } from '@angular/cdk/drag-drop' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('StatisticsWidgetComponent', () => { | ||||
|   let component: StatisticsWidgetComponent | ||||
| @@ -33,13 +34,16 @@ describe('StatisticsWidgetComponent', () => { | ||||
|         WidgetFrameComponent, | ||||
|         IfPermissionsDirective, | ||||
|       ], | ||||
|       providers: [PermissionsGuard], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         NgbModule, | ||||
|         RouterTestingModule.withRoutes(routes), | ||||
|         DragDropModule, | ||||
|       ], | ||||
|       providers: [ | ||||
|         PermissionsGuard, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|     fixture = TestBed.createComponent(StatisticsWidgetComponent) | ||||
|   | ||||
| @@ -39,7 +39,7 @@ | ||||
|                         <a [routerLink]="[]" (click)="alertsExpanded = !alertsExpanded" aria-controls="hiddenAlerts" [attr.aria-expanded]="alertsExpanded" i18n>Show all</a> | ||||
|                       </p> | ||||
|                     } | ||||
|                     <div #hiddenAlerts="ngbCollapse" [(ngbCollapse)]="!alertsExpanded"> | ||||
|                     <div #hiddenAlerts="ngbCollapse" [ngbCollapse]="!alertsExpanded" (ngbCollapseChange)="alertsExpanded = $event"> | ||||
|                       @for (status of getStatusHidden(); track status) { | ||||
|                         <div> | ||||
|                           <ng-container [ngTemplateOutlet]="consumerAlert" [ngTemplateOutletContext]="{ $implicit: status }"></ng-container> | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { | ||||
|   ComponentFixture, | ||||
|   TestBed, | ||||
| @@ -27,6 +27,7 @@ import { WidgetFrameComponent } from '../widget-frame/widget-frame.component' | ||||
| import { UploadFileWidgetComponent } from './upload-file-widget.component' | ||||
| import { DragDropModule } from '@angular/cdk/drag-drop' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| const FAILED_STATUSES = [new FileStatus()] | ||||
| const WORKING_STATUSES = [new FileStatus(), new FileStatus()] | ||||
| @@ -59,6 +60,13 @@ describe('UploadFileWidgetComponent', () => { | ||||
|         WidgetFrameComponent, | ||||
|         IfPermissionsDirective, | ||||
|       ], | ||||
|       imports: [ | ||||
|         NgbModule, | ||||
|         RouterTestingModule.withRoutes(routes), | ||||
|         NgbAlertModule, | ||||
|         DragDropModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|       ], | ||||
|       providers: [ | ||||
|         PermissionsGuard, | ||||
|         { | ||||
| @@ -67,14 +75,8 @@ describe('UploadFileWidgetComponent', () => { | ||||
|             currentUserCan: () => true, | ||||
|           }, | ||||
|         }, | ||||
|       ], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         NgbModule, | ||||
|         RouterTestingModule.withRoutes(routes), | ||||
|         NgbAlertModule, | ||||
|         DragDropModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| import { DatePipe } from '@angular/common' | ||||
| import { | ||||
|   HttpClientTestingModule, | ||||
|   HttpTestingController, | ||||
|   provideHttpClientTesting, | ||||
| } from '@angular/common/http/testing' | ||||
| import { | ||||
|   ComponentFixture, | ||||
| @@ -83,6 +83,8 @@ import { SplitConfirmDialogComponent } from '../common/confirm-dialog/split-conf | ||||
| import { DeletePagesConfirmDialogComponent } from '../common/confirm-dialog/delete-pages-confirm-dialog/delete-pages-confirm-dialog.component' | ||||
| import { PdfViewerModule } from 'ng2-pdf-viewer' | ||||
| import { DataType } from 'src/app/data/datatype' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
| import { TagService } from 'src/app/services/rest/tag.service' | ||||
|  | ||||
| const doc: Document = { | ||||
|   id: 3, | ||||
| @@ -182,8 +184,51 @@ describe('DocumentDetailComponent', () => { | ||||
|         RotateConfirmDialogComponent, | ||||
|         DeletePagesConfirmDialogComponent, | ||||
|       ], | ||||
|       imports: [ | ||||
|         RouterModule.forRoot(routes), | ||||
|         NgbModule, | ||||
|         NgSelectModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgbModalModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|         PdfViewerModule, | ||||
|       ], | ||||
|       providers: [ | ||||
|         DocumentTitlePipe, | ||||
|         { | ||||
|           provide: TagService, | ||||
|           useValue: { | ||||
|             listAll: () => | ||||
|               of({ | ||||
|                 count: 3, | ||||
|                 all: [41, 42, 43], | ||||
|                 results: [ | ||||
|                   { | ||||
|                     id: 41, | ||||
|                     name: 'Tag41', | ||||
|                     is_inbox_tag: true, | ||||
|                     color: '#ff0000', | ||||
|                     text_color: '#000000', | ||||
|                   }, | ||||
|                   { | ||||
|                     id: 42, | ||||
|                     name: 'Tag42', | ||||
|                     is_inbox_tag: true, | ||||
|                     color: '#ff0000', | ||||
|                     text_color: '#000000', | ||||
|                   }, | ||||
|                   { | ||||
|                     id: 43, | ||||
|                     name: 'Tag43', | ||||
|                     is_inbox_tag: true, | ||||
|                     color: '#ff0000', | ||||
|                     text_color: '#000000', | ||||
|                   }, | ||||
|                 ], | ||||
|               }), | ||||
|           }, | ||||
|         }, | ||||
|         { | ||||
|           provide: CorrespondentService, | ||||
|           useValue: { | ||||
| @@ -257,17 +302,8 @@ describe('DocumentDetailComponent', () => { | ||||
|         PermissionsGuard, | ||||
|         CustomDatePipe, | ||||
|         DatePipe, | ||||
|       ], | ||||
|       imports: [ | ||||
|         RouterModule.forRoot(routes), | ||||
|         HttpClientTestingModule, | ||||
|         NgbModule, | ||||
|         NgSelectModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgbModalModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|         PdfViewerModule, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
| @@ -989,10 +1025,10 @@ describe('DocumentDetailComponent', () => { | ||||
|  | ||||
|   it('should get suggestions', () => { | ||||
|     const suggestionsSpy = jest.spyOn(documentService, 'getSuggestions') | ||||
|     suggestionsSpy.mockReturnValue(of({ tags: [1, 2] })) | ||||
|     suggestionsSpy.mockReturnValue(of({ tags: [42, 43] })) | ||||
|     initNormally() | ||||
|     expect(suggestionsSpy).toHaveBeenCalled() | ||||
|     expect(component.suggestions).toEqual({ tags: [1, 2] }) | ||||
|     expect(component.suggestions).toEqual({ tags: [42, 43] }) | ||||
|   }) | ||||
|  | ||||
|   it('should show error if needed for get suggestions', () => { | ||||
|   | ||||
| @@ -11,7 +11,7 @@ | ||||
|   {{title}} | ||||
| </h6> | ||||
|  | ||||
| <div #collapse="ngbCollapse" [(ngbCollapse)]="!expand"> | ||||
| <div #collapse="ngbCollapse" [ngbCollapse]="!expand" (ngbCollapseChange)="expand = $event"> | ||||
|   <table class="table table-borderless"> | ||||
|     <tbody> | ||||
|       @for (m of metadata; track m) { | ||||
|   | ||||
| @@ -4,11 +4,12 @@ import { DocumentHistoryComponent } from './document-history.component' | ||||
| import { DocumentService } from 'src/app/services/rest/document.service' | ||||
| import { of } from 'rxjs' | ||||
| import { AuditLogAction } from 'src/app/data/auditlog-entry' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { CustomDatePipe } from 'src/app/pipes/custom-date.pipe' | ||||
| import { DatePipe } from '@angular/common' | ||||
| import { NgbCollapseModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
| import { CorrespondentService } from 'src/app/services/rest/correspondent.service' | ||||
| import { DocumentTypeService } from 'src/app/services/rest/document-type.service' | ||||
| import { StoragePathService } from 'src/app/services/rest/storage-path.service' | ||||
| @@ -27,13 +28,16 @@ describe('DocumentHistoryComponent', () => { | ||||
|   beforeEach(async () => { | ||||
|     await TestBed.configureTestingModule({ | ||||
|       declarations: [DocumentHistoryComponent, CustomDatePipe], | ||||
|       providers: [DatePipe], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         NgbCollapseModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|         NgbTooltipModule, | ||||
|       ], | ||||
|       providers: [ | ||||
|         DatePipe, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|     fixture = TestBed.createComponent(DocumentHistoryComponent) | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| import { | ||||
|   HttpTestingController, | ||||
|   HttpClientTestingModule, | ||||
|   provideHttpClientTesting, | ||||
| } from '@angular/common/http/testing' | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing' | ||||
| import { FormsModule, ReactiveFormsModule } from '@angular/forms' | ||||
| @@ -58,6 +58,7 @@ import { MergeConfirmDialogComponent } from '../../common/confirm-dialog/merge-c | ||||
| import { CustomFieldsService } from 'src/app/services/rest/custom-fields.service' | ||||
| import { CustomField, CustomFieldDataType } from 'src/app/data/custom-field' | ||||
| import { CustomFieldEditDialogComponent } from '../../common/edit-dialog/custom-field-edit-dialog/custom-field-edit-dialog.component' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| const selectionData: SelectionData = { | ||||
|   selected_tags: [ | ||||
| @@ -112,6 +113,14 @@ describe('BulkEditorComponent', () => { | ||||
|         IsNumberPipe, | ||||
|         MergeConfirmDialogComponent, | ||||
|       ], | ||||
|       imports: [ | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgbModule, | ||||
|         NgbModalModule, | ||||
|         NgSelectModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|       ], | ||||
|       providers: [ | ||||
|         PermissionsService, | ||||
|         { | ||||
| @@ -188,15 +197,8 @@ describe('BulkEditorComponent', () => { | ||||
|               }), | ||||
|           }, | ||||
|         }, | ||||
|       ], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgbModule, | ||||
|         NgbModalModule, | ||||
|         NgSelectModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| import { DatePipe } from '@angular/common' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { | ||||
|   ComponentFixture, | ||||
|   TestBed, | ||||
| @@ -22,6 +22,7 @@ import { IsNumberPipe } from 'src/app/pipes/is-number.pipe' | ||||
| import { PreviewPopupComponent } from '../../common/preview-popup/preview-popup.component' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { CustomFieldDisplayComponent } from '../../common/custom-field-display/custom-field-display.component' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| const doc = { | ||||
|   id: 10, | ||||
| @@ -56,15 +57,18 @@ describe('DocumentCardLargeComponent', () => { | ||||
|         PreviewPopupComponent, | ||||
|         CustomFieldDisplayComponent, | ||||
|       ], | ||||
|       providers: [DatePipe], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         RouterTestingModule, | ||||
|         NgbPopoverModule, | ||||
|         NgbTooltipModule, | ||||
|         NgbProgressbarModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|       ], | ||||
|       providers: [ | ||||
|         DatePipe, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|     fixture = TestBed.createComponent(DocumentCardLargeComponent) | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| import { DatePipe } from '@angular/common' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { | ||||
|   ComponentFixture, | ||||
|   TestBed, | ||||
| @@ -25,6 +25,7 @@ import { IsNumberPipe } from 'src/app/pipes/is-number.pipe' | ||||
| import { PreviewPopupComponent } from '../../common/preview-popup/preview-popup.component' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { CustomFieldDisplayComponent } from '../../common/custom-field-display/custom-field-display.component' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| const doc = { | ||||
|   id: 10, | ||||
| @@ -70,15 +71,18 @@ describe('DocumentCardSmallComponent', () => { | ||||
|         PreviewPopupComponent, | ||||
|         CustomFieldDisplayComponent, | ||||
|       ], | ||||
|       providers: [DatePipe], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         RouterTestingModule, | ||||
|         NgbPopoverModule, | ||||
|         NgbTooltipModule, | ||||
|         NgbProgressbarModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|       ], | ||||
|       providers: [ | ||||
|         DatePipe, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|     fixture = TestBed.createComponent(DocumentCardSmallComponent) | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing' | ||||
| import { DocumentListComponent } from './document-list.component' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { RouterTestingModule } from '@angular/router/testing' | ||||
| import { routes } from 'src/app/app-routing.module' | ||||
| import { FilterEditorComponent } from './filter-editor/filter-editor.component' | ||||
| @@ -60,7 +60,11 @@ import { SafeHtmlPipe } from 'src/app/pipes/safehtml.pipe' | ||||
| import { SaveViewConfigDialogComponent } from './save-view-config-dialog/save-view-config-dialog.component' | ||||
| import { TextComponent } from '../common/input/text/text.component' | ||||
| import { CheckComponent } from '../common/input/check/check.component' | ||||
| import { HttpErrorResponse } from '@angular/common/http' | ||||
| import { | ||||
|   HttpErrorResponse, | ||||
|   provideHttpClient, | ||||
|   withInterceptorsFromDi, | ||||
| } from '@angular/common/http' | ||||
| import { PermissionsGuard } from 'src/app/guards/permissions.guard' | ||||
| import { SettingsService } from 'src/app/services/settings.service' | ||||
| import { SETTINGS_KEYS } from 'src/app/data/ui-settings' | ||||
| @@ -134,17 +138,7 @@ describe('DocumentListComponent', () => { | ||||
|         SafeHtmlPipe, | ||||
|         IsNumberPipe, | ||||
|       ], | ||||
|       providers: [ | ||||
|         FilterPipe, | ||||
|         CustomDatePipe, | ||||
|         DatePipe, | ||||
|         DocumentTitlePipe, | ||||
|         UsernamePipe, | ||||
|         SafeHtmlPipe, | ||||
|         PermissionsGuard, | ||||
|       ], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         RouterTestingModule.withRoutes(routes), | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
| @@ -156,6 +150,17 @@ describe('DocumentListComponent', () => { | ||||
|         NgSelectModule, | ||||
|         NgbTypeaheadModule, | ||||
|       ], | ||||
|       providers: [ | ||||
|         FilterPipe, | ||||
|         CustomDatePipe, | ||||
|         DatePipe, | ||||
|         DocumentTitlePipe, | ||||
|         UsernamePipe, | ||||
|         SafeHtmlPipe, | ||||
|         PermissionsGuard, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|     documentListService = TestBed.inject(DocumentListViewService) | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| import { DatePipe } from '@angular/common' | ||||
| import { | ||||
|   HttpClientTestingModule, | ||||
|   HttpTestingController, | ||||
|   provideHttpClientTesting, | ||||
| } from '@angular/common/http/testing' | ||||
| import { | ||||
|   ComponentFixture, | ||||
| @@ -94,6 +94,7 @@ import { CustomField, CustomFieldDataType } from 'src/app/data/custom-field' | ||||
| import { CustomFieldsService } from 'src/app/services/rest/custom-fields.service' | ||||
| import { RouterModule } from '@angular/router' | ||||
| import { SearchService } from 'src/app/services/rest/search.service' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| const tags: Tag[] = [ | ||||
|   { | ||||
| @@ -181,6 +182,15 @@ describe('FilterEditorComponent', () => { | ||||
|         DatesDropdownComponent, | ||||
|         CustomDatePipe, | ||||
|       ], | ||||
|       imports: [ | ||||
|         RouterModule, | ||||
|         NgbDropdownModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgbDatepickerModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|         NgbTypeaheadModule, | ||||
|       ], | ||||
|       providers: [ | ||||
|         FilterPipe, | ||||
|         CustomDatePipe, | ||||
| @@ -222,16 +232,8 @@ describe('FilterEditorComponent', () => { | ||||
|           }, | ||||
|         }, | ||||
|         SettingsService, | ||||
|       ], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         RouterModule, | ||||
|         NgbDropdownModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgbDatepickerModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|         NgbTypeaheadModule, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|   | ||||
| @@ -6,7 +6,7 @@ import { of, throwError } from 'rxjs' | ||||
| import { DocumentNotesService } from 'src/app/services/rest/document-notes.service' | ||||
| import { ToastService } from 'src/app/services/toast.service' | ||||
| import { DocumentNote } from 'src/app/data/document-note' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { CustomDatePipe } from 'src/app/pipes/custom-date.pipe' | ||||
| import { IfPermissionsDirective } from 'src/app/directives/if-permissions.directive' | ||||
| import { DatePipe } from '@angular/common' | ||||
| @@ -14,6 +14,7 @@ import { By } from '@angular/platform-browser' | ||||
| import { PermissionsService } from 'src/app/services/permissions.service' | ||||
| import { FormsModule, ReactiveFormsModule } from '@angular/forms' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| const notes: DocumentNote[] = [ | ||||
|   { | ||||
| @@ -61,6 +62,11 @@ describe('DocumentNotesComponent', () => { | ||||
|         CustomDatePipe, | ||||
|         IfPermissionsDirective, | ||||
|       ], | ||||
|       imports: [ | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|       ], | ||||
|       providers: [ | ||||
|         { | ||||
|           provide: UserService, | ||||
| @@ -94,12 +100,8 @@ describe('DocumentNotesComponent', () => { | ||||
|         }, | ||||
|         CustomDatePipe, | ||||
|         DatePipe, | ||||
|       ], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { | ||||
|   ComponentFixture, | ||||
|   TestBed, | ||||
| @@ -15,6 +15,7 @@ import { UploadDocumentsService } from 'src/app/services/upload-documents.servic | ||||
| import { ToastsComponent } from '../common/toasts/toasts.component' | ||||
| import { FileDropComponent } from './file-drop.component' | ||||
| import { NgxFileDropEntry, NgxFileDropModule } from 'ngx-file-drop' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('FileDropComponent', () => { | ||||
|   let component: FileDropComponent | ||||
| @@ -27,8 +28,11 @@ describe('FileDropComponent', () => { | ||||
|   beforeEach(() => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       declarations: [FileDropComponent, ToastsComponent], | ||||
|       providers: [], | ||||
|       imports: [HttpClientTestingModule, NgxFileDropModule], | ||||
|       imports: [NgxFileDropModule], | ||||
|       providers: [ | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|     permissionsService = TestBed.inject(PermissionsService) | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing' | ||||
| import { CorrespondentListComponent } from './correspondent-list.component' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { DatePipe } from '@angular/common' | ||||
| import { SortableDirective } from 'src/app/directives/sortable.directive' | ||||
| import { NgbPaginationModule } from '@ng-bootstrap/ng-bootstrap' | ||||
| @@ -10,6 +10,7 @@ import { IfPermissionsDirective } from 'src/app/directives/if-permissions.direct | ||||
| import { CorrespondentService } from 'src/app/services/rest/correspondent.service' | ||||
| import { of } from 'rxjs' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('CorrespondentListComponent', () => { | ||||
|   let component: CorrespondentListComponent | ||||
| @@ -24,14 +25,17 @@ describe('CorrespondentListComponent', () => { | ||||
|         PageHeaderComponent, | ||||
|         IfPermissionsDirective, | ||||
|       ], | ||||
|       providers: [DatePipe], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         NgbPaginationModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|       ], | ||||
|       providers: [ | ||||
|         DatePipe, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|     correspondentsService = TestBed.inject(CorrespondentService) | ||||
|   }) | ||||
|   | ||||
| @@ -3,7 +3,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing' | ||||
| import { CustomFieldsComponent } from './custom-fields.component' | ||||
| import { CustomField, CustomFieldDataType } from 'src/app/data/custom-field' | ||||
| import { CustomFieldsService } from 'src/app/services/rest/custom-fields.service' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { FormsModule, ReactiveFormsModule } from '@angular/forms' | ||||
| import { By } from '@angular/platform-browser' | ||||
| import { | ||||
| @@ -21,6 +21,7 @@ import { ConfirmDialogComponent } from '../../common/confirm-dialog/confirm-dial | ||||
| import { PageHeaderComponent } from '../../common/page-header/page-header.component' | ||||
| import { CustomFieldEditDialogComponent } from '../../common/edit-dialog/custom-field-edit-dialog/custom-field-edit-dialog.component' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| const fields: CustomField[] = [ | ||||
|   { | ||||
| @@ -50,6 +51,14 @@ describe('CustomFieldsComponent', () => { | ||||
|         PageHeaderComponent, | ||||
|         ConfirmDialogComponent, | ||||
|       ], | ||||
|       imports: [ | ||||
|         NgbPaginationModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgbModalModule, | ||||
|         NgbPopoverModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|       ], | ||||
|       providers: [ | ||||
|         { | ||||
|           provide: PermissionsService, | ||||
| @@ -59,15 +68,8 @@ describe('CustomFieldsComponent', () => { | ||||
|             currentUserOwnsObject: () => true, | ||||
|           }, | ||||
|         }, | ||||
|       ], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         NgbPaginationModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgbModalModule, | ||||
|         NgbPopoverModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }) | ||||
|  | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { DatePipe } from '@angular/common' | ||||
| import { SortableDirective } from 'src/app/directives/sortable.directive' | ||||
| import { NgbPaginationModule } from '@ng-bootstrap/ng-bootstrap' | ||||
| @@ -10,6 +10,7 @@ import { of } from 'rxjs' | ||||
| import { DocumentTypeListComponent } from './document-type-list.component' | ||||
| import { DocumentTypeService } from 'src/app/services/rest/document-type.service' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('DocumentTypeListComponent', () => { | ||||
|   let component: DocumentTypeListComponent | ||||
| @@ -24,14 +25,17 @@ describe('DocumentTypeListComponent', () => { | ||||
|         PageHeaderComponent, | ||||
|         IfPermissionsDirective, | ||||
|       ], | ||||
|       providers: [DatePipe], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         NgbPaginationModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|       ], | ||||
|       providers: [ | ||||
|         DatePipe, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|     documentTypeService = TestBed.inject(DocumentTypeService) | ||||
|   | ||||
| @@ -2,7 +2,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing' | ||||
|  | ||||
| import { MailComponent } from './mail.component' | ||||
| import { DatePipe } from '@angular/common' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { RouterTestingModule } from '@angular/router/testing' | ||||
| import { | ||||
|   NgbModule, | ||||
| @@ -42,6 +42,7 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms' | ||||
| import { EditDialogMode } from '../../common/edit-dialog/edit-dialog.component' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { SwitchComponent } from '../../common/input/switch/switch.component' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| const mailAccounts = [ | ||||
|   { id: 1, name: 'account1' }, | ||||
| @@ -85,10 +86,8 @@ describe('MailComponent', () => { | ||||
|         PermissionsFormComponent, | ||||
|         SwitchComponent, | ||||
|       ], | ||||
|       providers: [CustomDatePipe, DatePipe, PermissionsGuard], | ||||
|       imports: [ | ||||
|         NgbModule, | ||||
|         HttpClientTestingModule, | ||||
|         RouterTestingModule.withRoutes(routes), | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
| @@ -96,6 +95,13 @@ describe('MailComponent', () => { | ||||
|         NgSelectModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|       ], | ||||
|       providers: [ | ||||
|         CustomDatePipe, | ||||
|         DatePipe, | ||||
|         PermissionsGuard, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|     mailAccountService = TestBed.inject(MailAccountService) | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| import { DatePipe } from '@angular/common' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { | ||||
|   ComponentFixture, | ||||
|   TestBed, | ||||
| @@ -41,6 +41,7 @@ import { MATCH_LITERAL } from 'src/app/data/matching-model' | ||||
| import { PermissionsDialogComponent } from '../../common/permissions-dialog/permissions-dialog.component' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { BulkEditObjectOperation } from 'src/app/services/rest/abstract-name-filter-service' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| const tags: Tag[] = [ | ||||
|   { | ||||
| @@ -81,9 +82,7 @@ describe('ManagementListComponent', () => { | ||||
|         ConfirmDialogComponent, | ||||
|         PermissionsDialogComponent, | ||||
|       ], | ||||
|       providers: [DatePipe, PermissionsGuard], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         NgbPaginationModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
| @@ -91,6 +90,12 @@ describe('ManagementListComponent', () => { | ||||
|         RouterTestingModule.withRoutes(routes), | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|       ], | ||||
|       providers: [ | ||||
|         DatePipe, | ||||
|         PermissionsGuard, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|     tagService = TestBed.inject(TagService) | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| import { DatePipe } from '@angular/common' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing' | ||||
| import { FormsModule, ReactiveFormsModule } from '@angular/forms' | ||||
| import { NgbPaginationModule } from '@ng-bootstrap/ng-bootstrap' | ||||
| @@ -10,6 +10,7 @@ import { StoragePathService } from 'src/app/services/rest/storage-path.service' | ||||
| import { PageHeaderComponent } from '../../common/page-header/page-header.component' | ||||
| import { StoragePathListComponent } from './storage-path-list.component' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('StoragePathListComponent', () => { | ||||
|   let component: StoragePathListComponent | ||||
| @@ -24,14 +25,17 @@ describe('StoragePathListComponent', () => { | ||||
|         PageHeaderComponent, | ||||
|         IfPermissionsDirective, | ||||
|       ], | ||||
|       providers: [DatePipe], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         NgbPaginationModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|       ], | ||||
|       providers: [ | ||||
|         DatePipe, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|     storagePathService = TestBed.inject(StoragePathService) | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| import { DatePipe } from '@angular/common' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing' | ||||
| import { FormsModule, ReactiveFormsModule } from '@angular/forms' | ||||
| import { NgbPaginationModule } from '@ng-bootstrap/ng-bootstrap' | ||||
| @@ -11,6 +11,7 @@ import { PageHeaderComponent } from '../../common/page-header/page-header.compon | ||||
| import { TagListComponent } from './tag-list.component' | ||||
| import { SafeHtmlPipe } from 'src/app/pipes/safehtml.pipe' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('TagListComponent', () => { | ||||
|   let component: TagListComponent | ||||
| @@ -26,14 +27,17 @@ describe('TagListComponent', () => { | ||||
|         IfPermissionsDirective, | ||||
|         SafeHtmlPipe, | ||||
|       ], | ||||
|       providers: [DatePipe], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         NgbPaginationModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|       ], | ||||
|       providers: [ | ||||
|         DatePipe, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|     tagService = TestBed.inject(TagService) | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { ComponentFixture, TestBed } from '@angular/core/testing' | ||||
| import { FormsModule, ReactiveFormsModule } from '@angular/forms' | ||||
| import { By } from '@angular/platform-browser' | ||||
| @@ -25,6 +25,7 @@ import { | ||||
| } from 'src/app/data/workflow-trigger' | ||||
| import { WorkflowActionType } from 'src/app/data/workflow-action' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| const workflows: Workflow[] = [ | ||||
|   { | ||||
| @@ -85,6 +86,14 @@ describe('WorkflowsComponent', () => { | ||||
|         PageHeaderComponent, | ||||
|         ConfirmDialogComponent, | ||||
|       ], | ||||
|       imports: [ | ||||
|         NgbPaginationModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgbModalModule, | ||||
|         NgbPopoverModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|       ], | ||||
|       providers: [ | ||||
|         { | ||||
|           provide: PermissionsService, | ||||
| @@ -94,15 +103,8 @@ describe('WorkflowsComponent', () => { | ||||
|             currentUserOwnsObject: () => true, | ||||
|           }, | ||||
|         }, | ||||
|       ], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         NgbPaginationModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         NgbModalModule, | ||||
|         NgbPopoverModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }) | ||||
|  | ||||
|   | ||||
| @@ -2,8 +2,9 @@ import { ComponentFixture, TestBed } from '@angular/core/testing' | ||||
| import { NotFoundComponent } from './not-found.component' | ||||
| import { By } from '@angular/platform-browser' | ||||
| import { LogoComponent } from '../common/logo/logo.component' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('NotFoundComponent', () => { | ||||
|   let component: NotFoundComponent | ||||
| @@ -12,9 +13,10 @@ describe('NotFoundComponent', () => { | ||||
|   beforeEach(async () => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       declarations: [NotFoundComponent, LogoComponent], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         NgxBootstrapIconsModule.pick(allIcons), | ||||
|       imports: [NgxBootstrapIconsModule.pick(allIcons)], | ||||
|       providers: [ | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }).compileComponents() | ||||
|  | ||||
|   | ||||
| @@ -5,8 +5,9 @@ import { SettingsService } from '../services/settings.service' | ||||
| import { DocumentListComponent } from '../components/document-list/document-list.component' | ||||
| import { RouterTestingModule } from '@angular/router/testing' | ||||
| import { routes } from '../app-routing.module' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { ConfirmDialogComponent } from '../components/common/confirm-dialog/confirm-dialog.component' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('DirtySavedViewGuard', () => { | ||||
|   let guard: DirtySavedViewGuard | ||||
| @@ -16,17 +17,16 @@ describe('DirtySavedViewGuard', () => { | ||||
|  | ||||
|   beforeEach(() => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       declarations: [ConfirmDialogComponent], | ||||
|       imports: [RouterTestingModule.withRoutes(routes)], | ||||
|       providers: [ | ||||
|         DirtySavedViewGuard, | ||||
|         SettingsService, | ||||
|         NgbModal, | ||||
|         DocumentListComponent, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|       imports: [ | ||||
|         RouterTestingModule.withRoutes(routes), | ||||
|         HttpClientTestingModule, | ||||
|       ], | ||||
|       declarations: [ConfirmDialogComponent], | ||||
|     }) | ||||
|  | ||||
|     settingsService = TestBed.inject(SettingsService) | ||||
|   | ||||
| @@ -1,16 +1,23 @@ | ||||
| import { TestBed } from '@angular/core/testing' | ||||
| import { CustomDatePipe } from './custom-date.pipe' | ||||
| import { SettingsService } from '../services/settings.service' | ||||
| import { HttpClientTestingModule } from '@angular/common/http/testing' | ||||
| import { provideHttpClientTesting } from '@angular/common/http/testing' | ||||
| import { DatePipe } from '@angular/common' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('CustomDatePipe', () => { | ||||
|   let datePipe: CustomDatePipe | ||||
|  | ||||
|   beforeEach(() => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       providers: [CustomDatePipe, SettingsService, DatePipe], | ||||
|       imports: [HttpClientTestingModule], | ||||
|       imports: [], | ||||
|       providers: [ | ||||
|         CustomDatePipe, | ||||
|         SettingsService, | ||||
|         DatePipe, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }) | ||||
|  | ||||
|     datePipe = TestBed.inject(CustomDatePipe) | ||||
|   | ||||
| @@ -1,12 +1,13 @@ | ||||
| import { TestBed } from '@angular/core/testing' | ||||
| import { UsernamePipe } from './username.pipe' | ||||
| import { | ||||
|   HttpClientTestingModule, | ||||
|   HttpTestingController, | ||||
|   provideHttpClientTesting, | ||||
| } from '@angular/common/http/testing' | ||||
| import { environment } from 'src/environments/environment' | ||||
| import { PermissionsService } from '../services/permissions.service' | ||||
| import { UserService } from '../services/rest/user.service' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('UsernamePipe', () => { | ||||
|   let pipe: UsernamePipe | ||||
| @@ -15,8 +16,13 @@ describe('UsernamePipe', () => { | ||||
|  | ||||
|   beforeEach(() => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       providers: [UsernamePipe, PermissionsService], | ||||
|       imports: [HttpClientTestingModule], | ||||
|       imports: [], | ||||
|       providers: [ | ||||
|         UsernamePipe, | ||||
|         PermissionsService, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }) | ||||
|  | ||||
|     httpTestingController = TestBed.inject(HttpTestingController) | ||||
|   | ||||
| @@ -2,11 +2,12 @@ import { TestBed } from '@angular/core/testing' | ||||
|  | ||||
| import { ConfigService } from './config.service' | ||||
| import { | ||||
|   HttpClientTestingModule, | ||||
|   HttpTestingController, | ||||
|   provideHttpClientTesting, | ||||
| } from '@angular/common/http/testing' | ||||
| import { environment } from 'src/environments/environment' | ||||
| import { OutputTypeConfig, PaperlessConfig } from '../data/paperless-config' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('ConfigService', () => { | ||||
|   let service: ConfigService | ||||
| @@ -14,7 +15,11 @@ describe('ConfigService', () => { | ||||
|  | ||||
|   beforeEach(() => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       imports: [HttpClientTestingModule], | ||||
|       imports: [], | ||||
|       providers: [ | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }) | ||||
|     service = TestBed.inject(ConfigService) | ||||
|     httpTestingController = TestBed.inject(HttpTestingController) | ||||
|   | ||||
| @@ -5,12 +5,17 @@ import { | ||||
|   FileStatusPhase, | ||||
| } from './consumer-status.service' | ||||
| import { | ||||
|   HttpClientTestingModule, | ||||
|   HttpTestingController, | ||||
|   provideHttpClientTesting, | ||||
| } from '@angular/common/http/testing' | ||||
| import { environment } from 'src/environments/environment' | ||||
| import { DocumentService } from './rest/document.service' | ||||
| import { HttpEventType, HttpResponse } from '@angular/common/http' | ||||
| import { | ||||
|   HttpEventType, | ||||
|   HttpResponse, | ||||
|   provideHttpClient, | ||||
|   withInterceptorsFromDi, | ||||
| } from '@angular/common/http' | ||||
| import WS from 'jest-websocket-mock' | ||||
| import { SettingsService } from './settings.service' | ||||
|  | ||||
| @@ -27,8 +32,14 @@ describe('ConsumerStatusService', () => { | ||||
|  | ||||
|   beforeEach(() => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       providers: [ConsumerStatusService, DocumentService, SettingsService], | ||||
|       imports: [HttpClientTestingModule], | ||||
|       imports: [], | ||||
|       providers: [ | ||||
|         ConsumerStatusService, | ||||
|         DocumentService, | ||||
|         SettingsService, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }) | ||||
|  | ||||
|     httpTestingController = TestBed.inject(HttpTestingController) | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| import { TestBed } from '@angular/core/testing' | ||||
| import { DocumentListViewService } from './document-list-view.service' | ||||
| import { | ||||
|   HttpClientTestingModule, | ||||
|   HttpTestingController, | ||||
|   provideHttpClientTesting, | ||||
| } from '@angular/common/http/testing' | ||||
| import { environment } from 'src/environments/environment' | ||||
| import { Subscription } from 'rxjs' | ||||
| @@ -24,6 +24,7 @@ import { | ||||
|   DisplayField, | ||||
|   DEFAULT_DISPLAY_FIELDS, | ||||
| } from '../data/document' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| const documents = [ | ||||
|   { | ||||
| @@ -91,13 +92,16 @@ describe('DocumentListViewService', () => { | ||||
|  | ||||
|   beforeEach(() => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       providers: [DocumentListViewService, PermissionsGuard, SettingsService], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         RouterTestingModule.withRoutes(routes), | ||||
|       ], | ||||
|       declarations: [ConfirmDialogComponent], | ||||
|       teardown: { destroyAfterEach: true }, | ||||
|       imports: [RouterTestingModule.withRoutes(routes)], | ||||
|       providers: [ | ||||
|         DocumentListViewService, | ||||
|         PermissionsGuard, | ||||
|         SettingsService, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }) | ||||
|  | ||||
|     sessionStorage.clear() | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| import { TestBed } from '@angular/core/testing' | ||||
| import { OpenDocumentsService } from './open-documents.service' | ||||
| import { | ||||
|   HttpClientTestingModule, | ||||
|   HttpTestingController, | ||||
|   provideHttpClientTesting, | ||||
| } from '@angular/common/http/testing' | ||||
| import { environment } from 'src/environments/environment' | ||||
| import { Subscription, throwError } from 'rxjs' | ||||
| @@ -10,6 +10,7 @@ import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | ||||
| import { ConfirmDialogComponent } from '../components/common/confirm-dialog/confirm-dialog.component' | ||||
| import { OPEN_DOCUMENT_SERVICE } from '../data/storage-keys' | ||||
| import { wind } from 'ngx-bootstrap-icons' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| const documents = [ | ||||
|   { | ||||
| @@ -56,9 +57,14 @@ describe('OpenDocumentsService', () => { | ||||
|  | ||||
|   beforeEach(() => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       providers: [OpenDocumentsService, NgbModal], | ||||
|       imports: [HttpClientTestingModule], | ||||
|       declarations: [ConfirmDialogComponent], | ||||
|       imports: [], | ||||
|       providers: [ | ||||
|         OpenDocumentsService, | ||||
|         NgbModal, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }) | ||||
|  | ||||
|     sessionStorage.clear() | ||||
|   | ||||
| @@ -2,10 +2,11 @@ import { TestBed } from '@angular/core/testing' | ||||
|  | ||||
| import { ProfileService } from './profile.service' | ||||
| import { | ||||
|   HttpClientTestingModule, | ||||
|   HttpTestingController, | ||||
|   provideHttpClientTesting, | ||||
| } from '@angular/common/http/testing' | ||||
| import { environment } from 'src/environments/environment' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('ProfileService', () => { | ||||
|   let httpTestingController: HttpTestingController | ||||
| @@ -13,8 +14,12 @@ describe('ProfileService', () => { | ||||
|  | ||||
|   beforeEach(() => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       providers: [ProfileService], | ||||
|       imports: [HttpClientTestingModule], | ||||
|       imports: [], | ||||
|       providers: [ | ||||
|         ProfileService, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }) | ||||
|  | ||||
|     httpTestingController = TestBed.inject(HttpTestingController) | ||||
|   | ||||
| @@ -1,11 +1,12 @@ | ||||
| import { | ||||
|   HttpClientTestingModule, | ||||
|   HttpTestingController, | ||||
|   provideHttpClientTesting, | ||||
| } from '@angular/common/http/testing' | ||||
| import { AbstractPaperlessService } from './abstract-paperless-service' | ||||
| import { Subscription } from 'rxjs' | ||||
| import { TestBed } from '@angular/core/testing' | ||||
| import { environment } from 'src/environments/environment' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| let httpTestingController: HttpTestingController | ||||
| let service: AbstractPaperlessService<any> | ||||
| @@ -115,9 +116,13 @@ export const commonAbstractPaperlessServiceTests = (endpoint, ServiceClass) => { | ||||
|  | ||||
|   beforeEach(() => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       providers: [ServiceClass], | ||||
|       imports: [HttpClientTestingModule], | ||||
|       teardown: { destroyAfterEach: true }, | ||||
|       imports: [], | ||||
|       providers: [ | ||||
|         ServiceClass, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }) | ||||
|  | ||||
|     httpTestingController = TestBed.inject(HttpTestingController) | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| import { | ||||
|   HttpClientTestingModule, | ||||
|   HttpTestingController, | ||||
|   provideHttpClientTesting, | ||||
| } from '@angular/common/http/testing' | ||||
| import { Subscription } from 'rxjs' | ||||
| import { TestBed } from '@angular/core/testing' | ||||
| @@ -14,6 +14,7 @@ import { | ||||
|   DOCUMENT_SORT_FIELDS_FULLTEXT, | ||||
| } from 'src/app/data/document' | ||||
| import { PermissionsService } from '../permissions.service' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| let httpTestingController: HttpTestingController | ||||
| let service: DocumentService | ||||
| @@ -45,8 +46,12 @@ const documents = [ | ||||
|  | ||||
| beforeEach(() => { | ||||
|   TestBed.configureTestingModule({ | ||||
|     providers: [DocumentService], | ||||
|     imports: [HttpClientTestingModule], | ||||
|     imports: [], | ||||
|     providers: [ | ||||
|       DocumentService, | ||||
|       provideHttpClient(withInterceptorsFromDi()), | ||||
|       provideHttpClientTesting(), | ||||
|     ], | ||||
|   }) | ||||
|  | ||||
|   httpTestingController = TestBed.inject(HttpTestingController) | ||||
|   | ||||
| @@ -1,11 +1,12 @@ | ||||
| import { | ||||
|   HttpClientTestingModule, | ||||
|   HttpTestingController, | ||||
|   provideHttpClientTesting, | ||||
| } from '@angular/common/http/testing' | ||||
| import { Subscription } from 'rxjs' | ||||
| import { TestBed } from '@angular/core/testing' | ||||
| import { environment } from 'src/environments/environment' | ||||
| import { LogService } from './log.service' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| let httpTestingController: HttpTestingController | ||||
| let service: LogService | ||||
| @@ -15,8 +16,12 @@ const endpoint = 'logs' | ||||
| describe('LogService', () => { | ||||
|   beforeEach(() => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       providers: [LogService], | ||||
|       imports: [HttpClientTestingModule], | ||||
|       imports: [], | ||||
|       providers: [ | ||||
|         LogService, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }) | ||||
|  | ||||
|     httpTestingController = TestBed.inject(HttpTestingController) | ||||
|   | ||||
| @@ -1,11 +1,12 @@ | ||||
| import { | ||||
|   HttpClientTestingModule, | ||||
|   HttpTestingController, | ||||
|   provideHttpClientTesting, | ||||
| } from '@angular/common/http/testing' | ||||
| import { Subscription } from 'rxjs' | ||||
| import { TestBed } from '@angular/core/testing' | ||||
| import { environment } from 'src/environments/environment' | ||||
| import { RemoteVersionService } from './remote-version.service' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| let httpTestingController: HttpTestingController | ||||
| let service: RemoteVersionService | ||||
| @@ -15,8 +16,12 @@ const endpoint = 'remote_version' | ||||
| describe('RemoteVersionService', () => { | ||||
|   beforeEach(() => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       providers: [RemoteVersionService], | ||||
|       imports: [HttpClientTestingModule], | ||||
|       imports: [], | ||||
|       providers: [ | ||||
|         RemoteVersionService, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }) | ||||
|  | ||||
|     httpTestingController = TestBed.inject(HttpTestingController) | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| import { | ||||
|   HttpClientTestingModule, | ||||
|   HttpTestingController, | ||||
|   provideHttpClientTesting, | ||||
| } from '@angular/common/http/testing' | ||||
| import { Subscription } from 'rxjs' | ||||
| import { TestBed } from '@angular/core/testing' | ||||
| @@ -8,6 +8,7 @@ import { environment } from 'src/environments/environment' | ||||
| import { SearchService } from './search.service' | ||||
| import { SettingsService } from '../settings.service' | ||||
| import { SETTINGS_KEYS } from 'src/app/data/ui-settings' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| let httpTestingController: HttpTestingController | ||||
| let service: SearchService | ||||
| @@ -18,8 +19,12 @@ const endpoint = 'search/autocomplete' | ||||
| describe('SearchService', () => { | ||||
|   beforeEach(() => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       providers: [SearchService], | ||||
|       imports: [HttpClientTestingModule], | ||||
|       imports: [], | ||||
|       providers: [ | ||||
|         SearchService, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }) | ||||
|  | ||||
|     httpTestingController = TestBed.inject(HttpTestingController) | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| import { | ||||
|   HttpTestingController, | ||||
|   HttpClientTestingModule, | ||||
|   provideHttpClientTesting, | ||||
| } from '@angular/common/http/testing' | ||||
| import { TestBed } from '@angular/core/testing' | ||||
| import { FormsModule, ReactiveFormsModule } from '@angular/forms' | ||||
| @@ -17,6 +17,7 @@ import { CustomFieldsService } from './rest/custom-fields.service' | ||||
| import { CustomFieldDataType } from '../data/custom-field' | ||||
| import { PermissionsService } from './permissions.service' | ||||
| import { DEFAULT_DISPLAY_FIELDS, DisplayField } from '../data/document' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| const customFields = [ | ||||
|   { | ||||
| @@ -84,15 +85,19 @@ describe('SettingsService', () => { | ||||
|   beforeEach(() => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       declarations: [], | ||||
|       providers: [SettingsService, CookieService], | ||||
|       imports: [ | ||||
|         HttpClientTestingModule, | ||||
|         RouterTestingModule, | ||||
|         NgbModule, | ||||
|         FormsModule, | ||||
|         ReactiveFormsModule, | ||||
|         AppModule, | ||||
|       ], | ||||
|       providers: [ | ||||
|         SettingsService, | ||||
|         CookieService, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }) | ||||
|  | ||||
|     httpTestingController = TestBed.inject(HttpTestingController) | ||||
|   | ||||
| @@ -2,10 +2,11 @@ import { TestBed } from '@angular/core/testing' | ||||
|  | ||||
| import { SystemStatusService } from './system-status.service' | ||||
| import { | ||||
|   HttpClientTestingModule, | ||||
|   HttpTestingController, | ||||
|   provideHttpClientTesting, | ||||
| } from '@angular/common/http/testing' | ||||
| import { environment } from 'src/environments/environment' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('SystemStatusService', () => { | ||||
|   let httpTestingController: HttpTestingController | ||||
| @@ -13,8 +14,12 @@ describe('SystemStatusService', () => { | ||||
|  | ||||
|   beforeEach(() => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       providers: [SystemStatusService], | ||||
|       imports: [HttpClientTestingModule], | ||||
|       imports: [], | ||||
|       providers: [ | ||||
|         SystemStatusService, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }) | ||||
|  | ||||
|     httpTestingController = TestBed.inject(HttpTestingController) | ||||
|   | ||||
| @@ -1,12 +1,13 @@ | ||||
| import { TestBed } from '@angular/core/testing' | ||||
| import { TasksService } from './tasks.service' | ||||
| import { | ||||
|   HttpClientTestingModule, | ||||
|   HttpTestingController, | ||||
|   provideHttpClientTesting, | ||||
| } from '@angular/common/http/testing' | ||||
| import { environment } from 'src/environments/environment' | ||||
| import { PaperlessTaskType } from '../data/paperless-task' | ||||
| import { PaperlessTaskStatus } from '../data/paperless-task' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('TasksService', () => { | ||||
|   let httpTestingController: HttpTestingController | ||||
| @@ -14,8 +15,12 @@ describe('TasksService', () => { | ||||
|  | ||||
|   beforeEach(() => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       providers: [TasksService], | ||||
|       imports: [HttpClientTestingModule], | ||||
|       imports: [], | ||||
|       providers: [ | ||||
|         TasksService, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }) | ||||
|  | ||||
|     httpTestingController = TestBed.inject(HttpTestingController) | ||||
|   | ||||
| @@ -1,11 +1,15 @@ | ||||
| import { TestBed } from '@angular/core/testing' | ||||
| import { UploadDocumentsService } from './upload-documents.service' | ||||
| import { | ||||
|   HttpClientTestingModule, | ||||
|   HttpTestingController, | ||||
|   provideHttpClientTesting, | ||||
| } from '@angular/common/http/testing' | ||||
| import { environment } from 'src/environments/environment' | ||||
| import { HttpEventType } from '@angular/common/http' | ||||
| import { | ||||
|   HttpEventType, | ||||
|   provideHttpClient, | ||||
|   withInterceptorsFromDi, | ||||
| } from '@angular/common/http' | ||||
| import { | ||||
|   ConsumerStatusService, | ||||
|   FileStatusPhase, | ||||
| @@ -45,8 +49,13 @@ describe('UploadDocumentsService', () => { | ||||
|  | ||||
|   beforeEach(() => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       providers: [UploadDocumentsService, ConsumerStatusService], | ||||
|       imports: [HttpClientTestingModule], | ||||
|       imports: [], | ||||
|       providers: [ | ||||
|         UploadDocumentsService, | ||||
|         ConsumerStatusService, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }) | ||||
|  | ||||
|     httpTestingController = TestBed.inject(HttpTestingController) | ||||
|   | ||||
| @@ -2,9 +2,10 @@ import { TestBed } from '@angular/core/testing' | ||||
| import { LocalizedDateParserFormatter } from './ngb-date-parser-formatter' | ||||
| import { SettingsService } from '../services/settings.service' | ||||
| import { | ||||
|   HttpClientTestingModule, | ||||
|   HttpTestingController, | ||||
|   provideHttpClientTesting, | ||||
| } from '@angular/common/http/testing' | ||||
| import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' | ||||
|  | ||||
| describe('LocalizedDateParserFormatter', () => { | ||||
|   let dateParserFormatter: LocalizedDateParserFormatter | ||||
| @@ -13,8 +14,13 @@ describe('LocalizedDateParserFormatter', () => { | ||||
|  | ||||
|   beforeEach(() => { | ||||
|     TestBed.configureTestingModule({ | ||||
|       providers: [LocalizedDateParserFormatter, SettingsService], | ||||
|       imports: [HttpClientTestingModule], | ||||
|       imports: [], | ||||
|       providers: [ | ||||
|         LocalizedDateParserFormatter, | ||||
|         SettingsService, | ||||
|         provideHttpClient(withInterceptorsFromDi()), | ||||
|         provideHttpClientTesting(), | ||||
|       ], | ||||
|     }) | ||||
|  | ||||
|     dateParserFormatter = TestBed.inject(LocalizedDateParserFormatter) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 shamoon
					shamoon