From 64eb9f671814ccd05ee7caac14f1fbe3fcd59353 Mon Sep 17 00:00:00 2001 From: RehanY147 Date: Wed, 13 Nov 2024 16:37:07 +0500 Subject: [PATCH] NAS-131557: Rename `mockWebsocket` to `mockApi` --- .../core/testing/utils/mock-websocket.utils.ts | 18 +++++++++--------- .../components/alert/alert.component.spec.ts | 4 ++-- .../alerts-panel.component.spec.ts | 4 ++-- .../export-button.component.spec.ts | 4 ++-- .../job-progress-dialog.component.spec.ts | 4 ++-- .../show-logs-dialog.component.spec.ts | 4 ++-- .../start-service-dialog.component.spec.ts | 4 ++-- .../file-ticket-licensed.component.spec.ts | 4 ++-- .../file-ticket/file-ticket.component.spec.ts | 4 ++-- .../feedback/services/feedback.service.spec.ts | 4 ++-- .../create-dataset-dialog.component.spec.ts | 4 ++-- .../jobs-panel/jobs-panel.component.spec.ts | 4 ++-- .../change-password-dialog.component.spec.ts | 4 ++-- ...ectory-services-indicator.component.spec.ts | 4 ++-- ...irectory-services-monitor.component.spec.ts | 4 ++-- .../user-menu/user-menu.component.spec.ts | 4 ++-- ...truecommand-connect-modal.component.spec.ts | 4 ++-- .../truecommand-button.component.spec.ts | 4 ++-- .../app-detail-view.component.spec.ts | 4 ++-- .../app-details-header.component.spec.ts | 4 ++-- .../app-resources-card.component.spec.ts | 4 ++-- .../app-wizard/app-wizard.component.spec.ts | 4 ++-- .../available-apps-header.component.spec.ts | 4 ++-- .../available-apps.component.spec.ts | 4 ++-- .../apps-settings.component.spec.ts | 4 ++-- .../custom-app-form.component.spec.ts | 4 ++-- ...ocker-image-delete-dialog.component.spec.ts | 4 ++-- .../docker-images-list.component.spec.ts | 4 ++-- .../pull-image-form.component.spec.ts | 4 ++-- .../app-bulk-upgrade.component.spec.ts | 4 ++-- .../app-info-card.component.spec.ts | 4 ++-- .../app-rollback-modal.component.spec.ts | 4 ++-- .../installed-apps.component.spec.ts | 4 ++-- .../apps/services/applications.service.spec.ts | 4 ++-- src/app/pages/apps/store/docker.store.spec.ts | 4 ++-- src/app/pages/audit/audit.component.spec.ts | 4 ++-- .../cloud-credentials-card.component.spec.ts | 4 ++-- .../cloud-credentials-form.component.spec.ts | 4 ++-- .../sftp-provider-form.component.spec.ts | 4 ++-- .../ssh-connection-card.component.spec.ts | 4 ++-- .../ssh-connection-form.component.spec.ts | 4 ++-- .../ssh-keypair-card.component.spec.ts | 4 ++-- .../ssh-keypair-form.component.spec.ts | 4 ++-- ...me-dns-authenticator-list.component.spec.ts | 4 ++-- .../certificate-acme-add.component.spec.ts | 4 ++-- ...certificate-authority-add.component.spec.ts | 4 ++-- .../ca-identifier-and-type.component.spec.ts | 4 ++-- ...ertificate-authority-edit.component.spec.ts | 4 ++-- ...ertificate-authority-list.component.spec.ts | 4 ++-- .../certificate-edit.component.spec.ts | 4 ++-- .../certificate-list.component.spec.ts | 4 ++-- .../csr-add/csr-add.component.spec.ts | 4 ++-- .../csr-identifier-and-type.component.spec.ts | 4 ++-- .../csr-list/csr-list.component.spec.ts | 4 ++-- .../acmedns-form.component.spec.ts | 4 ++-- .../certificate-add.component.spec.ts | 4 ++-- ...icate-identifier-and-type.component.spec.ts | 4 ++-- .../certificate-import.component.spec.ts | 4 ++-- .../certificate-constraints.component.spec.ts | 4 ++-- .../certificate-options.component.spec.ts | 4 ++-- .../sign-csr-dialog.component.spec.ts | 4 ++-- .../delete-group-dialog.component.spec.ts | 4 ++-- .../group-details-row.component.spec.ts | 4 ++-- .../group-form/group-form.component.spec.ts | 4 ++-- .../group-members.component.spec.ts | 4 ++-- .../privilege-form.component.spec.ts | 4 ++-- .../privilege-list.component.spec.ts | 4 ++-- .../credentials/kmip/kmip.component.spec.ts | 4 ++-- .../api-key-form-dialog.component.spec.ts | 4 ++-- .../user-api-keys.component.spec.ts | 4 ++-- .../delete-user-dialog.component.spec.ts | 4 ++-- .../user-details-row.component.spec.ts | 4 ++-- .../user-form/user-form.component.spec.ts | 4 ++-- .../dashboard/services/dashboard.store.spec.ts | 4 ++-- .../services/widget-resources.service.spec.ts | 4 ++-- .../cloud-backup-card.component.spec.ts | 4 ++-- ...estore-from-snapshot-form.component.spec.ts | 4 ++-- .../cloud-backup-schedule.component.spec.ts | 4 ++-- .../cloud-backup-snapshots.component.spec.ts | 4 ++-- .../cloud-backup-form.component.spec.ts | 4 ++-- .../cloud-backup-list.component.spec.ts | 4 ++-- .../cloudsync-form.component.spec.ts | 4 ++-- .../cloudsync-list.component.spec.ts | 4 ++-- .../cloudsync-restore-dialog.component.spec.ts | 4 ++-- .../cloudsync-task-card.component.spec.ts | 4 ++-- .../cloudsync-wizard.component.spec.ts | 4 ++-- .../cloudsync-provider.component.spec.ts | 4 ++-- .../cloudsync-what-and-when.component.spec.ts | 4 ++-- ...reate-storj-bucket-dialog.component.spec.ts | 4 ++-- .../replication-form.component.spec.ts | 4 ++-- .../source-section.component.spec.ts | 4 ++-- .../transport-section.component.spec.ts | 4 ++-- .../replication-list.component.spec.ts | 4 ++-- ...eplication-restore-dialog.component.spec.ts | 4 ++-- .../replication-task-card.component.spec.ts | 4 ++-- .../replication-wizard.component.spec.ts | 4 ++-- ...eplication-what-and-where.component.spec.ts | 4 ++-- .../replication-when.component.spec.ts | 4 ++-- .../rsync-task-card.component.spec.ts | 4 ++-- .../rsync-task-form.component.spec.ts | 4 ++-- .../rsync-task-list.component.spec.ts | 4 ++-- .../resilver-config.component.spec.ts | 4 ++-- .../scrub-list/scrub-list.component.spec.ts | 4 ++-- .../scrub-task-card.component.spec.ts | 4 ++-- .../scrub-task-form.component.spec.ts | 4 ++-- .../smart-task-card.component.spec.ts | 4 ++-- .../smart-task-form.component.spec.ts | 4 ++-- .../smart-task-list.component.spec.ts | 4 ++-- .../snapshot-task-card.component.spec.ts | 4 ++-- .../snapshot-task-form.component.spec.ts | 4 ++-- .../snapshot-task-list.component.spec.ts | 4 ++-- .../vmware-snapshot-form.component.spec.ts | 4 ++-- ...-capacity-management-card.component.spec.ts | 4 ++-- ...dataset-capacity-settings.component.spec.ts | 4 ++-- .../dataset-details-card.component.spec.ts | 4 ++-- .../dataset-form.component.spec.ts | 4 ++-- .../encryption-section.component.spec.ts | 4 ++-- .../other-options-section.component.spec.ts | 4 ++-- .../utils/dataset-form.service.spec.ts | 4 ++-- .../dataset-management.component.spec.ts | 4 ++-- .../dataset-quota-add-form.component.spec.ts | 4 ++-- .../dataset-quota-edit-form.component.spec.ts | 4 ++-- .../dataset-quotas-list.component.spec.ts | 4 ++-- .../delete-dataset-dialog.component.spec.ts | 4 ++-- .../roles-card/roles-card.component.spec.ts | 4 ++-- .../zvol-form/zvol-form.component.spec.ts | 4 ++-- .../dataset-unlock.component.spec.ts | 4 ++-- ...encryption-options-dialog.component.spec.ts | 4 ++-- .../export-all-keys-dialog.component.spec.ts | 4 ++-- ...export-dataset-key-dialog.component.spec.ts | 4 ++-- .../lock-dataset-dialog.component.spec.ts | 4 ++-- .../save-as-preset-modal.component.spec.ts | 4 ++-- .../select-preset-modal.component.spec.ts | 4 ++-- .../strip-acl-modal.component.spec.ts | 4 ++-- .../dataset-acl-editor.component.spec.ts | 4 ++-- ...taset-trivial-permissions.component.spec.ts | 4 ++-- .../permissions-card.component.spec.ts | 4 ++-- .../snapshot-add-form.component.spec.ts | 4 ++-- ...pshot-batch-delete-dialog.component.spec.ts | 4 ++-- .../snapshot-clone-dialog.component.spec.ts | 4 ++-- .../snapshot-details-row.component.spec.ts | 4 ++-- .../snapshot-list.component.spec.ts | 4 ++-- .../snapshot-rollback-dialog.component.spec.ts | 4 ++-- .../active-directory.component.spec.ts | 4 ++-- .../idmap-form/idmap-form.component.spec.ts | 4 ++-- .../idmap-list/idmap-list.component.spec.ts | 4 ++-- .../kerberos-keytabs-form.component.spec.ts | 4 ++-- .../kerberos-realms-form.component.spec.ts | 4 ++-- .../kerberos-settings.component.spec.ts | 4 ++-- .../components/ldap/ldap.component.spec.ts | 4 ++-- .../leave-domain-dialog.component.spec.ts | 4 ++-- src/app/pages/jobs/jobs-list.component.spec.ts | 4 ++-- .../configuration.component.spec.ts | 4 ++-- .../default-gateway-dialog.component.spec.ts | 4 ++-- .../interface-form.component.spec.ts | 4 ++-- .../interfaces-card.component.spec.ts | 4 ++-- .../ipmi-events-dialog.component.spec.ts | 4 ++-- .../ipmi-form/ipmi-form.component.spec.ts | 4 ++-- ...etwork-configuration-card.component.spec.ts | 4 ++-- .../static-route-form.component.spec.ts | 4 ++-- .../static-routes-card.component.spec.ts | 4 ++-- src/app/pages/network/tests/checkin.spec.ts | 4 ++-- .../reporting-exporters-form.component.spec.ts | 4 ++-- .../reporting-exporters-list.component.spec.ts | 4 ++-- .../line-chart/line-chart.component.spec.ts | 4 ++-- .../netdata-dialog.component.spec.ts | 4 ++-- .../reports-global-controls.component.spec.ts | 4 ++-- .../service-ftp/service-ftp.component.spec.ts | 4 ++-- .../add-spn-dialog.component.spec.ts | 4 ++-- .../service-nfs/service-nfs.component.spec.ts | 4 ++-- .../service-smart.component.spec.ts | 4 ++-- .../service-smb/service-smb.component.spec.ts | 4 ++-- .../service-snmp.component.spec.ts | 4 ++-- .../service-ssh/service-ssh.component.spec.ts | 4 ++-- .../service-state-column.component.spec.ts | 4 ++-- .../service-ups/service-ups.component.spec.ts | 4 ++-- .../pages/services/services.component.spec.ts | 4 ++-- .../iscsi-card/iscsi-card.component.spec.ts | 4 ++-- .../nfs-card/nfs-card.component.spec.ts | 4 ++-- .../smb-card/smb-card.component.spec.ts | 4 ++-- .../associated-target-form.component.spec.ts | 4 ++-- .../associated-target-list.component.spec.ts | 4 ++-- .../authorized-access-form.component.spec.ts | 4 ++-- .../authorized-access-list.component.spec.ts | 4 ++-- .../extent-form/extent-form.component.spec.ts | 4 ++-- .../delete-extent-dialog.component.spec.ts | 4 ++-- .../extent-list/extent-list.component.spec.ts | 4 ++-- .../initiator-form.component.spec.ts | 4 ++-- .../initiator-list.component.spec.ts | 4 ++-- .../iscsi-wizard.component.spec.ts | 4 ++-- .../portal-form/portal-form.component.spec.ts | 4 ++-- .../portal-list/portal-list.component.spec.ts | 4 ++-- ...rget-global-configuration.component.spec.ts | 4 ++-- .../target-form/target-form.component.spec.ts | 4 ++-- .../target-list/target-list.component.spec.ts | 4 ++-- .../nfs/nfs-form/nfs-form.component.spec.ts | 4 ++-- .../nfs/nfs-list/nfs-list.component.spec.ts | 4 ++-- .../nfs-session-list.component.spec.ts | 4 ++-- .../smb/smb-acl/smb-acl.component.spec.ts | 4 ++-- .../smb/smb-form/smb-form.component.spec.ts | 4 ++-- .../smb/smb-list/smb-list.component.spec.ts | 4 ++-- .../smb-lock-list.component.spec.ts | 4 ++-- .../smb-notification-list.component.spec.ts | 4 ++-- .../smb-session-list.component.spec.ts | 4 ++-- .../smb-share-list.component.spec.ts | 4 ++-- .../set-admin-password-form.component.spec.ts | 4 ++-- .../signin-form/signin-form.component.spec.ts | 4 ++-- .../pages/signin/store/signin.store.spec.ts | 4 ++-- .../true-command-status.component.spec.ts | 4 ++-- .../dashboard-pool.component.spec.ts | 4 ++-- .../export-disconnect-modal.component.spec.ts | 4 ++-- .../topology-card.component.spec.ts | 4 ++-- .../autotrim-dialog.component.spec.ts | 4 ++-- .../import-pool/import-pool.component.spec.ts | 4 ++-- .../unused-resources.component.spec.ts | 4 ++-- .../replace-disk-dialog.component.spec.ts | 4 ++-- .../hardware-disk-encryption.component.spec.ts | 4 ++-- .../manage-disk-sed-dialog.component.spec.ts | 4 ++-- .../smart-info-card.component.spec.ts | 4 ++-- .../extend-dialog.component.spec.ts | 4 ++-- .../raidz-extend-dialog.component.spec.ts | 4 ++-- .../zfs-info-card.component.spec.ts | 4 ++-- .../disk-bulk-edit.component.spec.ts | 4 ++-- .../disk-form/disk-form.component.spec.ts | 4 ++-- .../disk-list/disk-list.component.spec.ts | 4 ++-- .../disk-wipe-dialog.component.spec.ts | 4 ++-- .../manual-test-dialog.component.spec.ts | 4 ++-- .../test-progress-row.component.spec.ts | 4 ++-- .../smart-test-result-list.component.spec.ts | 4 ++-- .../download-key-dialog.component.spec.ts | 4 ++-- .../pool-manager-wizard.component.spec.ts | 4 ++-- .../general-wizard-step.component.spec.ts | 4 ++-- .../tests/add-vdev-to-pool.spec.ts | 4 ++-- .../pool-manager/tests/create-pool.spec.ts | 4 ++-- .../tests/draid-pool-creation.spec.ts | 4 ++-- .../pool-manager/tests/step-changing.spec.ts | 4 ++-- .../tests/unsetting-on-fewer-disks.spec.ts | 4 ++-- .../tests/wizard-reset-step.spec.ts | 4 ++-- .../tests/wizard-start-over.spec.ts | 4 ++-- .../store/pool-manager.store.spec.ts | 4 ++-- .../config-reset.component.spec.ts | 4 ++-- .../access-card/access-card.component.spec.ts | 4 ++-- .../access-form/access-form.component.spec.ts | 4 ++-- .../advanced-settings.component.spec.ts | 4 ++-- .../allowed-addresses-card.component.spec.ts | 4 ++-- .../allowed-addresses-form.component.spec.ts | 4 ++-- .../audit-card/audit-card.component.spec.ts | 4 ++-- .../audit-form/audit-form.component.spec.ts | 4 ++-- .../console-form.component.spec.ts | 4 ++-- .../cron/cron-card/cron-card.component.spec.ts | 4 ++-- .../cron/cron-form/cron-form.component.spec.ts | 4 ++-- .../cron/cron-list/cron-list.component.spec.ts | 4 ++-- .../global-two-factor-card.component.spec.ts | 4 ++-- .../init-shutdown-card.component.spec.ts | 4 ++-- .../init-shutdown-form.component.spec.ts | 4 ++-- .../init-shutdown-list.component.spec.ts | 4 ++-- .../isolated-gpus-form.component.spec.ts | 4 ++-- .../kernel-form/kernel-form.component.spec.ts | 4 ++-- ...replication-settings-card.component.spec.ts | 4 ++-- ...replication-settings-form.component.spec.ts | 4 ++-- .../save-debug-button.component.spec.ts | 4 ++-- ...elf-encrypting-drive-card.component.spec.ts | 4 ++-- ...elf-encrypting-drive-form.component.spec.ts | 4 ++-- .../storage-card.component.spec.ts | 4 ++-- .../storage-settings-form.component.spec.ts | 4 ++-- .../sysctl-card/sysctl-card.component.spec.ts | 4 ++-- .../tunable-form.component.spec.ts | 4 ++-- .../tunable-list.component.spec.ts | 4 ++-- .../syslog-form/syslog-form.component.spec.ts | 4 ++-- .../system-security-card.component.spec.ts | 4 ++-- .../system-security-form.component.spec.ts | 4 ++-- .../alert-config-form.component.spec.ts | 4 ++-- .../alert-service-list.component.spec.ts | 4 ++-- .../alert-service.component.spec.ts | 4 ++-- .../boot-pool-attach-dialog.component.spec.ts | 4 ++-- .../boot-pool-delete-dialog.component.spec.ts | 4 ++-- .../boot-pool-replace-dialog.component.spec.ts | 4 ++-- .../bootenv-form.component.spec.ts | 4 ++-- .../bootenv-list.component.spec.ts | 4 ++-- .../bootenv-stats-dialog.component.spec.ts | 4 ++-- .../bootenv-status.component.spec.ts | 4 ++-- .../identify-light.component.spec.ts | 4 ++-- .../jbof-form/jbof-form.component.spec.ts | 4 ++-- .../jbof-list/jbof-list.component.spec.ts | 4 ++-- ...et-enclosure-label-dialog.component.spec.ts | 4 ++-- .../enclosure-dashboard.component.spec.ts | 4 ++-- .../enclosure/services/enclosure.store.spec.ts | 4 ++-- .../failover-settings.component.spec.ts | 4 ++-- .../email-card/email-card.component.spec.ts | 4 ++-- .../email-form/email-form.component.spec.ts | 4 ++-- .../gui/gui-form/gui-form.component.spec.ts | 4 ++-- .../localization-form.component.spec.ts | 4 ++-- .../ntp-server-card.component.spec.ts | 4 ++-- .../ntp-server-form.component.spec.ts | 4 ++-- .../save-config-dialog.component.spec.ts | 4 ++-- .../support/license/license.component.spec.ts | 4 ++-- .../proactive/proactive.component.spec.ts | 4 ++-- .../support-card.component.spec.ts | 4 ++-- .../manual-update-form.component.spec.ts | 4 ++-- .../train-card/train-card.component.spec.ts | 4 ++-- .../update-actions-card.component.spec.ts | 4 ++-- .../two-factor.component.spec.ts | 4 ++-- .../global-config-form.component.spec.ts | 4 ++-- .../instance-devices.component.spec.ts | 4 ++-- .../instance-general-info.component.spec.ts | 4 ++-- .../instance-proxies.component.spec.ts | 4 ++-- .../instance-proxy-form.component.spec.ts | 4 ++-- .../instance-edit-form.component.spec.ts | 4 ++-- .../instance-wizard.component.spec.ts | 4 ++-- .../select-image-dialog.component.spec.ts | 4 ++-- .../stores/virtualization-config.store.spec.ts | 4 ++-- .../virtualization-instances.store.spec.ts | 4 ++-- .../device-form/device-form.component.spec.ts | 4 ++-- .../device-delete-modal.component.spec.ts | 4 ++-- .../device-list/device-list.component.spec.ts | 4 ++-- .../vm/utils/cpu-validator.service.spec.ts | 4 ++-- .../utils/free-space-validator.service.spec.ts | 4 ++-- src/app/pages/vm/utils/vm-gpu.service.spec.ts | 4 ++-- .../vm-edit-form.component.spec.ts | 4 ++-- src/app/pages/vm/vm-list.component.spec.ts | 4 ++-- .../clone-vm-dialog.component.spec.ts | 4 ++-- .../delete-vm-dialog.component.spec.ts | 4 ++-- .../steps/1-os-step/os-step.component.spec.ts | 4 ++-- .../cpu-and-memory-step.component.spec.ts | 4 ++-- .../3-disk-step/disk-step.component.spec.ts | 4 ++-- .../network-interface-step.component.spec.ts | 4 ++-- .../6-gpu-step/gpu-step.component.spec.ts | 4 ++-- .../vm/vm-wizard/vm-wizard.component.spec.ts | 4 ++-- src/app/services/auth/auth.service.spec.ts | 4 ++-- .../dataset-service/dataset.service.spec.ts | 4 ++-- .../services/disk-temperature.service.spec.ts | 4 ++-- src/app/services/filesystem.service.spec.ts | 4 ++-- src/app/services/fips.service.spec.ts | 4 ++-- src/app/services/gpu/gpu-service.spec.ts | 4 ++-- src/app/services/replication.service.spec.ts | 4 ++-- .../services/token-last-used.service.spec.ts | 4 ++-- src/app/services/update.service.spec.ts | 4 ++-- src/app/services/vm.service.spec.ts | 4 ++-- src/app/store/eula/eula.effects.spec.ts | 4 ++-- .../ha-upgrade/ha-upgrade.effects.spec.ts | 4 ++-- .../network-interfaces.effects.spec.ts | 4 ++-- .../store/services/services.effects.spec.ts | 4 ++-- 342 files changed, 691 insertions(+), 691 deletions(-) diff --git a/src/app/core/testing/utils/mock-websocket.utils.ts b/src/app/core/testing/utils/mock-websocket.utils.ts index b50955063f6..38f2c8a76f1 100644 --- a/src/app/core/testing/utils/mock-websocket.utils.ts +++ b/src/app/core/testing/utils/mock-websocket.utils.ts @@ -16,10 +16,10 @@ import { ApiService } from 'app/services/api.service'; import { WebSocketConnectionService } from 'app/services/websocket-connection.service'; /** - * This is a sugar syntax for creating simple websocket mocks. + * This is a sugar syntax for creating simple api mocks. * @example * providers: [ - * mockWebSocket([ + * mockApi([ * mockCall('filesystem.stat': { gid: 0 } as FileSystemStat), * mockCall('filesystem.stat', () => ({ gid: 0 } as FileSystemStat)), * mockJob('filesystem.setacl', fakeSuccessfulJob()), @@ -27,12 +27,12 @@ import { WebSocketConnectionService } from 'app/services/websocket-connection.se * }), * ] * - * It also makes available MockWebSocketService, which allows customizing calls on the fly. + * It also makes available MockApiService, which allows customizing calls on the fly. * * If you need more customization, use ordinary mockProvider(). * @example * providers: [ - * mockProvider(WebSocketService, { + * mockProvider(ApiService, { * call: jest.fn((method) => { * if (method === 'filesystem.stat') { * return of({ user: 'john' } as FileSystemStat); @@ -42,25 +42,25 @@ import { WebSocketConnectionService } from 'app/services/websocket-connection.se * ] */ -export function mockWebSocket( +export function mockApi( mockResponses?: (MockApiCallResponse | MockApiJobResponse)[], ): (FactoryProvider | ExistingProvider | ValueProvider)[] { return [ { provide: ApiService, useFactory: (router: Router, wsManager: WebSocketConnectionService, translate: TranslateService) => { - const mockWebSocketService = new MockWebSocketService(router, wsManager, translate); + const mockApiService = new MockWebSocketService(router, wsManager, translate); (mockResponses || []).forEach((mockResponse) => { if (mockResponse.type === MockApiResponseType.Call) { - mockWebSocketService.mockCall(mockResponse.method, mockResponse.response); + mockApiService.mockCall(mockResponse.method, mockResponse.response); } else if (mockResponse.type === MockApiResponseType.Job) { - mockWebSocketService.mockJob( + mockApiService.mockJob( mockResponse.method, mockResponse.response as Job, ); } }); - return mockWebSocketService; + return mockApiService; }, deps: [Router, WebSocketConnectionService, TranslateService], }, diff --git a/src/app/modules/alerts/components/alert/alert.component.spec.ts b/src/app/modules/alerts/components/alert/alert.component.spec.ts index 7467f7eaf03..6fb1896508e 100644 --- a/src/app/modules/alerts/components/alert/alert.component.spec.ts +++ b/src/app/modules/alerts/components/alert/alert.component.spec.ts @@ -6,7 +6,7 @@ import { firstValueFrom } from 'rxjs'; import { map } from 'rxjs/operators'; import { FakeFormatDateTimePipe } from 'app/core/testing/classes/fake-format-datetime.pipe'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { AlertLevel } from 'app/enums/alert-level.enum'; import { Alert } from 'app/interfaces/alert.interface'; import { AlertComponent } from 'app/modules/alerts/components/alert/alert.component'; @@ -57,7 +57,7 @@ describe('AlertComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('alert.dismiss'), mockCall('alert.restore'), ]), diff --git a/src/app/modules/alerts/components/alerts-panel/alerts-panel.component.spec.ts b/src/app/modules/alerts/components/alerts-panel/alerts-panel.component.spec.ts index 051bd440cf3..845e7ef7e7e 100644 --- a/src/app/modules/alerts/components/alerts-panel/alerts-panel.component.spec.ts +++ b/src/app/modules/alerts/components/alerts-panel/alerts-panel.component.spec.ts @@ -4,7 +4,7 @@ import { Store, StoreModule } from '@ngrx/store'; import { MockComponent } from 'ng-mocks'; import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { LetDirective } from 'app/directives/app-let.directive'; import { NavigateAndInteractDirective } from 'app/directives/navigate-and-interact/navigate-and-interact.directive'; import { AlertLevel } from 'app/enums/alert-level.enum'; @@ -85,7 +85,7 @@ describe('AlertsPanelComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('alert.list', [...unreadAlerts, ...dismissedAlerts]), mockCall('alert.dismiss'), mockCall('alert.restore'), diff --git a/src/app/modules/buttons/export-button/export-button.component.spec.ts b/src/app/modules/buttons/export-button/export-button.component.spec.ts index 3c385486c91..e61bf9cdb0c 100644 --- a/src/app/modules/buttons/export-button/export-button.component.spec.ts +++ b/src/app/modules/buttons/export-button/export-button.component.spec.ts @@ -3,7 +3,7 @@ import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { provideMockStore } from '@ngrx/store/testing'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { ControllerType } from 'app/enums/controller-type.enum'; import { JobState } from 'app/enums/job-state.enum'; import { ApiJobMethod } from 'app/interfaces/api/api-job-directory.interface'; @@ -25,7 +25,7 @@ describe('ExportButtonComponent', () => { const createComponent = createComponentFactory({ component: ExportButtonComponent, providers: [ - mockWebSocket([ + mockApi([ mockJob(jobMethod, { result: '/path/data.csv', state: JobState.Success } as Job), mockCall('core.download', [33456, '/_download/33456?auth_token=1234567890']), ]), diff --git a/src/app/modules/dialog/components/job-progress/job-progress-dialog.component.spec.ts b/src/app/modules/dialog/components/job-progress/job-progress-dialog.component.spec.ts index eea36988578..e391b31302d 100644 --- a/src/app/modules/dialog/components/job-progress/job-progress-dialog.component.spec.ts +++ b/src/app/modules/dialog/components/job-progress/job-progress-dialog.component.spec.ts @@ -6,7 +6,7 @@ import { MatDialogHarness } from '@angular/material/dialog/testing'; import { MatProgressBarHarness } from '@angular/material/progress-bar/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { BehaviorSubject, of } from 'rxjs'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { JobState } from 'app/enums/job-state.enum'; import { Job } from 'app/interfaces/job.interface'; import { @@ -24,7 +24,7 @@ describe('JobProgressDialogComponent', () => { const createComponent = createComponentFactory({ component: JobProgressDialogComponent, providers: [ - mockWebSocket([ + mockApi([ mockCall('core.job_abort', null), ]), mockProvider(MatDialogRef), diff --git a/src/app/modules/dialog/components/show-logs-dialog/show-logs-dialog.component.spec.ts b/src/app/modules/dialog/components/show-logs-dialog/show-logs-dialog.component.spec.ts index 64e369b51a0..9f3a982a445 100644 --- a/src/app/modules/dialog/components/show-logs-dialog/show-logs-dialog.component.spec.ts +++ b/src/app/modules/dialog/components/show-logs-dialog/show-logs-dialog.component.spec.ts @@ -3,7 +3,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { MockComponent } from 'ng-mocks'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { Job } from 'app/interfaces/job.interface'; import { CopyButtonComponent } from 'app/modules/buttons/copy-button/copy-button.component'; import { ShowLogsDialogComponent } from 'app/modules/dialog/components/show-logs-dialog/show-logs-dialog.component'; @@ -26,7 +26,7 @@ describe('ShowLogsDialogComponent', () => { mockProvider(DownloadService, { downloadUrl: jest.fn(), }), - mockWebSocket([ + mockApi([ mockCall('core.job_download_logs', 'http://localhost/download/log'), ]), ], diff --git a/src/app/modules/dialog/components/start-service-dialog/start-service-dialog.component.spec.ts b/src/app/modules/dialog/components/start-service-dialog/start-service-dialog.component.spec.ts index 341b2eb1ee5..4a714b01ddc 100644 --- a/src/app/modules/dialog/components/start-service-dialog/start-service-dialog.component.spec.ts +++ b/src/app/modules/dialog/components/start-service-dialog/start-service-dialog.component.spec.ts @@ -7,7 +7,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { MockStore, provideMockStore } from '@ngrx/store/testing'; import { Subject } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { ServiceName } from 'app/enums/service-name.enum'; import { ServiceStatus } from 'app/enums/service-status.enum'; import { Service } from 'app/interfaces/service.interface'; @@ -37,7 +37,7 @@ describe('StartServiceDialogComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('service.update'), mockCall('service.start'), ]), diff --git a/src/app/modules/feedback/components/file-ticket-licensed/file-ticket-licensed.component.spec.ts b/src/app/modules/feedback/components/file-ticket-licensed/file-ticket-licensed.component.spec.ts index faf2e056658..02fb084f745 100644 --- a/src/app/modules/feedback/components/file-ticket-licensed/file-ticket-licensed.component.spec.ts +++ b/src/app/modules/feedback/components/file-ticket-licensed/file-ticket-licensed.component.spec.ts @@ -9,7 +9,7 @@ import { } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { fakeFile } from 'app/core/testing/utils/fake-file.uitls'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { mockWindow } from 'app/core/testing/utils/mock-window.utils'; import { TicketCategory, TicketCriticality, TicketEnvironment } from 'app/enums/file-ticket.enum'; import { WINDOW } from 'app/helpers/window.helper'; @@ -48,7 +48,7 @@ describe('FileTicketLicensedFormComponent', () => { navigate: jest.fn(() => Promise.resolve(true)), }), mockWindow(), - mockWebSocket([ + mockApi([ mockCall('support.attach_ticket_max_size', 5), ]), ], diff --git a/src/app/modules/feedback/components/file-ticket/file-ticket.component.spec.ts b/src/app/modules/feedback/components/file-ticket/file-ticket.component.spec.ts index 41c918418f5..bee5b55e6e0 100644 --- a/src/app/modules/feedback/components/file-ticket/file-ticket.component.spec.ts +++ b/src/app/modules/feedback/components/file-ticket/file-ticket.component.spec.ts @@ -8,7 +8,7 @@ import { import { MockComponent } from 'ng-mocks'; import { of } from 'rxjs'; import { fakeFile } from 'app/core/testing/utils/fake-file.uitls'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { OauthButtonType } from 'app/modules/buttons/oauth-button/interfaces/oauth-button.interface'; import { OauthButtonComponent } from 'app/modules/buttons/oauth-button/oauth-button.component'; import { FileTicketComponent } from 'app/modules/feedback/components/file-ticket/file-ticket.component'; @@ -44,7 +44,7 @@ describe('FileTicketComponent', () => { mockProvider(ImageValidatorService, { getImagesValidator: () => () => of(null as ValidationErrors), }), - mockWebSocket([ + mockApi([ mockCall('support.attach_ticket_max_size', 5), ]), ], diff --git a/src/app/modules/feedback/services/feedback.service.spec.ts b/src/app/modules/feedback/services/feedback.service.spec.ts index bc8050342c4..5030e4e35bb 100644 --- a/src/app/modules/feedback/services/feedback.service.spec.ts +++ b/src/app/modules/feedback/services/feedback.service.spec.ts @@ -9,7 +9,7 @@ import { provideMockStore } from '@ngrx/store/testing'; import { lastValueFrom, of } from 'rxjs'; import { fakeFile } from 'app/core/testing/utils/fake-file.uitls'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { mockWindow } from 'app/core/testing/utils/mock-window.utils'; import { TicketCategory, TicketCriticality, TicketEnvironment, TicketType, @@ -42,7 +42,7 @@ describe('FeedbackService', () => { const createService = createServiceFactory({ service: FeedbackService, providers: [ - mockWebSocket([ + mockApi([ mockJob('support.new_ticket', fakeSuccessfulJob(newTicket)), mockCall('system.host_id', 'testHostId'), ]), diff --git a/src/app/modules/forms/ix-forms/components/ix-explorer/create-dataset-dialog/create-dataset-dialog.component.spec.ts b/src/app/modules/forms/ix-forms/components/ix-explorer/create-dataset-dialog/create-dataset-dialog.component.spec.ts index 7eef62b7955..9ddc6e9143d 100644 --- a/src/app/modules/forms/ix-forms/components/ix-explorer/create-dataset-dialog/create-dataset-dialog.component.spec.ts +++ b/src/app/modules/forms/ix-forms/components/ix-explorer/create-dataset-dialog/create-dataset-dialog.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DatasetAclType, DatasetCaseSensitivity } from 'app/enums/dataset.enum'; import { Dataset, DatasetCreate } from 'app/interfaces/dataset.interface'; import { CreateDatasetDialogComponent } from 'app/modules/forms/ix-forms/components/ix-explorer/create-dataset-dialog/create-dataset-dialog.component'; @@ -23,7 +23,7 @@ describe('CreateDatasetDialogComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('pool.dataset.query', [{ name: 'parent_name', casesensitivity: { value: DatasetCaseSensitivity.Sensitive }, diff --git a/src/app/modules/jobs/components/jobs-panel/jobs-panel.component.spec.ts b/src/app/modules/jobs/components/jobs-panel/jobs-panel.component.spec.ts index dda7ad1a602..73ce97ea7ba 100644 --- a/src/app/modules/jobs/components/jobs-panel/jobs-panel.component.spec.ts +++ b/src/app/modules/jobs/components/jobs-panel/jobs-panel.component.spec.ts @@ -9,7 +9,7 @@ import { EffectsModule } from '@ngrx/effects'; import { Store, StoreModule } from '@ngrx/store'; import { of } from 'rxjs'; import { FakeFormatDateTimePipe } from 'app/core/testing/classes/fake-format-datetime.pipe'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { LetDirective } from 'app/directives/app-let.directive'; import { JobState } from 'app/enums/job-state.enum'; import { Job } from 'app/interfaces/job.interface'; @@ -100,7 +100,7 @@ describe('JobsPanelComponent', () => { afterClosed: () => of(undefined), })), }), - mockWebSocket([ + mockApi([ mockCall('core.get_jobs', (query) => { if (query[0][0][2] === JobState.Success) { return []; diff --git a/src/app/modules/layout/topbar/change-password-dialog/change-password-dialog.component.spec.ts b/src/app/modules/layout/topbar/change-password-dialog/change-password-dialog.component.spec.ts index 875d34db221..7a74fddea6a 100644 --- a/src/app/modules/layout/topbar/change-password-dialog/change-password-dialog.component.spec.ts +++ b/src/app/modules/layout/topbar/change-password-dialog/change-password-dialog.component.spec.ts @@ -7,7 +7,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { throwError } from 'rxjs'; import { MockAuthService } from 'app/core/testing/classes/mock-auth.service'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { Role } from 'app/enums/role.enum'; import { FormErrorHandlerService } from 'app/modules/forms/ix-forms/services/form-error-handler.service'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; @@ -24,7 +24,7 @@ describe('ChangePasswordDialogComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('user.set_password'), ]), mockProvider(FormErrorHandlerService), diff --git a/src/app/modules/layout/topbar/directory-services-indicator/directory-services-indicator.component.spec.ts b/src/app/modules/layout/topbar/directory-services-indicator/directory-services-indicator.component.spec.ts index e8c72189ff3..fe7c1477fce 100644 --- a/src/app/modules/layout/topbar/directory-services-indicator/directory-services-indicator.component.spec.ts +++ b/src/app/modules/layout/topbar/directory-services-indicator/directory-services-indicator.component.spec.ts @@ -6,7 +6,7 @@ import { MatIconHarness } from '@angular/material/icon/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DirectoryServiceState } from 'app/enums/directory-service-state.enum'; import { ApiEvent } from 'app/interfaces/api-message.interface'; import { DirectoryServicesState } from 'app/interfaces/directory-services-state.interface'; @@ -25,7 +25,7 @@ describe('DirectoryServicesIndicatorComponent', () => { const createComponent = createComponentFactory({ component: DirectoryServicesIndicatorComponent, providers: [ - mockWebSocket([ + mockApi([ mockCall('directoryservices.get_state', { activedirectory: DirectoryServiceState.Healthy, ldap: DirectoryServiceState.Disabled, diff --git a/src/app/modules/layout/topbar/directory-services-indicator/directory-services-monitor/directory-services-monitor.component.spec.ts b/src/app/modules/layout/topbar/directory-services-indicator/directory-services-monitor/directory-services-monitor.component.spec.ts index 9bde3c3cbd4..fa5d4d7e1e0 100644 --- a/src/app/modules/layout/topbar/directory-services-indicator/directory-services-monitor/directory-services-monitor.component.spec.ts +++ b/src/app/modules/layout/topbar/directory-services-indicator/directory-services-monitor/directory-services-monitor.component.spec.ts @@ -1,7 +1,7 @@ import { HarnessLoader } from '@angular/cdk/testing'; import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { createComponentFactory, Spectator } from '@ngneat/spectator/jest'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DirectoryServiceState } from 'app/enums/directory-service-state.enum'; import { IxIconHarness } from 'app/modules/ix-icon/ix-icon.harness'; import { @@ -19,7 +19,7 @@ describe('DirectoryServicesMonitorComponent', () => { MapValuePipe, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('directoryservices.get_state', { activedirectory: DirectoryServiceState.Disabled, ldap: DirectoryServiceState.Healthy, diff --git a/src/app/modules/layout/topbar/user-menu/user-menu.component.spec.ts b/src/app/modules/layout/topbar/user-menu/user-menu.component.spec.ts index 986fc55ed47..25e132f05cf 100644 --- a/src/app/modules/layout/topbar/user-menu/user-menu.component.spec.ts +++ b/src/app/modules/layout/topbar/user-menu/user-menu.component.spec.ts @@ -9,7 +9,7 @@ import { import { MockComponent } from 'ng-mocks'; import { of } from 'rxjs'; import { dummyUser } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { IxIconComponent } from 'app/modules/ix-icon/ix-icon.component'; import { AboutDialogComponent } from 'app/modules/layout/topbar/about-dialog/about-dialog.component'; import { @@ -30,7 +30,7 @@ describe('UserMenuComponent', () => { ], providers: [ mockProvider(MatDialog), - mockWebSocket(), + mockApi(), mockProvider(AuthService, { logout: jest.fn(() => of()), user$: of(dummyUser), diff --git a/src/app/modules/truecommand/components/truecommand-connect-modal/truecommand-connect-modal.component.spec.ts b/src/app/modules/truecommand/components/truecommand-connect-modal/truecommand-connect-modal.component.spec.ts index 696a16e21fb..d43afa506c4 100644 --- a/src/app/modules/truecommand/components/truecommand-connect-modal/truecommand-connect-modal.component.spec.ts +++ b/src/app/modules/truecommand/components/truecommand-connect-modal/truecommand-connect-modal.component.spec.ts @@ -8,7 +8,7 @@ import { } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { TrueCommandStatus } from 'app/enums/true-command-status.enum'; import { TrueCommandConfig } from 'app/interfaces/true-command-config.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -45,7 +45,7 @@ describe('TruecommandConnectModalComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('truecommand.update'), ]), mockProvider(AppLoaderService), diff --git a/src/app/modules/truecommand/truecommand-button.component.spec.ts b/src/app/modules/truecommand/truecommand-button.component.spec.ts index 81f733c9497..f3ee5bc7573 100644 --- a/src/app/modules/truecommand/truecommand-button.component.spec.ts +++ b/src/app/modules/truecommand/truecommand-button.component.spec.ts @@ -5,7 +5,7 @@ import { Spectator, createComponentFactory, mockProvider, SpectatorFactory, } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; -import { mockWebSocket, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; import { TrueCommandStatus } from 'app/enums/true-command-status.enum'; import { TrueCommandConfig } from 'app/interfaces/true-command-config.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -41,7 +41,7 @@ describe('TruecommandButtonComponent', () => { TruecommandStatusModalComponent, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('truecommand.config', getFakeConfig(config)), ]), mockProvider(DialogService, { diff --git a/src/app/pages/apps/components/app-detail-view/app-detail-view.component.spec.ts b/src/app/pages/apps/components/app-detail-view/app-detail-view.component.spec.ts index a047f343b4a..d771347085d 100644 --- a/src/app/pages/apps/components/app-detail-view/app-detail-view.component.spec.ts +++ b/src/app/pages/apps/components/app-detail-view/app-detail-view.component.spec.ts @@ -6,7 +6,7 @@ import { createRoutingFactory, mockProvider, Spectator } from '@ngneat/spectator import { MockComponents } from 'ng-mocks'; import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; import { of } from 'rxjs'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { App } from 'app/interfaces/app.interface'; import { AvailableApp } from 'app/interfaces/available-app.interface'; import { CatalogApp } from 'app/interfaces/catalog.interface'; @@ -72,7 +72,7 @@ describe('AppDetailViewComponent', () => { ], providers: [ InstalledAppsStore, - mockWebSocket([ + mockApi([ mockJob('app.create'), mockJob('app.update'), mockCall('catalog.get_app_details', existingCatalogApp), diff --git a/src/app/pages/apps/components/app-detail-view/app-details-header/app-details-header.component.spec.ts b/src/app/pages/apps/components/app-detail-view/app-details-header/app-details-header.component.spec.ts index f5f2dcfc141..b88a25abd9a 100644 --- a/src/app/pages/apps/components/app-detail-view/app-details-header/app-details-header.component.spec.ts +++ b/src/app/pages/apps/components/app-detail-view/app-details-header/app-details-header.component.spec.ts @@ -10,7 +10,7 @@ import { MockComponent } from 'ng-mocks'; import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { AvailableApp } from 'app/interfaces/available-app.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { CleanLinkPipe } from 'app/modules/pipes/clean-link/clean-link.pipe'; @@ -65,7 +65,7 @@ describe('AppDetailsHeaderComponent', () => { confirm: jest.fn(() => of(true)), }), mockAuth(), - mockWebSocket([ + mockApi([ mockCall('auth.set_attribute'), ]), ], diff --git a/src/app/pages/apps/components/app-detail-view/app-resources-card/app-resources-card.component.spec.ts b/src/app/pages/apps/components/app-detail-view/app-resources-card/app-resources-card.component.spec.ts index 18a1d1778e8..10ec9cd4adb 100644 --- a/src/app/pages/apps/components/app-detail-view/app-resources-card/app-resources-card.component.spec.ts +++ b/src/app/pages/apps/components/app-detail-view/app-resources-card/app-resources-card.component.spec.ts @@ -1,7 +1,7 @@ import { Spectator } from '@ngneat/spectator'; import { createComponentFactory, mockProvider } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { FileSizePipe } from 'app/modules/pipes/file-size/file-size.pipe'; import { AppResourcesCardComponent } from 'app/pages/apps/components/app-detail-view/app-resources-card/app-resources-card.component'; import { DockerStore } from 'app/pages/apps/store/docker.store'; @@ -17,7 +17,7 @@ describe('AppResourcesCardComponent', () => { FileSizePipe, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('app.available_space', 2500), ]), mockProvider(DockerStore, { diff --git a/src/app/pages/apps/components/app-wizard/app-wizard.component.spec.ts b/src/app/pages/apps/components/app-wizard/app-wizard.component.spec.ts index bc994e3a200..ec2e23cff81 100644 --- a/src/app/pages/apps/components/app-wizard/app-wizard.component.spec.ts +++ b/src/app/pages/apps/components/app-wizard/app-wizard.component.spec.ts @@ -9,7 +9,7 @@ import { mockProvider, createComponentFactory } from '@ngneat/spectator/jest'; import { MockComponent } from 'ng-mocks'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { ChartFormValue, App, ChartSchemaNodeConf } from 'app/interfaces/app.interface'; import { CatalogApp, CatalogAppVersion } from 'app/interfaces/catalog.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -292,7 +292,7 @@ describe('AppWizardComponent', () => { getApp: jest.fn(() => of([existingAppEdit])), getAllApps: jest.fn(() => of([existingAppEdit])), }), - mockWebSocket([ + mockApi([ mockJob('app.create'), mockJob('app.update'), mockCall('catalog.get_app_details', existingCatalogApp), diff --git a/src/app/pages/apps/components/available-apps/available-apps-header/available-apps-header.component.spec.ts b/src/app/pages/apps/components/available-apps/available-apps-header/available-apps-header.component.spec.ts index f56c981681d..1069b561092 100644 --- a/src/app/pages/apps/components/available-apps/available-apps-header/available-apps-header.component.spec.ts +++ b/src/app/pages/apps/components/available-apps/available-apps-header/available-apps-header.component.spec.ts @@ -7,7 +7,7 @@ import { byText } from '@ngneat/spectator'; import { Spectator, createComponentFactory, mockProvider } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { App } from 'app/interfaces/app.interface'; import { AppsFiltersSort } from 'app/interfaces/apps-filters-values.interface'; import { AvailableApp } from 'app/interfaces/available-app.interface'; @@ -37,7 +37,7 @@ describe('AvailableAppsHeaderComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('app.query', [{}, {}, {}] as App[]), mockJob('catalog.sync'), ]), diff --git a/src/app/pages/apps/components/available-apps/available-apps.component.spec.ts b/src/app/pages/apps/components/available-apps/available-apps.component.spec.ts index 8ff26cf3663..3911b8068df 100644 --- a/src/app/pages/apps/components/available-apps/available-apps.component.spec.ts +++ b/src/app/pages/apps/components/available-apps/available-apps.component.spec.ts @@ -8,7 +8,7 @@ import { import { MockComponent, MockDeclaration } from 'ng-mocks'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { AvailableApp } from 'app/interfaces/available-app.interface'; import { PageHeaderComponent } from 'app/modules/page-header/page-title-header/page-header.component'; import { OrNotAvailablePipe } from 'app/modules/pipes/or-not-available/or-not-available.pipe'; @@ -55,7 +55,7 @@ describe('Finding app', () => { providers: [ DockerStore, InstalledAppsStore, - mockWebSocket([]), + mockApi([]), mockProvider(AppsStore, { isLoading$: of(false), availableApps$: of([]), diff --git a/src/app/pages/apps/components/catalog-settings/apps-settings.component.spec.ts b/src/app/pages/apps/components/catalog-settings/apps-settings.component.spec.ts index 521f9325d46..577f0670992 100644 --- a/src/app/pages/apps/components/catalog-settings/apps-settings.component.spec.ts +++ b/src/app/pages/apps/components/catalog-settings/apps-settings.component.spec.ts @@ -6,7 +6,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { of } from 'rxjs'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DockerConfig } from 'app/enums/docker-config.interface'; import { DockerNvidiaStatus } from 'app/enums/docker-nvidia-status.enum'; import { CatalogConfig } from 'app/interfaces/catalog.interface'; @@ -42,7 +42,7 @@ describe('AppsSettingsComponent', () => { IxIpInputWithNetmaskComponent, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('catalog.update'), mockCall('catalog.trains', ['stable', 'community', 'test']), mockCall('catalog.config', { diff --git a/src/app/pages/apps/components/custom-app-form/custom-app-form.component.spec.ts b/src/app/pages/apps/components/custom-app-form/custom-app-form.component.spec.ts index 42dc964ebcb..62774997dfb 100644 --- a/src/app/pages/apps/components/custom-app-form/custom-app-form.component.spec.ts +++ b/src/app/pages/apps/components/custom-app-form/custom-app-form.component.spec.ts @@ -7,7 +7,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { MockComponent } from 'ng-mocks'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { AppState } from 'app/enums/app-state.enum'; import { jsonToYaml } from 'app/helpers/json-to-yaml.helper'; import { App, ChartFormValue } from 'app/interfaces/app.interface'; @@ -81,7 +81,7 @@ describe('CustomAppFormComponent', () => { mockProvider(SlideInRef, { close: jest.fn(), }), - mockWebSocket([ + mockApi([ mockJob('app.create'), mockJob('app.update'), ]), diff --git a/src/app/pages/apps/components/docker-images/docker-image-delete-dialog/docker-image-delete-dialog.component.spec.ts b/src/app/pages/apps/components/docker-images/docker-image-delete-dialog/docker-image-delete-dialog.component.spec.ts index b2488b46d35..a9fbbf02507 100644 --- a/src/app/pages/apps/components/docker-images/docker-image-delete-dialog/docker-image-delete-dialog.component.spec.ts +++ b/src/app/pages/apps/components/docker-images/docker-image-delete-dialog/docker-image-delete-dialog.component.spec.ts @@ -9,7 +9,7 @@ import { FakeFormatDateTimePipe } from 'app/core/testing/classes/fake-format-dat import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { CoreBulkQuery, CoreBulkResponse } from 'app/interfaces/core-bulk.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; @@ -59,7 +59,7 @@ describe('DockerImageDeleteDialogComponent', () => { mockProvider(DialogService, { confirm: () => of(true), }), - mockWebSocket([ + mockApi([ mockJob('core.bulk'), mockCall('app.image.delete'), ]), diff --git a/src/app/pages/apps/components/docker-images/docker-images-list/docker-images-list.component.spec.ts b/src/app/pages/apps/components/docker-images/docker-images-list/docker-images-list.component.spec.ts index 2f3fe1695d9..1d994a406cb 100644 --- a/src/app/pages/apps/components/docker-images/docker-images-list/docker-images-list.component.spec.ts +++ b/src/app/pages/apps/components/docker-images/docker-images-list/docker-images-list.component.spec.ts @@ -6,7 +6,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { MockComponent } from 'ng-mocks'; import { of, Subject } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { SearchInput1Component } from 'app/modules/forms/search-input1/search-input1.component'; import { IxIconHarness } from 'app/modules/ix-icon/ix-icon.harness'; @@ -34,7 +34,7 @@ describe('DockerImagesListComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('app.image.query', fakeDockerImagesDataSource), mockCall('app.image.delete'), ]), diff --git a/src/app/pages/apps/components/docker-images/pull-image-form/pull-image-form.component.spec.ts b/src/app/pages/apps/components/docker-images/pull-image-form/pull-image-form.component.spec.ts index 13aab876858..43639286703 100644 --- a/src/app/pages/apps/components/docker-images/pull-image-form/pull-image-form.component.spec.ts +++ b/src/app/pages/apps/components/docker-images/pull-image-form/pull-image-form.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { FormErrorHandlerService } from 'app/modules/forms/ix-forms/services/form-error-handler.service'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; @@ -25,7 +25,7 @@ describe('PullImageFormComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockJob('app.image.pull'), ]), mockProvider(SlideInService), diff --git a/src/app/pages/apps/components/installed-apps/app-bulk-upgrade/app-bulk-upgrade.component.spec.ts b/src/app/pages/apps/components/installed-apps/app-bulk-upgrade/app-bulk-upgrade.component.spec.ts index 11937966474..805473fbefe 100644 --- a/src/app/pages/apps/components/installed-apps/app-bulk-upgrade/app-bulk-upgrade.component.spec.ts +++ b/src/app/pages/apps/components/installed-apps/app-bulk-upgrade/app-bulk-upgrade.component.spec.ts @@ -8,7 +8,7 @@ import { ImgFallbackModule } from 'ngx-img-fallback'; import { FakeFormatDateTimePipe } from 'app/core/testing/classes/fake-format-datetime.pipe'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { LetDirective } from 'app/directives/app-let.directive'; import { AppState } from 'app/enums/app-state.enum'; import { App } from 'app/interfaces/app.interface'; @@ -95,7 +95,7 @@ describe('AppBulkUpgradeComponent', () => { mockProvider(MatDialogRef), mockProvider(DialogService), mockProvider(SnackbarService), - mockWebSocket([ + mockApi([ mockJob('core.bulk'), mockCall('app.upgrade_summary', fakeUpgradeSummary), mockJob('app.upgrade', fakeSuccessfulJob(fakeAppOne)), diff --git a/src/app/pages/apps/components/installed-apps/app-info-card/app-info-card.component.spec.ts b/src/app/pages/apps/components/installed-apps/app-info-card/app-info-card.component.spec.ts index 7be08a61894..8c5cedc4504 100644 --- a/src/app/pages/apps/components/installed-apps/app-info-card/app-info-card.component.spec.ts +++ b/src/app/pages/apps/components/installed-apps/app-info-card/app-info-card.component.spec.ts @@ -11,7 +11,7 @@ import { ImgFallbackDirective, ImgFallbackModule } from 'ngx-img-fallback'; import { NgxSkeletonLoaderComponent } from 'ngx-skeleton-loader'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket, mockJob, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockJob, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; import { App } from 'app/interfaces/app.interface'; import { AppUpgradeSummary } from 'app/interfaces/application.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -103,7 +103,7 @@ describe('AppInfoCardComponent', () => { }), mockProvider(RedirectService), mockAuth(), - mockWebSocket([ + mockApi([ mockJob('app.upgrade'), mockJob('app.delete'), mockCall('app.rollback_versions', ['1.2.1']), diff --git a/src/app/pages/apps/components/installed-apps/app-rollback-modal/app-rollback-modal.component.spec.ts b/src/app/pages/apps/components/installed-apps/app-rollback-modal/app-rollback-modal.component.spec.ts index 741a3389ce9..9abcccea532 100644 --- a/src/app/pages/apps/components/installed-apps/app-rollback-modal/app-rollback-modal.component.spec.ts +++ b/src/app/pages/apps/components/installed-apps/app-rollback-modal/app-rollback-modal.component.spec.ts @@ -6,7 +6,7 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { App } from 'app/interfaces/app.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxSelectHarness } from 'app/modules/forms/ix-forms/components/ix-select/ix-select.harness'; @@ -31,7 +31,7 @@ describe('AppRollbackModalComponent', () => { } as App, }, mockAuth(), - mockWebSocket([ + mockApi([ mockJob('app.rollback'), ]), mockProvider(DialogService, { diff --git a/src/app/pages/apps/components/installed-apps/installed-apps.component.spec.ts b/src/app/pages/apps/components/installed-apps/installed-apps.component.spec.ts index bfb87dab95f..0c05001db63 100644 --- a/src/app/pages/apps/components/installed-apps/installed-apps.component.spec.ts +++ b/src/app/pages/apps/components/installed-apps/installed-apps.component.spec.ts @@ -11,7 +11,7 @@ import { provideMockStore } from '@ngrx/store/testing'; import { MockComponent, MockDeclaration } from 'ng-mocks'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { AppState } from 'app/enums/app-state.enum'; import { JobState } from 'app/enums/job-state.enum'; import { App } from 'app/interfaces/app.interface'; @@ -116,7 +116,7 @@ describe('InstalledAppsComponent', () => { }, }, }, - mockWebSocket([]), + mockApi([]), mockAuth(), mockProvider(AppsStatsService), ], diff --git a/src/app/pages/apps/services/applications.service.spec.ts b/src/app/pages/apps/services/applications.service.spec.ts index a04521fb039..ee42f7a1f99 100644 --- a/src/app/pages/apps/services/applications.service.spec.ts +++ b/src/app/pages/apps/services/applications.service.spec.ts @@ -1,7 +1,7 @@ import { createServiceFactory, SpectatorService } from '@ngneat/spectator/jest'; import { firstValueFrom } from 'rxjs'; import { customApp } from 'app/constants/catalog.constants'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { AppExtraCategory } from 'app/enums/app-extra-category.enum'; import { AppsFiltersSort, AppsFiltersValues } from 'app/interfaces/apps-filters-values.interface'; import { AvailableApp } from 'app/interfaces/available-app.interface'; @@ -34,7 +34,7 @@ describe('ApplicationsService', () => { const createService = createServiceFactory({ service: ApplicationsService, providers: [ - mockWebSocket([ + mockApi([ mockCall('app.upgrade_summary'), mockCall('app.available', appsResponse), mockCall('app.latest', appsResponse), diff --git a/src/app/pages/apps/store/docker.store.spec.ts b/src/app/pages/apps/store/docker.store.spec.ts index fbd292b8b6a..cedc7c465e7 100644 --- a/src/app/pages/apps/store/docker.store.spec.ts +++ b/src/app/pages/apps/store/docker.store.spec.ts @@ -1,6 +1,6 @@ import { createServiceFactory, SpectatorService } from '@ngneat/spectator/jest'; import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DockerConfig } from 'app/enums/docker-config.interface'; import { DockerNvidiaStatus } from 'app/enums/docker-nvidia-status.enum'; import { DockerStatus } from 'app/enums/docker-status.enum'; @@ -12,7 +12,7 @@ describe('DockerStore', () => { const createComponent = createServiceFactory({ service: DockerStore, providers: [ - mockWebSocket([ + mockApi([ mockCall('docker.config', { enable_image_updates: true, pool: 'pewl', diff --git a/src/app/pages/audit/audit.component.spec.ts b/src/app/pages/audit/audit.component.spec.ts index 3be142f2aed..c31adfbb5ab 100644 --- a/src/app/pages/audit/audit.component.spec.ts +++ b/src/app/pages/audit/audit.component.spec.ts @@ -3,7 +3,7 @@ import { MatButtonToggleChange, MatButtonToggleModule } from '@angular/material/ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { provideMockStore } from '@ngrx/store/testing'; import { MockComponents } from 'ng-mocks'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { AuditEvent, AuditService } from 'app/enums/audit.enum'; import { ControllerType } from 'app/enums/controller-type.enum'; import { AdvancedConfig } from 'app/interfaces/advanced-config.interface'; @@ -78,7 +78,7 @@ describe('AuditComponent', () => { mockProvider(LocaleService, { timezone: 'America/Los_Angeles', }), - mockWebSocket([ + mockApi([ mockCall('audit.query', (params) => { if (params[0]['query-options'].count) { // TODO: Not correct. Figure out how to solve this for query endpoints. diff --git a/src/app/pages/credentials/backup-credentials/cloud-credentials-card/cloud-credentials-card.component.spec.ts b/src/app/pages/credentials/backup-credentials/cloud-credentials-card/cloud-credentials-card.component.spec.ts index 47a9b7a0366..a48679051d2 100644 --- a/src/app/pages/credentials/backup-credentials/cloud-credentials-card/cloud-credentials-card.component.spec.ts +++ b/src/app/pages/credentials/backup-credentials/cloud-credentials-card/cloud-credentials-card.component.spec.ts @@ -5,7 +5,7 @@ import { MatDialog } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { CloudSyncCredential } from 'app/interfaces/cloudsync-credential.interface'; import { CloudSyncProvider } from 'app/interfaces/cloudsync-provider.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -63,7 +63,7 @@ describe('CloudCredentialsCardComponent', () => { IxTablePagerShowMoreComponent, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('cloudsync.providers', providers), mockCall('cloudsync.credentials.query', credentials), mockCall('cloudsync.credentials.delete'), diff --git a/src/app/pages/credentials/backup-credentials/cloud-credentials-form/cloud-credentials-form.component.spec.ts b/src/app/pages/credentials/backup-credentials/cloud-credentials-form/cloud-credentials-form.component.spec.ts index 19b7c45cd20..530b0391039 100644 --- a/src/app/pages/credentials/backup-credentials/cloud-credentials-form/cloud-credentials-form.component.spec.ts +++ b/src/app/pages/credentials/backup-credentials/cloud-credentials-form/cloud-credentials-form.component.spec.ts @@ -10,7 +10,7 @@ import { import { of } from 'rxjs'; import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { CloudSyncProviderName } from 'app/enums/cloudsync-provider.enum'; import { CloudSyncCredential } from 'app/interfaces/cloudsync-credential.interface'; import { CloudSyncProvider } from 'app/interfaces/cloudsync-provider.interface'; @@ -113,7 +113,7 @@ describe('CloudCredentialsFormComponent', () => { mockProvider(SnackbarService), mockProvider(DialogService), mockProvider(ChainedRef, chainedRef), - mockWebSocket([ + mockApi([ mockCall('cloudsync.credentials.query', []), mockCall('cloudsync.credentials.create', fakeCloudSyncCredential), mockCall('cloudsync.credentials.update', fakeCloudSyncCredential), diff --git a/src/app/pages/credentials/backup-credentials/cloud-credentials-form/provider-forms/sftp-provider-form/sftp-provider-form.component.spec.ts b/src/app/pages/credentials/backup-credentials/cloud-credentials-form/provider-forms/sftp-provider-form/sftp-provider-form.component.spec.ts index 255b4067301..25ec2396404 100644 --- a/src/app/pages/credentials/backup-credentials/cloud-credentials-form/provider-forms/sftp-provider-form/sftp-provider-form.component.spec.ts +++ b/src/app/pages/credentials/backup-credentials/cloud-credentials-form/provider-forms/sftp-provider-form/sftp-provider-form.component.spec.ts @@ -2,7 +2,7 @@ import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { ReactiveFormsModule } from '@angular/forms'; import { createComponentFactory, Spectator } from '@ngneat/spectator/jest'; import { lastValueFrom } from 'rxjs'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { KeychainCredentialType } from 'app/enums/keychain-credential-type.enum'; import { KeychainCredential } from 'app/interfaces/keychain-credential.interface'; import { IxSelectHarness } from 'app/modules/forms/ix-forms/components/ix-select/ix-select.harness'; @@ -21,7 +21,7 @@ describe('SftpProviderFormComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('keychaincredential.query', [ { id: 1, name: 'Key 1' }, { id: 2, name: 'Key 2' }, diff --git a/src/app/pages/credentials/backup-credentials/ssh-connection-card/ssh-connection-card.component.spec.ts b/src/app/pages/credentials/backup-credentials/ssh-connection-card/ssh-connection-card.component.spec.ts index 6bedb944313..a6a00e63389 100644 --- a/src/app/pages/credentials/backup-credentials/ssh-connection-card/ssh-connection-card.component.spec.ts +++ b/src/app/pages/credentials/backup-credentials/ssh-connection-card/ssh-connection-card.component.spec.ts @@ -5,7 +5,7 @@ import { MatDialog } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { KeychainSshCredentials } from 'app/interfaces/keychain-credential.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxIconHarness } from 'app/modules/ix-icon/ix-icon.harness'; @@ -59,7 +59,7 @@ describe('SshConnectionCardComponent', () => { IxTablePagerShowMoreComponent, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('keychaincredential.query', connections), mockCall('keychaincredential.delete'), ]), diff --git a/src/app/pages/credentials/backup-credentials/ssh-connection-form/ssh-connection-form.component.spec.ts b/src/app/pages/credentials/backup-credentials/ssh-connection-form/ssh-connection-form.component.spec.ts index fd0051ff8e8..ca2f62e8186 100644 --- a/src/app/pages/credentials/backup-credentials/ssh-connection-form/ssh-connection-form.component.spec.ts +++ b/src/app/pages/credentials/backup-credentials/ssh-connection-form/ssh-connection-form.component.spec.ts @@ -8,7 +8,7 @@ import { } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { SshConnectionsSetupMethod } from 'app/enums/ssh-connections-setup-method.enum'; import { KeychainSshCredentials } from 'app/interfaces/keychain-credential.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -47,7 +47,7 @@ describe('SshConnectionFormComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('keychaincredential.remote_ssh_host_key_scan', 'ssh-rsaAREMOTE'), mockCall('keychaincredential.setup_ssh_connection', existingConnection), mockCall('keychaincredential.update', existingConnection), diff --git a/src/app/pages/credentials/backup-credentials/ssh-keypair-card/ssh-keypair-card.component.spec.ts b/src/app/pages/credentials/backup-credentials/ssh-keypair-card/ssh-keypair-card.component.spec.ts index fc37a4ecfb9..25eaa664ad0 100644 --- a/src/app/pages/credentials/backup-credentials/ssh-keypair-card/ssh-keypair-card.component.spec.ts +++ b/src/app/pages/credentials/backup-credentials/ssh-keypair-card/ssh-keypair-card.component.spec.ts @@ -5,7 +5,7 @@ import { MatDialog } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { KeychainSshKeyPair } from 'app/interfaces/keychain-credential.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxIconHarness } from 'app/modules/ix-icon/ix-icon.harness'; @@ -53,7 +53,7 @@ describe('SshKeypairCardComponent', () => { IxTablePagerShowMoreComponent, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('keychaincredential.query', credentials), mockCall('keychaincredential.delete'), ]), diff --git a/src/app/pages/credentials/backup-credentials/ssh-keypair-form/ssh-keypair-form.component.spec.ts b/src/app/pages/credentials/backup-credentials/ssh-keypair-form/ssh-keypair-form.component.spec.ts index 6ccbf4cffb7..a516309d8e1 100644 --- a/src/app/pages/credentials/backup-credentials/ssh-keypair-form/ssh-keypair-form.component.spec.ts +++ b/src/app/pages/credentials/backup-credentials/ssh-keypair-form/ssh-keypair-form.component.spec.ts @@ -7,7 +7,7 @@ import { createComponentFactory, mockProvider, Spectator, } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { KeychainCredentialType } from 'app/enums/keychain-credential-type.enum'; import { KeychainSshKeyPair, SshKeyPair } from 'app/interfaces/keychain-credential.interface'; import { @@ -40,7 +40,7 @@ describe('SshKeypairFormComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('keychaincredential.generate_ssh_key_pair', { private_key: 'Generated private key', public_key: 'Generated public key', diff --git a/src/app/pages/credentials/certificates-dash/acme-dns-authenticator-list/acme-dns-authenticator-list.component.spec.ts b/src/app/pages/credentials/certificates-dash/acme-dns-authenticator-list/acme-dns-authenticator-list.component.spec.ts index 9cd0073cf73..84e279d0c24 100644 --- a/src/app/pages/credentials/certificates-dash/acme-dns-authenticator-list/acme-dns-authenticator-list.component.spec.ts +++ b/src/app/pages/credentials/certificates-dash/acme-dns-authenticator-list/acme-dns-authenticator-list.component.spec.ts @@ -5,7 +5,7 @@ import { Spectator } from '@ngneat/spectator'; import { createComponentFactory, mockProvider } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; import { DnsAuthenticatorType } from 'app/enums/dns-authenticator-type.enum'; import { DnsAuthenticator } from 'app/interfaces/dns-authenticator.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -37,7 +37,7 @@ describe('AcmeDnsAuthenticatorListComponent', () => { IxTablePagerShowMoreComponent, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('acme.dns.authenticator.query', authenticators), mockCall('acme.dns.authenticator.delete', true), ]), diff --git a/src/app/pages/credentials/certificates-dash/certificate-acme-add/certificate-acme-add.component.spec.ts b/src/app/pages/credentials/certificates-dash/certificate-acme-add/certificate-acme-add.component.spec.ts index 36f0321c294..dcb463a188f 100644 --- a/src/app/pages/credentials/certificates-dash/certificate-acme-add/certificate-acme-add.component.spec.ts +++ b/src/app/pages/credentials/certificates-dash/certificate-acme-add/certificate-acme-add.component.spec.ts @@ -7,7 +7,7 @@ import { of } from 'rxjs'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; import { - mockCall, mockJob, mockWebSocket, + mockCall, mockJob, mockApi, } from 'app/core/testing/utils/mock-websocket.utils'; import { CertificateCreateType } from 'app/enums/certificate-create-type.enum'; import { DnsAuthenticator } from 'app/interfaces/dns-authenticator.interface'; @@ -30,7 +30,7 @@ describe('CertificateAcmeAddComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('certificate.acme_server_choices', { 'https://acme-staging-v02.api.letsencrypt.org/directory': "Let's Encrypt Staging Directory", 'https://acme-v02.api.letsencrypt.org/directory': "Let's Encrypt Production Directory", diff --git a/src/app/pages/credentials/certificates-dash/certificate-authority-add/certificate-authority-add.component.spec.ts b/src/app/pages/credentials/certificates-dash/certificate-authority-add/certificate-authority-add.component.spec.ts index 8bd3c995a1c..faa90f625ad 100644 --- a/src/app/pages/credentials/certificates-dash/certificate-authority-add/certificate-authority-add.component.spec.ts +++ b/src/app/pages/credentials/certificates-dash/certificate-authority-add/certificate-authority-add.component.spec.ts @@ -9,7 +9,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { MockComponent } from 'ng-mocks'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { CaCreateType } from 'app/enums/ca-create-type.enum'; import { CertificateDigestAlgorithm } from 'app/enums/certificate-digest-algorithm.enum'; import { CertificateKeyType } from 'app/enums/certificate-key-type.enum'; @@ -112,7 +112,7 @@ describe('CertificateAuthorityAddComponent', () => { MockComponent(SummaryComponent), ], providers: [ - mockWebSocket([ + mockApi([ mockCall('webui.crypto.certificateauthority_profiles', { CA: profile, }), diff --git a/src/app/pages/credentials/certificates-dash/certificate-authority-add/steps/ca-identifier-and-type/ca-identifier-and-type.component.spec.ts b/src/app/pages/credentials/certificates-dash/certificate-authority-add/steps/ca-identifier-and-type/ca-identifier-and-type.component.spec.ts index 703dc8c87a9..fc13ce1ee55 100644 --- a/src/app/pages/credentials/certificates-dash/certificate-authority-add/steps/ca-identifier-and-type/ca-identifier-and-type.component.spec.ts +++ b/src/app/pages/credentials/certificates-dash/certificate-authority-add/steps/ca-identifier-and-type/ca-identifier-and-type.component.spec.ts @@ -3,7 +3,7 @@ import { HarnessLoader } from '@angular/cdk/testing'; import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { ReactiveFormsModule } from '@angular/forms'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { CaCreateType } from 'app/enums/ca-create-type.enum'; import { CertificateProfile } from 'app/interfaces/certificate.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -27,7 +27,7 @@ describe('CaIdentifierAndTypeComponent', () => { ], providers: [ CdkStepper, - mockWebSocket([ + mockApi([ mockCall('webui.crypto.certificateauthority_profiles', { CA: caProfile, 'OpenVPN Root CA': openvpnProfile, diff --git a/src/app/pages/credentials/certificates-dash/certificate-authority-edit/certificate-authority-edit.component.spec.ts b/src/app/pages/credentials/certificates-dash/certificate-authority-edit/certificate-authority-edit.component.spec.ts index 9264363c7f2..be21e700738 100644 --- a/src/app/pages/credentials/certificates-dash/certificate-authority-edit/certificate-authority-edit.component.spec.ts +++ b/src/app/pages/credentials/certificates-dash/certificate-authority-edit/certificate-authority-edit.component.spec.ts @@ -6,7 +6,7 @@ import { MatDialog } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { MockComponent } from 'ng-mocks'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { CertificateAuthority } from 'app/interfaces/certificate-authority.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxCheckboxHarness } from 'app/modules/forms/ix-forms/components/ix-checkbox/ix-checkbox.harness'; @@ -40,7 +40,7 @@ describe('CertificateAuthorityEditComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('certificateauthority.update'), ]), mockProvider(MatDialog), diff --git a/src/app/pages/credentials/certificates-dash/certificate-authority-list/certificate-authority-list.component.spec.ts b/src/app/pages/credentials/certificates-dash/certificate-authority-list/certificate-authority-list.component.spec.ts index 5e8cc41285c..ecb7f7a3fff 100644 --- a/src/app/pages/credentials/certificates-dash/certificate-authority-list/certificate-authority-list.component.spec.ts +++ b/src/app/pages/credentials/certificates-dash/certificate-authority-list/certificate-authority-list.component.spec.ts @@ -6,7 +6,7 @@ import { Spectator } from '@ngneat/spectator'; import { createComponentFactory, mockProvider } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; import { CertificateAuthority } from 'app/interfaces/certificate-authority.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxIconHarness } from 'app/modules/ix-icon/ix-icon.harness'; @@ -48,7 +48,7 @@ describe('CertificateAuthorityListComponent', () => { IxTablePagerShowMoreComponent, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('certificateauthority.query', certificates), mockCall('certificateauthority.delete', true), ]), diff --git a/src/app/pages/credentials/certificates-dash/certificate-edit/certificate-edit.component.spec.ts b/src/app/pages/credentials/certificates-dash/certificate-edit/certificate-edit.component.spec.ts index d6b3de32545..35c8aea63c5 100644 --- a/src/app/pages/credentials/certificates-dash/certificate-edit/certificate-edit.component.spec.ts +++ b/src/app/pages/credentials/certificates-dash/certificate-edit/certificate-edit.component.spec.ts @@ -9,7 +9,7 @@ import { import { MockComponent } from 'ng-mocks'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { Certificate } from 'app/interfaces/certificate.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxCheckboxHarness } from 'app/modules/forms/ix-forms/components/ix-checkbox/ix-checkbox.harness'; @@ -53,7 +53,7 @@ describe('CertificateEditComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockJob('certificate.update'), ]), mockProvider(MatDialog), diff --git a/src/app/pages/credentials/certificates-dash/certificate-list/certificate-list.component.spec.ts b/src/app/pages/credentials/certificates-dash/certificate-list/certificate-list.component.spec.ts index a09aad5e85c..e324ff1fa11 100644 --- a/src/app/pages/credentials/certificates-dash/certificate-list/certificate-list.component.spec.ts +++ b/src/app/pages/credentials/certificates-dash/certificate-list/certificate-list.component.spec.ts @@ -7,7 +7,7 @@ import { createComponentFactory, mockProvider } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket, mockCall, mockJob } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall, mockJob } from 'app/core/testing/utils/mock-websocket.utils'; import { Certificate } from 'app/interfaces/certificate.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxIconHarness } from 'app/modules/ix-icon/ix-icon.harness'; @@ -65,7 +65,7 @@ describe('CertificateListComponent', () => { IxTablePagerShowMoreComponent, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('certificate.query', certificates), mockJob('certificate.delete', fakeSuccessfulJob(true)), mockJob('certificate.update', fakeSuccessfulJob()), diff --git a/src/app/pages/credentials/certificates-dash/csr-add/csr-add.component.spec.ts b/src/app/pages/credentials/certificates-dash/csr-add/csr-add.component.spec.ts index 4a0536d7898..a8f2fc12543 100644 --- a/src/app/pages/credentials/certificates-dash/csr-add/csr-add.component.spec.ts +++ b/src/app/pages/credentials/certificates-dash/csr-add/csr-add.component.spec.ts @@ -10,7 +10,7 @@ import { MockComponent } from 'ng-mocks'; import { of } from 'rxjs'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { CertificateCreateType } from 'app/enums/certificate-create-type.enum'; import { CertificateDigestAlgorithm } from 'app/enums/certificate-digest-algorithm.enum'; import { CertificateKeyType } from 'app/enums/certificate-key-type.enum'; @@ -71,7 +71,7 @@ describe('CsrAddComponent', () => { MockComponent(SummaryComponent), ], providers: [ - mockWebSocket([ + mockApi([ mockCall('webui.crypto.csr_profiles', { 'HTTPS RSA Certificate': profile, }), diff --git a/src/app/pages/credentials/certificates-dash/csr-add/steps/csr-identifier-and-type/csr-identifier-and-type.component.spec.ts b/src/app/pages/credentials/certificates-dash/csr-add/steps/csr-identifier-and-type/csr-identifier-and-type.component.spec.ts index ef8be19cd31..3d0e24c0cbc 100644 --- a/src/app/pages/credentials/certificates-dash/csr-add/steps/csr-identifier-and-type/csr-identifier-and-type.component.spec.ts +++ b/src/app/pages/credentials/certificates-dash/csr-add/steps/csr-identifier-and-type/csr-identifier-and-type.component.spec.ts @@ -3,7 +3,7 @@ import { HarnessLoader } from '@angular/cdk/testing'; import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { ReactiveFormsModule } from '@angular/forms'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { CertificateCreateType } from 'app/enums/certificate-create-type.enum'; import { CertificateProfile } from 'app/interfaces/certificate.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -27,7 +27,7 @@ describe('CsrIdentifierAndTypeComponent', () => { ], providers: [ CdkStepper, - mockWebSocket([ + mockApi([ mockCall('webui.crypto.csr_profiles', { 'HTTPS ECC Certificate': httpsProfile, 'Openvpn Client Certificate': openvpnProfile, diff --git a/src/app/pages/credentials/certificates-dash/csr-list/csr-list.component.spec.ts b/src/app/pages/credentials/certificates-dash/csr-list/csr-list.component.spec.ts index 4f77d0fec3b..9abfeb22947 100644 --- a/src/app/pages/credentials/certificates-dash/csr-list/csr-list.component.spec.ts +++ b/src/app/pages/credentials/certificates-dash/csr-list/csr-list.component.spec.ts @@ -7,7 +7,7 @@ import { createComponentFactory, mockProvider } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket, mockCall, mockJob } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall, mockJob } from 'app/core/testing/utils/mock-websocket.utils'; import { Certificate } from 'app/interfaces/certificate.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxIconHarness } from 'app/modules/ix-icon/ix-icon.harness'; @@ -58,7 +58,7 @@ describe('CertificateSigningRequestsListComponent', () => { IxTablePagerShowMoreComponent, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('certificate.query', certificates), mockJob('certificate.delete', fakeSuccessfulJob(true)), ]), diff --git a/src/app/pages/credentials/certificates-dash/forms/acmedns-form/acmedns-form.component.spec.ts b/src/app/pages/credentials/certificates-dash/forms/acmedns-form/acmedns-form.component.spec.ts index 01a4a15b82b..8186e6c8327 100644 --- a/src/app/pages/credentials/certificates-dash/forms/acmedns-form/acmedns-form.component.spec.ts +++ b/src/app/pages/credentials/certificates-dash/forms/acmedns-form/acmedns-form.component.spec.ts @@ -6,7 +6,7 @@ import { createComponentFactory, mockProvider, Spectator, } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DnsAuthenticatorType } from 'app/enums/dns-authenticator-type.enum'; import { AuthenticatorSchema, DnsAuthenticator } from 'app/interfaces/dns-authenticator.interface'; import { Option } from 'app/interfaces/option.interface'; @@ -45,7 +45,7 @@ describe('AcmednsFormComponent', () => { provide: SLIDE_IN_DATA, useValue: undefined, }, - mockWebSocket([ + mockApi([ mockCall('acme.dns.authenticator.create'), mockCall('acme.dns.authenticator.update'), mockCall('acme.dns.authenticator.authenticator_schemas', [{ diff --git a/src/app/pages/credentials/certificates-dash/forms/certificate-add/certificate-add.component.spec.ts b/src/app/pages/credentials/certificates-dash/forms/certificate-add/certificate-add.component.spec.ts index baa85acc4e2..f2fca257899 100644 --- a/src/app/pages/credentials/certificates-dash/forms/certificate-add/certificate-add.component.spec.ts +++ b/src/app/pages/credentials/certificates-dash/forms/certificate-add/certificate-add.component.spec.ts @@ -11,7 +11,7 @@ import { of } from 'rxjs'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; import { - mockCall, mockJob, mockWebSocket, + mockCall, mockJob, mockApi, } from 'app/core/testing/utils/mock-websocket.utils'; import { CertificateCreateType } from 'app/enums/certificate-create-type.enum'; import { CertificateDigestAlgorithm } from 'app/enums/certificate-digest-algorithm.enum'; @@ -76,7 +76,7 @@ describe('CertificateAddComponent', () => { MockComponent(SummaryComponent), ], providers: [ - mockWebSocket([ + mockApi([ mockCall('webui.crypto.certificate_profiles', { 'HTTPS RSA Certificate': profile, }), diff --git a/src/app/pages/credentials/certificates-dash/forms/certificate-add/steps/certificate-identifier-and-type/certificate-identifier-and-type.component.spec.ts b/src/app/pages/credentials/certificates-dash/forms/certificate-add/steps/certificate-identifier-and-type/certificate-identifier-and-type.component.spec.ts index 31c2366630e..d93c8e61faa 100644 --- a/src/app/pages/credentials/certificates-dash/forms/certificate-add/steps/certificate-identifier-and-type/certificate-identifier-and-type.component.spec.ts +++ b/src/app/pages/credentials/certificates-dash/forms/certificate-add/steps/certificate-identifier-and-type/certificate-identifier-and-type.component.spec.ts @@ -3,7 +3,7 @@ import { HarnessLoader } from '@angular/cdk/testing'; import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { ReactiveFormsModule } from '@angular/forms'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { CertificateCreateType } from 'app/enums/certificate-create-type.enum'; import { CertificateProfile } from 'app/interfaces/certificate.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -27,7 +27,7 @@ describe('CertificateIdentifierAndTypeComponent', () => { ], providers: [ CdkStepper, - mockWebSocket([ + mockApi([ mockCall('webui.crypto.certificate_profiles', { 'HTTPS ECC Certificate': httpsProfile, 'Openvpn Client Certificate': openvpnProfile, diff --git a/src/app/pages/credentials/certificates-dash/forms/certificate-add/steps/certificate-import/certificate-import.component.spec.ts b/src/app/pages/credentials/certificates-dash/forms/certificate-add/steps/certificate-import/certificate-import.component.spec.ts index cb17777cb9a..14493667053 100644 --- a/src/app/pages/credentials/certificates-dash/forms/certificate-add/steps/certificate-import/certificate-import.component.spec.ts +++ b/src/app/pages/credentials/certificates-dash/forms/certificate-add/steps/certificate-import/certificate-import.component.spec.ts @@ -3,7 +3,7 @@ import { HarnessLoader } from '@angular/cdk/testing'; import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { ReactiveFormsModule } from '@angular/forms'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { Certificate } from 'app/interfaces/certificate.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; @@ -27,7 +27,7 @@ describe('CertificateImportComponent', () => { ], providers: [ CdkStepper, - mockWebSocket([ + mockApi([ mockCall('certificate.query', [ { id: 1, diff --git a/src/app/pages/credentials/certificates-dash/forms/common-steps/certificate-constraints/certificate-constraints.component.spec.ts b/src/app/pages/credentials/certificates-dash/forms/common-steps/certificate-constraints/certificate-constraints.component.spec.ts index 077c89a3c65..074ce34ab1c 100644 --- a/src/app/pages/credentials/certificates-dash/forms/common-steps/certificate-constraints/certificate-constraints.component.spec.ts +++ b/src/app/pages/credentials/certificates-dash/forms/common-steps/certificate-constraints/certificate-constraints.component.spec.ts @@ -3,7 +3,7 @@ import { HarnessLoader } from '@angular/cdk/testing'; import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { ReactiveFormsModule } from '@angular/forms'; import { createComponentFactory, Spectator } from '@ngneat/spectator/jest'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { CertificateExtensions } from 'app/interfaces/certificate-authority.interface'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; import { @@ -27,7 +27,7 @@ describe('CertificateConstraintsComponent', () => { ], providers: [ CdkStepper, - mockWebSocket([ + mockApi([ mockCall('certificate.extended_key_usage_choices', { CLIENT_AUTH: 'CLIENT_AUTH', CODE_SIGNING: 'CODE_SIGNING', diff --git a/src/app/pages/credentials/certificates-dash/forms/common-steps/certificate-options/certificate-options.component.spec.ts b/src/app/pages/credentials/certificates-dash/forms/common-steps/certificate-options/certificate-options.component.spec.ts index 20023114087..4da5c20d76b 100644 --- a/src/app/pages/credentials/certificates-dash/forms/common-steps/certificate-options/certificate-options.component.spec.ts +++ b/src/app/pages/credentials/certificates-dash/forms/common-steps/certificate-options/certificate-options.component.spec.ts @@ -4,7 +4,7 @@ import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { ReactiveFormsModule } from '@angular/forms'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { CertificateDigestAlgorithm } from 'app/enums/certificate-digest-algorithm.enum'; import { CertificateKeyType } from 'app/enums/certificate-key-type.enum'; import { CertificateAuthority } from 'app/interfaces/certificate-authority.interface'; @@ -26,7 +26,7 @@ describe('CertificateOptionsComponent', () => { ], providers: [ CdkStepper, - mockWebSocket([ + mockApi([ mockCall('certificate.ec_curve_choices', { BrainpoolP512R1: 'BrainpoolP512R1', SECP256K1: 'SECP256K1', diff --git a/src/app/pages/credentials/certificates-dash/sign-csr-dialog/sign-csr-dialog.component.spec.ts b/src/app/pages/credentials/certificates-dash/sign-csr-dialog/sign-csr-dialog.component.spec.ts index cdc83bb2b56..3d34fb9a974 100644 --- a/src/app/pages/credentials/certificates-dash/sign-csr-dialog/sign-csr-dialog.component.spec.ts +++ b/src/app/pages/credentials/certificates-dash/sign-csr-dialog/sign-csr-dialog.component.spec.ts @@ -6,7 +6,7 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxSelectHarness } from 'app/modules/forms/ix-forms/components/ix-select/ix-select.harness'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; @@ -23,7 +23,7 @@ describe('SignCsrDialogComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('certificateauthority.ca_sign_csr'), ]), mockProvider(MatDialogRef), diff --git a/src/app/pages/credentials/groups/group-details-row/delete-group-dialog/delete-group-dialog.component.spec.ts b/src/app/pages/credentials/groups/group-details-row/delete-group-dialog/delete-group-dialog.component.spec.ts index fa806146638..89722ee266d 100644 --- a/src/app/pages/credentials/groups/group-details-row/delete-group-dialog/delete-group-dialog.component.spec.ts +++ b/src/app/pages/credentials/groups/group-details-row/delete-group-dialog/delete-group-dialog.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { Group } from 'app/interfaces/group.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxCheckboxHarness } from 'app/modules/forms/ix-forms/components/ix-checkbox/ix-checkbox.harness'; @@ -25,7 +25,7 @@ describe('DeleteGroupDialogComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('group.delete'), ]), mockProvider(SnackbarService), diff --git a/src/app/pages/credentials/groups/group-details-row/group-details-row.component.spec.ts b/src/app/pages/credentials/groups/group-details-row/group-details-row.component.spec.ts index 1ccaeddc31e..53643c91623 100644 --- a/src/app/pages/credentials/groups/group-details-row/group-details-row.component.spec.ts +++ b/src/app/pages/credentials/groups/group-details-row/group-details-row.component.spec.ts @@ -9,7 +9,7 @@ import { provideMockStore } from '@ngrx/store/testing'; import { MockComponent } from 'ng-mocks'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; import { Group } from 'app/interfaces/group.interface'; import { Preferences } from 'app/interfaces/preferences.interface'; import { @@ -44,7 +44,7 @@ describe('GroupDetailsRowComponent', () => { ], providers: [ mockProvider(SlideInService), - mockWebSocket([ + mockApi([ mockCall('user.query'), mockCall('group.delete'), mockCall('group.query', []), diff --git a/src/app/pages/credentials/groups/group-form/group-form.component.spec.ts b/src/app/pages/credentials/groups/group-form/group-form.component.spec.ts index d7c4f212065..e2d43a57c89 100644 --- a/src/app/pages/credentials/groups/group-form/group-form.component.spec.ts +++ b/src/app/pages/credentials/groups/group-form/group-form.component.spec.ts @@ -8,7 +8,7 @@ import { import { provideMockStore } from '@ngrx/store/testing'; import { allCommands } from 'app/constants/all-commands.constant'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { Role } from 'app/enums/role.enum'; import { Group } from 'app/interfaces/group.interface'; import { Privilege } from 'app/interfaces/privilege.interface'; @@ -60,7 +60,7 @@ describe('GroupFormComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('group.query', [{ group: 'existing', gid: 1111 }] as Group[]), mockCall('privilege.query', fakePrivilegeDataSource), mockCall('group.create', 1111), diff --git a/src/app/pages/credentials/groups/group-members/group-members.component.spec.ts b/src/app/pages/credentials/groups/group-members/group-members.component.spec.ts index aadbac3607b..a86e10eb079 100644 --- a/src/app/pages/credentials/groups/group-members/group-members.component.spec.ts +++ b/src/app/pages/credentials/groups/group-members/group-members.component.spec.ts @@ -6,7 +6,7 @@ import { MatListHarness } from '@angular/material/list/testing'; import { Router } from '@angular/router'; import { createRoutingFactory, mockProvider, SpectatorRouting } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { suppressJsDomCssErrors } from 'app/core/testing/utils/suppress-jsdom-css-errors.utils'; import { Group } from 'app/interfaces/group.interface'; import { User } from 'app/interfaces/user.interface'; @@ -35,7 +35,7 @@ describe('GroupMembersComponent', () => { DualListBoxComponent, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('group.query', fakeGroupDataSource), mockCall('user.query', [{ id: 41, username: 'dummy-user' }, { id: 42, username: 'second-user' }] as User[]), mockCall('group.update'), diff --git a/src/app/pages/credentials/groups/privilege/privilege-form/privilege-form.component.spec.ts b/src/app/pages/credentials/groups/privilege/privilege-form/privilege-form.component.spec.ts index 4da78c5bd2d..e42c1a01bf8 100644 --- a/src/app/pages/credentials/groups/privilege/privilege-form/privilege-form.component.spec.ts +++ b/src/app/pages/credentials/groups/privilege/privilege-form/privilege-form.component.spec.ts @@ -4,7 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { Role } from 'app/enums/role.enum'; import { Group } from 'app/interfaces/group.interface'; import { Privilege, PrivilegeRole } from 'app/interfaces/privilege.interface'; @@ -40,7 +40,7 @@ describe('PrivilegeFormComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('group.query', [ { group: 'Group A', gid: 111 }, { group: 'Group B', gid: 222 }, diff --git a/src/app/pages/credentials/groups/privilege/privilege-list/privilege-list.component.spec.ts b/src/app/pages/credentials/groups/privilege/privilege-list/privilege-list.component.spec.ts index 2a3991446ad..31155ec14e3 100644 --- a/src/app/pages/credentials/groups/privilege/privilege-list/privilege-list.component.spec.ts +++ b/src/app/pages/credentials/groups/privilege/privilege-list/privilege-list.component.spec.ts @@ -3,7 +3,7 @@ import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { Role } from 'app/enums/role.enum'; import { Privilege } from 'app/interfaces/privilege.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -45,7 +45,7 @@ describe('PrivilegeListComponent', () => { PageHeaderComponent, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('privilege.query', fakePrivilegeDataSource), mockCall('privilege.delete', true), mockCall('group.query', []), diff --git a/src/app/pages/credentials/kmip/kmip.component.spec.ts b/src/app/pages/credentials/kmip/kmip.component.spec.ts index e32a4db546f..3034b530e6a 100644 --- a/src/app/pages/credentials/kmip/kmip.component.spec.ts +++ b/src/app/pages/credentials/kmip/kmip.component.spec.ts @@ -7,7 +7,7 @@ import { of } from 'rxjs'; import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; import { - mockCall, mockJob, mockWebSocket, + mockCall, mockJob, mockApi, } from 'app/core/testing/utils/mock-websocket.utils'; import { helptextSystemKmip } from 'app/helptext/system/kmip'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -31,7 +31,7 @@ describe('KmipComponent', () => { WithManageCertificatesLinkComponent, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('kmip.config', { server: 'kmip.truenas.com', enabled: false, diff --git a/src/app/pages/credentials/users/user-api-keys/components/api-key-form-dialog/api-key-form-dialog.component.spec.ts b/src/app/pages/credentials/users/user-api-keys/components/api-key-form-dialog/api-key-form-dialog.component.spec.ts index aea0354d737..a2690d29fea 100644 --- a/src/app/pages/credentials/users/user-api-keys/components/api-key-form-dialog/api-key-form-dialog.component.spec.ts +++ b/src/app/pages/credentials/users/user-api-keys/components/api-key-form-dialog/api-key-form-dialog.component.spec.ts @@ -6,7 +6,7 @@ import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { ApiKey } from 'app/interfaces/api-key.interface'; import { DialogService, @@ -27,7 +27,7 @@ describe('ApiKeyFormComponent', () => { imports: [ReactiveFormsModule], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('user.query', []), mockCall('api_key.query', []), mockCall('api_key.create', { key: 'generated-key' } as ApiKey), diff --git a/src/app/pages/credentials/users/user-api-keys/user-api-keys.component.spec.ts b/src/app/pages/credentials/users/user-api-keys/user-api-keys.component.spec.ts index 5096406a718..9474e0eb2ab 100644 --- a/src/app/pages/credentials/users/user-api-keys/user-api-keys.component.spec.ts +++ b/src/app/pages/credentials/users/user-api-keys/user-api-keys.component.spec.ts @@ -6,7 +6,7 @@ import { MockComponent } from 'ng-mocks'; import { of } from 'rxjs'; import { FakeFormatDateTimePipe } from 'app/core/testing/classes/fake-format-datetime.pipe'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { ApiKey } from 'app/interfaces/api-key.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { SearchInputComponent } from 'app/modules/forms/search-input/components/search-input/search-input.component'; @@ -73,7 +73,7 @@ describe('UserApiKeysComponent', () => { afterClosed: () => of(true), })), }), - mockWebSocket([ + mockApi([ mockCall('api_key.query', apiKeys), mockCall('api_key.delete'), ]), diff --git a/src/app/pages/credentials/users/user-details-row/delete-user-dialog/delete-user-dialog.component.spec.ts b/src/app/pages/credentials/users/user-details-row/delete-user-dialog/delete-user-dialog.component.spec.ts index 980e1c61046..8c8b3348e46 100644 --- a/src/app/pages/credentials/users/user-details-row/delete-user-dialog/delete-user-dialog.component.spec.ts +++ b/src/app/pages/credentials/users/user-details-row/delete-user-dialog/delete-user-dialog.component.spec.ts @@ -6,7 +6,7 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { Group } from 'app/interfaces/group.interface'; import { User } from 'app/interfaces/user.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -27,7 +27,7 @@ describe('DeleteUserDialogComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('user.delete'), mockCall('group.query', [ { diff --git a/src/app/pages/credentials/users/user-details-row/user-details-row.component.spec.ts b/src/app/pages/credentials/users/user-details-row/user-details-row.component.spec.ts index c6fc13a0489..78af76b13aa 100644 --- a/src/app/pages/credentials/users/user-details-row/user-details-row.component.spec.ts +++ b/src/app/pages/credentials/users/user-details-row/user-details-row.component.spec.ts @@ -8,7 +8,7 @@ import { createComponentFactory, mockProvider } from '@ngneat/spectator/jest'; import { provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; import { Preferences } from 'app/interfaces/preferences.interface'; import { User } from 'app/interfaces/user.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -59,7 +59,7 @@ describe('UserDetailsRowComponent', () => { ], providers: [ mockProvider(SlideInService), - mockWebSocket([ + mockApi([ mockCall('user.delete'), mockCall('group.query', []), ]), diff --git a/src/app/pages/credentials/users/user-form/user-form.component.spec.ts b/src/app/pages/credentials/users/user-form/user-form.component.spec.ts index edcefb4c005..45e034c781c 100644 --- a/src/app/pages/credentials/users/user-form/user-form.component.spec.ts +++ b/src/app/pages/credentials/users/user-form/user-form.component.spec.ts @@ -8,7 +8,7 @@ import { provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { allCommands } from 'app/constants/all-commands.constant'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { Choices } from 'app/interfaces/choices.interface'; import { Group } from 'app/interfaces/group.interface'; import { SmbShare } from 'app/interfaces/smb-share.interface'; @@ -71,7 +71,7 @@ describe('UserFormComponent', () => { IxPermissionsComponent, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('user.query'), mockCall('user.create'), mockCall('user.update'), diff --git a/src/app/pages/dashboard/services/dashboard.store.spec.ts b/src/app/pages/dashboard/services/dashboard.store.spec.ts index db6812c46ef..0b1e08edf83 100644 --- a/src/app/pages/dashboard/services/dashboard.store.spec.ts +++ b/src/app/pages/dashboard/services/dashboard.store.spec.ts @@ -1,7 +1,7 @@ import { createServiceFactory, SpectatorService, mockProvider } from '@ngneat/spectator/jest'; import { provideMockStore } from '@ngrx/store/testing'; import { firstValueFrom, of } from 'rxjs'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { getDefaultWidgets } from 'app/pages/dashboard/services/get-default-widgets'; import { WidgetGroupLayout } from 'app/pages/dashboard/types/widget-group.interface'; import { WidgetType } from 'app/pages/dashboard/types/widget.interface'; @@ -45,7 +45,7 @@ describe('DashboardStore', () => { }, ], }), - mockWebSocket([ + mockApi([ mockCall('auth.set_attribute'), ]), ], diff --git a/src/app/pages/dashboard/services/widget-resources.service.spec.ts b/src/app/pages/dashboard/services/widget-resources.service.spec.ts index 3d5e0ea7fc0..a9d3c2f69ba 100644 --- a/src/app/pages/dashboard/services/widget-resources.service.spec.ts +++ b/src/app/pages/dashboard/services/widget-resources.service.spec.ts @@ -4,7 +4,7 @@ import { } from '@ngneat/spectator/jest'; import { firstValueFrom } from 'rxjs'; import { mockGlobalStore } from 'app/core/testing/classes/mock-global-store.service'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { App } from 'app/interfaces/app.interface'; import { Pool } from 'app/interfaces/pool.interface'; import { WidgetResourcesService } from 'app/pages/dashboard/services/widget-resources.service'; @@ -25,7 +25,7 @@ describe('WidgetResourcesService', () => { const createService = createServiceFactory({ service: WidgetResourcesService, providers: [ - mockWebSocket([ + mockApi([ mockCall('app.query', apps), mockCall('replication.query'), mockCall('rsynctask.query'), diff --git a/src/app/pages/data-protection/cloud-backup/cloud-backup-card/cloud-backup-card.component.spec.ts b/src/app/pages/data-protection/cloud-backup/cloud-backup-card/cloud-backup-card.component.spec.ts index 7d5b334de0d..35819e64886 100644 --- a/src/app/pages/data-protection/cloud-backup/cloud-backup-card/cloud-backup-card.component.spec.ts +++ b/src/app/pages/data-protection/cloud-backup/cloud-backup-card/cloud-backup-card.component.spec.ts @@ -7,7 +7,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { JobState } from 'app/enums/job-state.enum'; import { CloudBackup } from 'app/interfaces/cloud-backup.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -54,7 +54,7 @@ describe('CloudBackupCardComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('cloud_backup.query', cloudBackups), mockCall('cloud_backup.delete'), mockCall('cloud_backup.update'), diff --git a/src/app/pages/data-protection/cloud-backup/cloud-backup-details/cloud-backup-restore-form-snapshot-form/cloud-backup-restore-from-snapshot-form.component.spec.ts b/src/app/pages/data-protection/cloud-backup/cloud-backup-details/cloud-backup-restore-form-snapshot-form/cloud-backup-restore-from-snapshot-form.component.spec.ts index 97bfa4b4408..4eeb5fea748 100644 --- a/src/app/pages/data-protection/cloud-backup/cloud-backup-details/cloud-backup-restore-form-snapshot-form/cloud-backup-restore-from-snapshot-form.component.spec.ts +++ b/src/app/pages/data-protection/cloud-backup/cloud-backup-details/cloud-backup-restore-form-snapshot-form/cloud-backup-restore-from-snapshot-form.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; import { SlideInRef } from 'app/modules/slide-ins/slide-in-ref'; @@ -30,7 +30,7 @@ describe('CloudBackupRestoreFromSnapshotFormComponent', () => { afterClosed: () => of(null), })), }), - mockWebSocket([ + mockApi([ mockJob('cloud_backup.restore'), ]), mockProvider(SlideInService, { diff --git a/src/app/pages/data-protection/cloud-backup/cloud-backup-details/cloud-backup-schedule/cloud-backup-schedule.component.spec.ts b/src/app/pages/data-protection/cloud-backup/cloud-backup-details/cloud-backup-schedule/cloud-backup-schedule.component.spec.ts index c24c5657201..a6b9a29a3ba 100644 --- a/src/app/pages/data-protection/cloud-backup/cloud-backup-details/cloud-backup-schedule/cloud-backup-schedule.component.spec.ts +++ b/src/app/pages/data-protection/cloud-backup/cloud-backup-details/cloud-backup-schedule/cloud-backup-schedule.component.spec.ts @@ -1,6 +1,6 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { provideMockStore } from '@ngrx/store/testing'; -import { mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { CloudBackup } from 'app/interfaces/cloud-backup.interface'; import { CloudBackupScheduleComponent } from 'app/pages/data-protection/cloud-backup/cloud-backup-details/cloud-backup-schedule/cloud-backup-schedule.component'; import { TaskService } from 'app/services/task.service'; @@ -25,7 +25,7 @@ describe('CloudBackupScheduleComponent', () => { const createComponent = createComponentFactory({ component: CloudBackupScheduleComponent, providers: [ - mockWebSocket(), + mockApi(), mockProvider(TaskService, { getTaskCronDescription: jest.fn(() => 'At 00:00, only on Sunday'), }), diff --git a/src/app/pages/data-protection/cloud-backup/cloud-backup-details/cloud-backup-snapshots/cloud-backup-snapshots.component.spec.ts b/src/app/pages/data-protection/cloud-backup/cloud-backup-details/cloud-backup-snapshots/cloud-backup-snapshots.component.spec.ts index 719ecdce62a..cdeb46271ce 100644 --- a/src/app/pages/data-protection/cloud-backup/cloud-backup-details/cloud-backup-snapshots/cloud-backup-snapshots.component.spec.ts +++ b/src/app/pages/data-protection/cloud-backup/cloud-backup-details/cloud-backup-snapshots/cloud-backup-snapshots.component.spec.ts @@ -5,7 +5,7 @@ import { createComponentFactory, mockProvider } from '@ngneat/spectator/jest'; import { provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { CloudBackup, CloudBackupSnapshot } from 'app/interfaces/cloud-backup.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxIconHarness } from 'app/modules/ix-icon/ix-icon.harness'; @@ -45,7 +45,7 @@ describe('CloudBackupSnapshotsComponent', () => { component: CloudBackupSnapshotsComponent, providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('cloud_backup.list_snapshots', cloudBackupSnapshots), ]), mockProvider(DialogService, { diff --git a/src/app/pages/data-protection/cloud-backup/cloud-backup-form/cloud-backup-form.component.spec.ts b/src/app/pages/data-protection/cloud-backup/cloud-backup-form/cloud-backup-form.component.spec.ts index 6798e82433d..aa8b247c82a 100644 --- a/src/app/pages/data-protection/cloud-backup/cloud-backup-form/cloud-backup-form.component.spec.ts +++ b/src/app/pages/data-protection/cloud-backup/cloud-backup-form/cloud-backup-form.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { CloudSyncProviderName } from 'app/enums/cloudsync-provider.enum'; import { CloudBackup } from 'app/interfaces/cloud-backup.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -85,7 +85,7 @@ describe('CloudBackupFormComponent', () => { providers: [ mockAuth(), mockProvider(DialogService), - mockWebSocket([ + mockApi([ mockCall('cloud_backup.create', existingTask), mockCall('cloud_backup.update', existingTask), ]), diff --git a/src/app/pages/data-protection/cloud-backup/cloud-backup-list/cloud-backup-list.component.spec.ts b/src/app/pages/data-protection/cloud-backup/cloud-backup-list/cloud-backup-list.component.spec.ts index 5ff28101dc6..2e056d1fbc0 100644 --- a/src/app/pages/data-protection/cloud-backup/cloud-backup-list/cloud-backup-list.component.spec.ts +++ b/src/app/pages/data-protection/cloud-backup/cloud-backup-list/cloud-backup-list.component.spec.ts @@ -7,7 +7,7 @@ import { provideMockStore } from '@ngrx/store/testing'; import { MockComponent, MockComponents, MockDirective } from 'ng-mocks'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DetailsHeightDirective } from 'app/directives/details-height/details-height.directive'; import { JobState } from 'app/enums/job-state.enum'; import { CloudBackup } from 'app/interfaces/cloud-backup.interface'; @@ -65,7 +65,7 @@ describe('CloudBackupListComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('cloud_backup.query', cloudBackups), mockCall('cloud_backup.delete'), mockCall('cloud_backup.update'), diff --git a/src/app/pages/data-protection/cloudsync/cloudsync-form/cloudsync-form.component.spec.ts b/src/app/pages/data-protection/cloudsync/cloudsync-form/cloudsync-form.component.spec.ts index 5c96ffdbfa8..c0436824b86 100644 --- a/src/app/pages/data-protection/cloudsync/cloudsync-form/cloudsync-form.component.spec.ts +++ b/src/app/pages/data-protection/cloudsync/cloudsync-form/cloudsync-form.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { CloudSyncProviderName } from 'app/enums/cloudsync-provider.enum'; import { Direction } from 'app/enums/direction.enum'; import { JobState } from 'app/enums/job-state.enum'; @@ -96,7 +96,7 @@ describe('CloudSyncFormComponent', () => { afterClosed: jest.fn(() => of(true)), })), }), - mockWebSocket([ + mockApi([ mockCall('cloudsync.create', existingTask), mockCall('cloudsync.update', existingTask), mockCall('cloudsync.credentials.query', [ diff --git a/src/app/pages/data-protection/cloudsync/cloudsync-list/cloudsync-list.component.spec.ts b/src/app/pages/data-protection/cloudsync/cloudsync-list/cloudsync-list.component.spec.ts index 12d0fbb9e76..e66bcb9801c 100644 --- a/src/app/pages/data-protection/cloudsync/cloudsync-list/cloudsync-list.component.spec.ts +++ b/src/app/pages/data-protection/cloudsync/cloudsync-list/cloudsync-list.component.spec.ts @@ -9,7 +9,7 @@ import { MockComponent } from 'ng-mocks'; import { of } from 'rxjs'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket, mockCall, mockJob } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall, mockJob } from 'app/core/testing/utils/mock-websocket.utils'; import { CloudSyncTaskUi } from 'app/interfaces/cloud-sync-task.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { SearchInput1Component } from 'app/modules/forms/search-input1/search-input1.component'; @@ -102,7 +102,7 @@ describe('CloudSyncListComponent', () => { open: jest.fn(() => of()), }), mockAuth(), - mockWebSocket([ + mockApi([ mockCall('cloudsync.query', cloudSyncList), mockCall('cloudsync.delete'), mockJob('cloudsync.sync', fakeSuccessfulJob()), diff --git a/src/app/pages/data-protection/cloudsync/cloudsync-restore-dialog/cloudsync-restore-dialog.component.spec.ts b/src/app/pages/data-protection/cloudsync/cloudsync-restore-dialog/cloudsync-restore-dialog.component.spec.ts index f3507fcb886..d41a4d64d66 100644 --- a/src/app/pages/data-protection/cloudsync/cloudsync-restore-dialog/cloudsync-restore-dialog.component.spec.ts +++ b/src/app/pages/data-protection/cloudsync/cloudsync-restore-dialog/cloudsync-restore-dialog.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { TransferMode } from 'app/enums/transfer-mode.enum'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; @@ -27,7 +27,7 @@ describe('CloudSyncRestoreDialogComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('cloudsync.restore'), ]), mockProvider(DialogService), diff --git a/src/app/pages/data-protection/cloudsync/cloudsync-task-card/cloudsync-task-card.component.spec.ts b/src/app/pages/data-protection/cloudsync/cloudsync-task-card/cloudsync-task-card.component.spec.ts index a3256f39a63..652963bc5a1 100644 --- a/src/app/pages/data-protection/cloudsync/cloudsync-task-card/cloudsync-task-card.component.spec.ts +++ b/src/app/pages/data-protection/cloudsync/cloudsync-task-card/cloudsync-task-card.component.spec.ts @@ -8,7 +8,7 @@ import { createComponentFactory, mockProvider } from '@ngneat/spectator/jest'; import { provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { CloudSyncProviderName } from 'app/enums/cloudsync-provider.enum'; import { Direction } from 'app/enums/direction.enum'; import { JobState } from 'app/enums/job-state.enum'; @@ -114,7 +114,7 @@ describe('CloudSyncTaskCardComponent', () => { }, ], }), - mockWebSocket([ + mockApi([ mockCall('cloudsync.query', cloudsyncTasks), mockCall('cloudsync.delete'), mockCall('cloudsync.update'), diff --git a/src/app/pages/data-protection/cloudsync/cloudsync-wizard/cloudsync-wizard.component.spec.ts b/src/app/pages/data-protection/cloudsync/cloudsync-wizard/cloudsync-wizard.component.spec.ts index b8b01105fff..361992f11d0 100644 --- a/src/app/pages/data-protection/cloudsync/cloudsync-wizard/cloudsync-wizard.component.spec.ts +++ b/src/app/pages/data-protection/cloudsync/cloudsync-wizard/cloudsync-wizard.component.spec.ts @@ -6,7 +6,7 @@ import { MatStepperModule } from '@angular/material/stepper'; import { MatStepperHarness, MatStepperNextHarness } from '@angular/material/stepper/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { Direction } from 'app/enums/direction.enum'; import { TransferMode } from 'app/enums/transfer-mode.enum'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -41,7 +41,7 @@ describe('CloudSyncWizardComponent', () => { providers: [ mockProvider(ChainedRef, chainedRef), mockAuth(), - mockWebSocket([ + mockApi([ mockCall('cloudsync.create'), mockCall('cloudsync.credentials.query', [googlePhotosCreds]), mockCall('cloudsync.credentials.create'), diff --git a/src/app/pages/data-protection/cloudsync/cloudsync-wizard/steps/cloudsync-provider/cloudsync-provider.component.spec.ts b/src/app/pages/data-protection/cloudsync/cloudsync-wizard/steps/cloudsync-provider/cloudsync-provider.component.spec.ts index 9b5553ae48a..1fa2d9ee7a2 100644 --- a/src/app/pages/data-protection/cloudsync/cloudsync-wizard/steps/cloudsync-provider/cloudsync-provider.component.spec.ts +++ b/src/app/pages/data-protection/cloudsync/cloudsync-wizard/steps/cloudsync-provider/cloudsync-provider.component.spec.ts @@ -6,7 +6,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { MatDialog } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { CloudCredentialsSelectComponent, @@ -53,7 +53,7 @@ describe('CloudSyncProviderComponent', () => { providers: [ CdkStepper, mockProvider(ChainedRef, chainedComponentRef), - mockWebSocket([ + mockApi([ mockCall('cloudsync.providers', [storjProvider, googlePhotosProvider]), mockCall('cloudsync.credentials.query', [googlePhotosCreds]), mockCall('cloudsync.credentials.verify', { diff --git a/src/app/pages/data-protection/cloudsync/cloudsync-wizard/steps/cloudsync-what-and-when/cloudsync-what-and-when.component.spec.ts b/src/app/pages/data-protection/cloudsync/cloudsync-wizard/steps/cloudsync-what-and-when/cloudsync-what-and-when.component.spec.ts index ad154a64e07..a862f5611ff 100644 --- a/src/app/pages/data-protection/cloudsync/cloudsync-wizard/steps/cloudsync-what-and-when/cloudsync-what-and-when.component.spec.ts +++ b/src/app/pages/data-protection/cloudsync/cloudsync-wizard/steps/cloudsync-what-and-when/cloudsync-what-and-when.component.spec.ts @@ -7,7 +7,7 @@ import { MatDialog } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; import { ChainedRef } from 'app/modules/slide-ins/chained-component-ref'; @@ -39,7 +39,7 @@ describe('CloudSyncWhatAndWhenComponent', () => { CdkStepper, mockProvider(ChainedRef, chainedRef), mockAuth(), - mockWebSocket([ + mockApi([ mockCall('cloudsync.create'), mockCall('cloudsync.update'), mockCall('cloudsync.credentials.query', [googlePhotosCreds]), diff --git a/src/app/pages/data-protection/cloudsync/create-storj-bucket-dialog/create-storj-bucket-dialog.component.spec.ts b/src/app/pages/data-protection/cloudsync/create-storj-bucket-dialog/create-storj-bucket-dialog.component.spec.ts index 1b3b7cdbee0..ae3b8f1a119 100644 --- a/src/app/pages/data-protection/cloudsync/create-storj-bucket-dialog/create-storj-bucket-dialog.component.spec.ts +++ b/src/app/pages/data-protection/cloudsync/create-storj-bucket-dialog/create-storj-bucket-dialog.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { IxInputHarness } from 'app/modules/forms/ix-forms/components/ix-input/ix-input.harness'; import { CreateStorjBucketDialogComponent, @@ -22,7 +22,7 @@ describe('CreateStorjBucketDialogComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('cloudsync.create_bucket'), ]), mockProvider(MatDialogRef), diff --git a/src/app/pages/data-protection/replication/replication-form/replication-form.component.spec.ts b/src/app/pages/data-protection/replication/replication-form/replication-form.component.spec.ts index b5466b68b46..2a92267bb9d 100644 --- a/src/app/pages/data-protection/replication/replication-form/replication-form.component.spec.ts +++ b/src/app/pages/data-protection/replication/replication-form/replication-form.component.spec.ts @@ -7,7 +7,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { MockComponents, MockInstance } from 'ng-mocks'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { Direction } from 'app/enums/direction.enum'; import { JobState } from 'app/enums/job-state.enum'; import { KeychainCredentialType } from 'app/enums/keychain-credential-type.enum'; @@ -159,7 +159,7 @@ describe('ReplicationFormComponent', () => { mockProvider(DatasetService, { getDatasetNodeProvider: jest.fn(() => localNodeProvider), }), - mockWebSocket([ + mockApi([ mockCall('replication.count_eligible_manual_snapshots', { eligible: 3, total: 5, diff --git a/src/app/pages/data-protection/replication/replication-form/sections/source-section/source-section.component.spec.ts b/src/app/pages/data-protection/replication/replication-form/sections/source-section/source-section.component.spec.ts index 326079d5754..ca5e5de1fd9 100644 --- a/src/app/pages/data-protection/replication/replication-form/sections/source-section/source-section.component.spec.ts +++ b/src/app/pages/data-protection/replication/replication-form/sections/source-section/source-section.component.spec.ts @@ -3,7 +3,7 @@ import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { ReactiveFormsModule } from '@angular/forms'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { provideMockStore } from '@ngrx/store/testing'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { Direction } from 'app/enums/direction.enum'; import { LifetimeUnit } from 'app/enums/lifetime-unit.enum'; import { PeriodicSnapshotTask } from 'app/interfaces/periodic-snapshot-task.interface'; @@ -29,7 +29,7 @@ describe('SourceSectionComponent', () => { providers: [ mockProvider(LanguageService), mockProvider(LocaleService), - mockWebSocket([ + mockApi([ mockCall('pool.snapshottask.query', [ { id: 1, diff --git a/src/app/pages/data-protection/replication/replication-form/sections/transport-section/transport-section.component.spec.ts b/src/app/pages/data-protection/replication/replication-form/sections/transport-section/transport-section.component.spec.ts index 87bd52e2379..ec206ab5c14 100644 --- a/src/app/pages/data-protection/replication/replication-form/sections/transport-section/transport-section.component.spec.ts +++ b/src/app/pages/data-protection/replication/replication-form/sections/transport-section/transport-section.component.spec.ts @@ -5,7 +5,7 @@ import { MatDialog } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { GiB } from 'app/constants/bytes.constant'; -import { mockWebSocket, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; import { NetcatMode } from 'app/enums/netcat-mode.enum'; import { TransportMode } from 'app/enums/transport-mode.enum'; import { KeychainCredential } from 'app/interfaces/keychain-credential.interface'; @@ -32,7 +32,7 @@ describe('TransportSectionComponent', () => { SshCredentialsSelectComponent, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('keychaincredential.query', [ { id: 1, name: 'connection 1' }, { id: 2, name: 'connection 2' }, diff --git a/src/app/pages/data-protection/replication/replication-list/replication-list.component.spec.ts b/src/app/pages/data-protection/replication/replication-list/replication-list.component.spec.ts index 0c94262a8d1..b6225f72597 100644 --- a/src/app/pages/data-protection/replication/replication-list/replication-list.component.spec.ts +++ b/src/app/pages/data-protection/replication/replication-list/replication-list.component.spec.ts @@ -10,7 +10,7 @@ import { MockComponent } from 'ng-mocks'; import { of } from 'rxjs'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket, mockCall, mockJob } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall, mockJob } from 'app/core/testing/utils/mock-websocket.utils'; import { Direction } from 'app/enums/direction.enum'; import { JobState } from 'app/enums/job-state.enum'; import { LifetimeUnit } from 'app/enums/lifetime-unit.enum'; @@ -142,7 +142,7 @@ describe('ReplicationListComponent', () => { }, ], }), - mockWebSocket([ + mockApi([ mockCall('replication.query', tasks), mockCall('replication.update', { ...tasks[0], enabled: true }), mockJob('replication.run', fakeSuccessfulJob()), diff --git a/src/app/pages/data-protection/replication/replication-restore-dialog/replication-restore-dialog.component.spec.ts b/src/app/pages/data-protection/replication/replication-restore-dialog/replication-restore-dialog.component.spec.ts index 5fe6f9a3083..0bd404aed62 100644 --- a/src/app/pages/data-protection/replication/replication-restore-dialog/replication-restore-dialog.component.spec.ts +++ b/src/app/pages/data-protection/replication/replication-restore-dialog/replication-restore-dialog.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; import { @@ -24,7 +24,7 @@ describe('ReplicationRestoreDialogComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('replication.restore'), ]), mockProvider(DialogService), diff --git a/src/app/pages/data-protection/replication/replication-task-card/replication-task-card.component.spec.ts b/src/app/pages/data-protection/replication/replication-task-card/replication-task-card.component.spec.ts index 7bbf9734758..144b25e3dd0 100644 --- a/src/app/pages/data-protection/replication/replication-task-card/replication-task-card.component.spec.ts +++ b/src/app/pages/data-protection/replication/replication-task-card/replication-task-card.component.spec.ts @@ -8,7 +8,7 @@ import { createComponentFactory, mockProvider } from '@ngneat/spectator/jest'; import { provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; import { ReplicationTask } from 'app/interfaces/replication-task.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxIconHarness } from 'app/modules/ix-icon/ix-icon.harness'; @@ -79,7 +79,7 @@ describe('ReplicationTaskCardComponent', () => { }, ], }), - mockWebSocket([ + mockApi([ mockCall('replication.query', replicationTasks), mockCall('core.get_jobs', []), mockCall('replication.delete'), diff --git a/src/app/pages/data-protection/replication/replication-wizard/replication-wizard.component.spec.ts b/src/app/pages/data-protection/replication/replication-wizard/replication-wizard.component.spec.ts index b88836242f3..97873b0b9c8 100644 --- a/src/app/pages/data-protection/replication/replication-wizard/replication-wizard.component.spec.ts +++ b/src/app/pages/data-protection/replication/replication-wizard/replication-wizard.component.spec.ts @@ -7,7 +7,7 @@ import { MatStepperHarness, MatStepperNextHarness } from '@angular/material/step import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { MockComponent } from 'ng-mocks'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { Direction } from 'app/enums/direction.enum'; import { JobState } from 'app/enums/job-state.enum'; import { KeychainCredentialType } from 'app/enums/keychain-credential-type.enum'; @@ -85,7 +85,7 @@ describe('ReplicationWizardComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('replication.query', []), mockCall('keychaincredential.query', []), mockCall('replication.count_eligible_manual_snapshots', { total: 0, eligible: 0 }), diff --git a/src/app/pages/data-protection/replication/replication-wizard/steps/replication-what-and-where/replication-what-and-where.component.spec.ts b/src/app/pages/data-protection/replication/replication-wizard/steps/replication-what-and-where/replication-what-and-where.component.spec.ts index 49ed5d073ab..e7629cebbf3 100644 --- a/src/app/pages/data-protection/replication/replication-wizard/steps/replication-what-and-where/replication-what-and-where.component.spec.ts +++ b/src/app/pages/data-protection/replication/replication-wizard/steps/replication-what-and-where/replication-what-and-where.component.spec.ts @@ -7,7 +7,7 @@ import { MatDialog } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DatasetSource } from 'app/enums/dataset.enum'; import { Direction } from 'app/enums/direction.enum'; import { EncryptionKeyFormat } from 'app/enums/encryption-key-format.enum'; @@ -48,7 +48,7 @@ describe('ReplicationWhatAndWhereComponent', () => { providers: [ CdkStepper, mockAuth(), - mockWebSocket([ + mockApi([ mockCall('replication.query', [ { id: 1, diff --git a/src/app/pages/data-protection/replication/replication-wizard/steps/replication-when/replication-when.component.spec.ts b/src/app/pages/data-protection/replication/replication-wizard/steps/replication-when/replication-when.component.spec.ts index f80405c4e86..9cb1ccffc4c 100644 --- a/src/app/pages/data-protection/replication/replication-wizard/steps/replication-when/replication-when.component.spec.ts +++ b/src/app/pages/data-protection/replication/replication-wizard/steps/replication-when/replication-when.component.spec.ts @@ -5,7 +5,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { LifetimeUnit } from 'app/enums/lifetime-unit.enum'; import { RetentionPolicy } from 'app/enums/retention-policy.enum'; import { ScheduleMethod } from 'app/enums/schedule-method.enum'; @@ -25,7 +25,7 @@ describe('ReplicationWhenComponent', () => { providers: [ CdkStepper, mockAuth(), - mockWebSocket(), + mockApi(), ], }); diff --git a/src/app/pages/data-protection/rsync-task/rsync-task-card/rsync-task-card.component.spec.ts b/src/app/pages/data-protection/rsync-task/rsync-task-card/rsync-task-card.component.spec.ts index ef793fa52b6..8324994a41d 100644 --- a/src/app/pages/data-protection/rsync-task/rsync-task-card/rsync-task-card.component.spec.ts +++ b/src/app/pages/data-protection/rsync-task/rsync-task-card/rsync-task-card.component.spec.ts @@ -8,7 +8,7 @@ import { createComponentFactory, mockProvider } from '@ngneat/spectator/jest'; import { provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; import { Job } from 'app/interfaces/job.interface'; import { RsyncTaskUi } from 'app/interfaces/rsync-task.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -91,7 +91,7 @@ describe('RsyncTaskCardComponent', () => { }, ], }), - mockWebSocket([ + mockApi([ mockCall('rsynctask.query', rsyncTasks), mockCall('rsynctask.delete'), mockCall('rsynctask.update'), diff --git a/src/app/pages/data-protection/rsync-task/rsync-task-form/rsync-task-form.component.spec.ts b/src/app/pages/data-protection/rsync-task/rsync-task-form/rsync-task-form.component.spec.ts index 4144573c351..0095fddd5f9 100644 --- a/src/app/pages/data-protection/rsync-task/rsync-task-form/rsync-task-form.component.spec.ts +++ b/src/app/pages/data-protection/rsync-task/rsync-task-form/rsync-task-form.component.spec.ts @@ -6,7 +6,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { Direction } from 'app/enums/direction.enum'; import { RsyncMode } from 'app/enums/rsync-mode.enum'; import { KeychainCredential } from 'app/interfaces/keychain-credential.interface'; @@ -73,7 +73,7 @@ describe('RsyncTaskFormComponent', () => { timezone: 'America/New_York', }), mockAuth(), - mockWebSocket([ + mockApi([ mockCall('rsynctask.create', existingTask), mockCall('rsynctask.update', existingTask), mockCall('keychaincredential.query', [ diff --git a/src/app/pages/data-protection/rsync-task/rsync-task-list/rsync-task-list.component.spec.ts b/src/app/pages/data-protection/rsync-task/rsync-task-list/rsync-task-list.component.spec.ts index 122ecda4047..d91d0772965 100644 --- a/src/app/pages/data-protection/rsync-task/rsync-task-list/rsync-task-list.component.spec.ts +++ b/src/app/pages/data-protection/rsync-task/rsync-task-list/rsync-task-list.component.spec.ts @@ -6,7 +6,7 @@ import { MockComponent } from 'ng-mocks'; import { of } from 'rxjs'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { Direction } from 'app/enums/direction.enum'; import { JobState } from 'app/enums/job-state.enum'; import { Job } from 'app/interfaces/job.interface'; @@ -93,7 +93,7 @@ describe('RsyncTaskListComponent', () => { mockProvider(DialogService, { confirm: jest.fn(() => of(true)), }), - mockWebSocket([ + mockApi([ mockCall('rsynctask.query', tasks), mockCall('rsynctask.delete'), mockJob('rsynctask.run', fakeSuccessfulJob()), diff --git a/src/app/pages/data-protection/scrub-task/resilver-config/resilver-config.component.spec.ts b/src/app/pages/data-protection/scrub-task/resilver-config/resilver-config.component.spec.ts index b66b6f3a88e..fe4343dc03c 100644 --- a/src/app/pages/data-protection/scrub-task/resilver-config/resilver-config.component.spec.ts +++ b/src/app/pages/data-protection/scrub-task/resilver-config/resilver-config.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { Router } from '@angular/router'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { ResilverConfig } from 'app/interfaces/resilver-config.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { FormErrorHandlerService } from 'app/modules/forms/ix-forms/services/form-error-handler.service'; @@ -27,7 +27,7 @@ describe('ResilverConfigComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('pool.resilver.config', { enabled: true, begin: '08:00', diff --git a/src/app/pages/data-protection/scrub-task/scrub-list/scrub-list.component.spec.ts b/src/app/pages/data-protection/scrub-task/scrub-list/scrub-list.component.spec.ts index cea1c497712..3bf8f9bb334 100644 --- a/src/app/pages/data-protection/scrub-task/scrub-list/scrub-list.component.spec.ts +++ b/src/app/pages/data-protection/scrub-task/scrub-list/scrub-list.component.spec.ts @@ -5,7 +5,7 @@ import { provideMockStore } from '@ngrx/store/testing'; import { MockComponent } from 'ng-mocks'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { PoolScrubTask } from 'app/interfaces/pool-scrub.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxIconHarness } from 'app/modules/ix-icon/ix-icon.harness'; @@ -74,7 +74,7 @@ describe('ScrubListComponent', () => { mockProvider(DialogService, { confirm: jest.fn(() => of(true)), }), - mockWebSocket([ + mockApi([ mockCall('pool.scrub.query', scrubTasks), ]), mockProvider(TaskService, { diff --git a/src/app/pages/data-protection/scrub-task/scrub-task-card/scrub-task-card.component.spec.ts b/src/app/pages/data-protection/scrub-task/scrub-task-card/scrub-task-card.component.spec.ts index 5874b31b170..f66502c21ee 100644 --- a/src/app/pages/data-protection/scrub-task/scrub-task-card/scrub-task-card.component.spec.ts +++ b/src/app/pages/data-protection/scrub-task/scrub-task-card/scrub-task-card.component.spec.ts @@ -8,7 +8,7 @@ import { createComponentFactory, mockProvider } from '@ngneat/spectator/jest'; import { provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; import { PoolScrubTask } from 'app/interfaces/pool-scrub.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxIconHarness } from 'app/modules/ix-icon/ix-icon.harness'; @@ -59,7 +59,7 @@ describe('ScrubTaskCardComponent', () => { }, ], }), - mockWebSocket([ + mockApi([ mockCall('pool.scrub.query', scrubTasks), mockCall('pool.scrub.delete'), mockCall('pool.scrub.update'), diff --git a/src/app/pages/data-protection/scrub-task/scrub-task-form/scrub-task-form.component.spec.ts b/src/app/pages/data-protection/scrub-task/scrub-task-form/scrub-task-form.component.spec.ts index 8b40fff3c31..a72a1a5b1c4 100644 --- a/src/app/pages/data-protection/scrub-task/scrub-task-form/scrub-task-form.component.spec.ts +++ b/src/app/pages/data-protection/scrub-task/scrub-task-form/scrub-task-form.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { provideMockStore } from '@ngrx/store/testing'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { PoolScrubTask } from 'app/interfaces/pool-scrub.interface'; import { Pool } from 'app/interfaces/pool.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -48,7 +48,7 @@ describe('ScrubTaskFormComponent', () => { }), mockAuth(), mockProvider(DialogService), - mockWebSocket([ + mockApi([ mockCall('pool.scrub.create'), mockCall('pool.scrub.update'), mockCall('pool.query', [ diff --git a/src/app/pages/data-protection/smart-task/smart-task-card/smart-task-card.component.spec.ts b/src/app/pages/data-protection/smart-task/smart-task-card/smart-task-card.component.spec.ts index 3e7f957b694..280848fbf94 100644 --- a/src/app/pages/data-protection/smart-task/smart-task-card/smart-task-card.component.spec.ts +++ b/src/app/pages/data-protection/smart-task/smart-task-card/smart-task-card.component.spec.ts @@ -7,7 +7,7 @@ import { createComponentFactory, mockProvider } from '@ngneat/spectator/jest'; import { provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; import { DiskBus } from 'app/enums/disk-bus.enum'; import { Disk } from 'app/interfaces/disk.interface'; import { SmartTestTaskUi } from 'app/interfaces/smart-test.interface'; @@ -85,7 +85,7 @@ describe('SmartTaskCardComponent', () => { }, ], }), - mockWebSocket([ + mockApi([ mockCall('smart.test.query', smartTasks), mockCall('disk.query', disks), mockCall('smart.test.delete'), diff --git a/src/app/pages/data-protection/smart-task/smart-task-form/smart-task-form.component.spec.ts b/src/app/pages/data-protection/smart-task/smart-task-form/smart-task-form.component.spec.ts index 6b9d197f864..6dbbfdee005 100644 --- a/src/app/pages/data-protection/smart-task/smart-task-form/smart-task-form.component.spec.ts +++ b/src/app/pages/data-protection/smart-task/smart-task-form/smart-task-form.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { provideMockStore } from '@ngrx/store/testing'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { SmartTestType } from 'app/enums/smart-test-type.enum'; import { SmartTestTask } from 'app/interfaces/smart-test.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -47,7 +47,7 @@ describe('SmartTaskFormComponent', () => { }), mockAuth(), DialogService, - mockWebSocket([ + mockApi([ mockCall('smart.test.create'), mockCall('smart.test.update'), mockCall('smart.test.disk_choices', { diff --git a/src/app/pages/data-protection/smart-task/smart-task-list/smart-task-list.component.spec.ts b/src/app/pages/data-protection/smart-task/smart-task-list/smart-task-list.component.spec.ts index 08075d57690..91a39bf84df 100644 --- a/src/app/pages/data-protection/smart-task/smart-task-list/smart-task-list.component.spec.ts +++ b/src/app/pages/data-protection/smart-task/smart-task-list/smart-task-list.component.spec.ts @@ -7,7 +7,7 @@ import { provideMockStore } from '@ngrx/store/testing'; import { MockComponent } from 'ng-mocks'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; import { DiskBus } from 'app/enums/disk-bus.enum'; import { Disk } from 'app/interfaces/disk.interface'; import { SmartTestTaskUi } from 'app/interfaces/smart-test.interface'; @@ -89,7 +89,7 @@ describe('SmartTaskCardComponent', () => { }, ], }), - mockWebSocket([ + mockApi([ mockCall('smart.test.query', smartTasks), mockCall('disk.query', disks), mockCall('smart.test.delete'), diff --git a/src/app/pages/data-protection/snapshot-task/snapshot-task-card/snapshot-task-card.component.spec.ts b/src/app/pages/data-protection/snapshot-task/snapshot-task-card/snapshot-task-card.component.spec.ts index 0302f0f5081..05607a01f2b 100644 --- a/src/app/pages/data-protection/snapshot-task/snapshot-task-card/snapshot-task-card.component.spec.ts +++ b/src/app/pages/data-protection/snapshot-task/snapshot-task-card/snapshot-task-card.component.spec.ts @@ -8,7 +8,7 @@ import { createComponentFactory, mockProvider } from '@ngneat/spectator/jest'; import { provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; import { PeriodicSnapshotTask } from 'app/interfaces/periodic-snapshot-task.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxIconHarness } from 'app/modules/ix-icon/ix-icon.harness'; @@ -75,7 +75,7 @@ describe('SnapshotTaskCardComponent', () => { }, ], }), - mockWebSocket([ + mockApi([ mockCall('pool.snapshottask.query', snapshotTasks), mockCall('pool.snapshottask.delete'), mockCall('pool.snapshottask.update'), diff --git a/src/app/pages/data-protection/snapshot-task/snapshot-task-form/snapshot-task-form.component.spec.ts b/src/app/pages/data-protection/snapshot-task/snapshot-task-form/snapshot-task-form.component.spec.ts index 908ef7507a2..4a6a89c3dc0 100644 --- a/src/app/pages/data-protection/snapshot-task/snapshot-task-form/snapshot-task-form.component.spec.ts +++ b/src/app/pages/data-protection/snapshot-task/snapshot-task-form/snapshot-task-form.component.spec.ts @@ -6,7 +6,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { LifetimeUnit } from 'app/enums/lifetime-unit.enum'; import { PeriodicSnapshotTask } from 'app/interfaces/periodic-snapshot-task.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -60,7 +60,7 @@ describe('SnapshotTaskComponent', () => { mockProvider(LocaleService, { timezone: 'America/New_York', }), - mockWebSocket([ + mockApi([ mockCall('pool.snapshottask.create'), mockCall('pool.snapshottask.update'), ]), diff --git a/src/app/pages/data-protection/snapshot-task/snapshot-task-list/snapshot-task-list.component.spec.ts b/src/app/pages/data-protection/snapshot-task/snapshot-task-list/snapshot-task-list.component.spec.ts index 8b87959a972..0a2b202e8d1 100644 --- a/src/app/pages/data-protection/snapshot-task/snapshot-task-list/snapshot-task-list.component.spec.ts +++ b/src/app/pages/data-protection/snapshot-task/snapshot-task-list/snapshot-task-list.component.spec.ts @@ -6,7 +6,7 @@ import { createComponentFactory, mockProvider } from '@ngneat/spectator/jest'; import { MockComponent } from 'ng-mocks'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; import { PeriodicSnapshotTaskUi } from 'app/interfaces/periodic-snapshot-task.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { SearchInput1Component } from 'app/modules/forms/search-input1/search-input1.component'; @@ -70,7 +70,7 @@ describe('SnapshotTaskListComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('pool.snapshottask.query', snapshotTasksList), ]), mockProvider(DialogService, { diff --git a/src/app/pages/data-protection/vmware-snapshot/vmware-snapshot-form/vmware-snapshot-form.component.spec.ts b/src/app/pages/data-protection/vmware-snapshot/vmware-snapshot-form/vmware-snapshot-form.component.spec.ts index 11fe16112bd..a6c5140ebd9 100644 --- a/src/app/pages/data-protection/vmware-snapshot/vmware-snapshot-form/vmware-snapshot-form.component.spec.ts +++ b/src/app/pages/data-protection/vmware-snapshot/vmware-snapshot-form/vmware-snapshot-form.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DatasetType } from 'app/enums/dataset.enum'; import { MatchDatastoresWithDatasets, VmwareSnapshot } from 'app/interfaces/vmware.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -37,7 +37,7 @@ describe('VmwareSnapshotFormComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('vmware.match_datastores_with_datasets', { filesystems: [ { diff --git a/src/app/pages/datasets/components/dataset-capacity-management-card/dataset-capacity-management-card.component.spec.ts b/src/app/pages/datasets/components/dataset-capacity-management-card/dataset-capacity-management-card.component.spec.ts index 2758a14cde3..1192e33abb2 100644 --- a/src/app/pages/datasets/components/dataset-capacity-management-card/dataset-capacity-management-card.component.spec.ts +++ b/src/app/pages/datasets/components/dataset-capacity-management-card/dataset-capacity-management-card.component.spec.ts @@ -6,7 +6,7 @@ import { MockComponents, MockModule } from 'ng-mocks'; import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; import { DatasetType } from 'app/enums/dataset.enum'; import { DatasetQuota } from 'app/interfaces/dataset-quota.interface'; import { DatasetDetails } from 'app/interfaces/dataset.interface'; @@ -70,7 +70,7 @@ describe('DatasetCapacityManagementCardComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('pool.dataset.get_quota', [ { id: 1 }, { id: 2 }, diff --git a/src/app/pages/datasets/components/dataset-capacity-management-card/dataset-capacity-settings/dataset-capacity-settings.component.spec.ts b/src/app/pages/datasets/components/dataset-capacity-management-card/dataset-capacity-settings/dataset-capacity-settings.component.spec.ts index 0a2ac576cd9..ae801619240 100644 --- a/src/app/pages/datasets/components/dataset-capacity-management-card/dataset-capacity-settings/dataset-capacity-settings.component.spec.ts +++ b/src/app/pages/datasets/components/dataset-capacity-management-card/dataset-capacity-settings/dataset-capacity-settings.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { GiB } from 'app/constants/bytes.constant'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { inherit } from 'app/enums/with-inherit.enum'; import { ZfsPropertySource } from 'app/enums/zfs-property-source.enum'; import { DatasetDetails } from 'app/interfaces/dataset.interface'; @@ -31,7 +31,7 @@ describe('DatasetCapacitySettingsComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('pool.dataset.update'), ]), mockProvider(SnackbarService), diff --git a/src/app/pages/datasets/components/dataset-details-card/dataset-details-card.component.spec.ts b/src/app/pages/datasets/components/dataset-details-card/dataset-details-card.component.spec.ts index 31485611373..b495f1aa1ba 100644 --- a/src/app/pages/datasets/components/dataset-details-card/dataset-details-card.component.spec.ts +++ b/src/app/pages/datasets/components/dataset-details-card/dataset-details-card.component.spec.ts @@ -9,7 +9,7 @@ import { MockComponents } from 'ng-mocks'; import { NgxSkeletonLoaderComponent } from 'ngx-skeleton-loader'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DatasetType } from 'app/enums/dataset.enum'; import { ZfsPropertySource } from 'app/enums/zfs-property-source.enum'; import { DatasetDetails } from 'app/interfaces/dataset.interface'; @@ -73,7 +73,7 @@ describe('DatasetDetailsCardComponent', () => { afterClosed: () => of(true), })), }), - mockWebSocket([ + mockApi([ mockCall('pool.dataset.promote'), ]), mockProvider(Router), diff --git a/src/app/pages/datasets/components/dataset-form/dataset-form.component.spec.ts b/src/app/pages/datasets/components/dataset-form/dataset-form.component.spec.ts index c6d241aa1a9..c3639e3586f 100644 --- a/src/app/pages/datasets/components/dataset-form/dataset-form.component.spec.ts +++ b/src/app/pages/datasets/components/dataset-form/dataset-form.component.spec.ts @@ -9,7 +9,7 @@ import { MockComponents, MockInstance } from 'ng-mocks'; import { of } from 'rxjs'; import { GiB } from 'app/constants/bytes.constant'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { AclMode } from 'app/enums/acl-type.enum'; import { DatasetPreset } from 'app/enums/dataset.enum'; import { ServiceName } from 'app/enums/service-name.enum'; @@ -90,7 +90,7 @@ describe('DatasetFormComponent', () => { ), ], providers: [ - mockWebSocket([ + mockApi([ mockCall('sharing.smb.create'), mockCall('sharing.nfs.create'), mockCall('pool.dataset.create', { id: 'saved-id' } as Dataset), diff --git a/src/app/pages/datasets/components/dataset-form/sections/encryption-section/encryption-section.component.spec.ts b/src/app/pages/datasets/components/dataset-form/sections/encryption-section/encryption-section.component.spec.ts index 43c297b6f61..1d34f641efc 100644 --- a/src/app/pages/datasets/components/dataset-form/sections/encryption-section/encryption-section.component.spec.ts +++ b/src/app/pages/datasets/components/dataset-form/sections/encryption-section/encryption-section.component.spec.ts @@ -3,7 +3,7 @@ import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { ReactiveFormsModule } from '@angular/forms'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { EncryptionKeyFormat } from 'app/enums/encryption-key-format.enum'; import { Dataset } from 'app/interfaces/dataset.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -40,7 +40,7 @@ describe('EncryptionSectionComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('pool.dataset.encryption_algorithm_choices', { 'AES-256-GCM': 'AES-256-GCM', 'AES-128-GCM': 'AES-128-GCM', diff --git a/src/app/pages/datasets/components/dataset-form/sections/other-options-section/other-options-section.component.spec.ts b/src/app/pages/datasets/components/dataset-form/sections/other-options-section/other-options-section.component.spec.ts index b2e91cffcd8..d29593d4911 100644 --- a/src/app/pages/datasets/components/dataset-form/sections/other-options-section/other-options-section.component.spec.ts +++ b/src/app/pages/datasets/components/dataset-form/sections/other-options-section/other-options-section.component.spec.ts @@ -5,7 +5,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { MockStore, provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { KiB } from 'app/constants/bytes.constant'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { AclMode } from 'app/enums/acl-type.enum'; import { DatasetAclType, @@ -180,7 +180,7 @@ describe('OtherOptionsSectionComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('pool.dataset.checksum_choices', { ON: 'ON', SHA256: 'SHA256', diff --git a/src/app/pages/datasets/components/dataset-form/utils/dataset-form.service.spec.ts b/src/app/pages/datasets/components/dataset-form/utils/dataset-form.service.spec.ts index 839c6b5f7cd..09e22d8ceb4 100644 --- a/src/app/pages/datasets/components/dataset-form/utils/dataset-form.service.spec.ts +++ b/src/app/pages/datasets/components/dataset-form/utils/dataset-form.service.spec.ts @@ -1,7 +1,7 @@ import { createServiceFactory, mockProvider, SpectatorService } from '@ngneat/spectator/jest'; import { firstValueFrom, of } from 'rxjs'; import { maxDatasetNesting, maxDatasetPath } from 'app/constants/dataset.constants'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { inherit } from 'app/enums/with-inherit.enum'; import { helptextDatasetForm } from 'app/helptext/storage/volumes/datasets/dataset-form'; import { Dataset } from 'app/interfaces/dataset.interface'; @@ -16,7 +16,7 @@ describe('DatasetFormService', () => { const createService = createServiceFactory({ service: DatasetFormService, providers: [ - mockWebSocket([ + mockApi([ mockCall('pool.dataset.query', [dataset]), ]), mockProvider(DialogService, { diff --git a/src/app/pages/datasets/components/dataset-management/dataset-management.component.spec.ts b/src/app/pages/datasets/components/dataset-management/dataset-management.component.spec.ts index 3ddc9008224..ccfe9facd4c 100644 --- a/src/app/pages/datasets/components/dataset-management/dataset-management.component.spec.ts +++ b/src/app/pages/datasets/components/dataset-management/dataset-management.component.spec.ts @@ -3,7 +3,7 @@ import { Router } from '@angular/router'; import { createRoutingFactory, SpectatorRouting, mockProvider } from '@ngneat/spectator/jest'; import { BehaviorSubject, of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { SystemDatasetConfig } from 'app/interfaces/system-dataset-config.interface'; import { EmptyComponent } from 'app/modules/empty/empty.component'; import { SearchInput1Component } from 'app/modules/forms/search-input1/search-input1.component'; @@ -33,7 +33,7 @@ describe('DatasetsManagementComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('systemdataset.config', { pool: 'Second Dataset' } as SystemDatasetConfig), ]), mockProvider(DatasetTreeStore, { diff --git a/src/app/pages/datasets/components/dataset-quotas/dataset-quota-add-form/dataset-quota-add-form.component.spec.ts b/src/app/pages/datasets/components/dataset-quotas/dataset-quota-add-form/dataset-quota-add-form.component.spec.ts index d9c6c916f5b..6f6efbf2c58 100644 --- a/src/app/pages/datasets/components/dataset-quotas/dataset-quota-add-form/dataset-quota-add-form.component.spec.ts +++ b/src/app/pages/datasets/components/dataset-quotas/dataset-quota-add-form/dataset-quota-add-form.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DatasetQuotaType } from 'app/enums/dataset.enum'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxChipsHarness } from 'app/modules/forms/ix-forms/components/ix-chips/ix-chips.harness'; @@ -28,7 +28,7 @@ describe('DatasetQuotaAddFormComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('pool.dataset.set_quota'), ]), mockProvider(UserService, { diff --git a/src/app/pages/datasets/components/dataset-quotas/dataset-quota-edit-form/dataset-quota-edit-form.component.spec.ts b/src/app/pages/datasets/components/dataset-quotas/dataset-quota-edit-form/dataset-quota-edit-form.component.spec.ts index 1d77adc385c..28f1322aa12 100644 --- a/src/app/pages/datasets/components/dataset-quotas/dataset-quota-edit-form/dataset-quota-edit-form.component.spec.ts +++ b/src/app/pages/datasets/components/dataset-quotas/dataset-quota-edit-form/dataset-quota-edit-form.component.spec.ts @@ -4,7 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DatasetQuotaType } from 'app/enums/dataset.enum'; import { DatasetQuota } from 'app/interfaces/dataset-quota.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -27,7 +27,7 @@ describe('DatasetQuotaEditFormComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('pool.dataset.get_quota', [{ id: 1, name: 'daemon', diff --git a/src/app/pages/datasets/components/dataset-quotas/dataset-quotas-list/dataset-quotas-list.component.spec.ts b/src/app/pages/datasets/components/dataset-quotas/dataset-quotas-list/dataset-quotas-list.component.spec.ts index 296376c7f70..845f4e92a10 100644 --- a/src/app/pages/datasets/components/dataset-quotas/dataset-quotas-list/dataset-quotas-list.component.spec.ts +++ b/src/app/pages/datasets/components/dataset-quotas/dataset-quotas-list/dataset-quotas-list.component.spec.ts @@ -6,7 +6,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { MockComponent } from 'ng-mocks'; import { of, Subject } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DatasetQuotaType } from 'app/enums/dataset.enum'; import { DatasetQuota } from 'app/interfaces/dataset-quota.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -83,7 +83,7 @@ describe('DatasetQuotasListComponent', () => { slideInClosed$: of(undefined), })), }), - mockWebSocket([ + mockApi([ mockCall('pool.dataset.get_quota', fakeQuotas), mockCall('pool.dataset.set_quota'), ]), diff --git a/src/app/pages/datasets/components/delete-dataset-dialog/delete-dataset-dialog.component.spec.ts b/src/app/pages/datasets/components/delete-dataset-dialog/delete-dataset-dialog.component.spec.ts index 0ddf34fa368..4bd1de03d20 100644 --- a/src/app/pages/datasets/components/delete-dataset-dialog/delete-dataset-dialog.component.spec.ts +++ b/src/app/pages/datasets/components/delete-dataset-dialog/delete-dataset-dialog.component.spec.ts @@ -7,7 +7,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { of, throwError } from 'rxjs'; import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DatasetAttachment } from 'app/interfaces/pool-attachment.interface'; import { Process } from 'app/interfaces/process.interface'; import { VolumesListDataset } from 'app/interfaces/volumes-list-pool.interface'; @@ -36,7 +36,7 @@ describe('DeleteDatasetDialogComponent', () => { } as VolumesListDataset, }, mockProvider(MatDialogRef), - mockWebSocket([ + mockApi([ mockCall('pool.dataset.delete'), mockCall('pool.dataset.attachments', [ { diff --git a/src/app/pages/datasets/components/roles-card/roles-card.component.spec.ts b/src/app/pages/datasets/components/roles-card/roles-card.component.spec.ts index 74eb9250067..7aff95357eb 100644 --- a/src/app/pages/datasets/components/roles-card/roles-card.component.spec.ts +++ b/src/app/pages/datasets/components/roles-card/roles-card.component.spec.ts @@ -2,7 +2,7 @@ import { FormGroup } from '@angular/forms'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { IscsiExtentType } from 'app/enums/iscsi.enum'; import { DatasetDetails } from 'app/interfaces/dataset.interface'; import { RolesCardComponent } from 'app/pages/datasets/components/roles-card/roles-card.component'; @@ -39,7 +39,7 @@ describe('RolesCardComponent', () => { const createComponent = createComponentFactory({ providers: [ mockAuth(), - mockWebSocket(), + mockApi(), mockProvider(SlideInService, { open: jest.fn(() => ({ slideInClosed$: of(), diff --git a/src/app/pages/datasets/components/zvol-form/zvol-form.component.spec.ts b/src/app/pages/datasets/components/zvol-form/zvol-form.component.spec.ts index d8d08ca0659..3427ac9d462 100644 --- a/src/app/pages/datasets/components/zvol-form/zvol-form.component.spec.ts +++ b/src/app/pages/datasets/components/zvol-form/zvol-form.component.spec.ts @@ -5,7 +5,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; import { DatasetRecordSize, DatasetType } from 'app/enums/dataset.enum'; import { ZfsPropertySource } from 'app/enums/zfs-property-source.enum'; import { Dataset } from 'app/interfaces/dataset.interface'; @@ -27,7 +27,7 @@ describe('ZvolFormComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('pool.dataset.create'), mockCall('pool.dataset.update'), mockCall('pool.dataset.recommended_zvol_blocksize', '16K' as DatasetRecordSize), diff --git a/src/app/pages/datasets/modules/encryption/components/dataset-unlock/dataset-unlock.component.spec.ts b/src/app/pages/datasets/modules/encryption/components/dataset-unlock/dataset-unlock.component.spec.ts index 8a84592cfe1..33f6d747a92 100644 --- a/src/app/pages/datasets/modules/encryption/components/dataset-unlock/dataset-unlock.component.spec.ts +++ b/src/app/pages/datasets/modules/encryption/components/dataset-unlock/dataset-unlock.component.spec.ts @@ -9,7 +9,7 @@ import { of } from 'rxjs'; import { fakeFile } from 'app/core/testing/utils/fake-file.uitls'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DatasetEncryptionType } from 'app/enums/dataset.enum'; import { DatasetEncryptionSummary } from 'app/interfaces/dataset-encryption-summary.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -39,7 +39,7 @@ describe('DatasetUnlockComponent', () => { mockProvider(ActivatedRoute, { snapshot: { params: { datasetId: 'pool_name_1' } }, }), - mockWebSocket([ + mockApi([ mockJob('pool.dataset.encryption_summary'), ]), mockProvider(DialogService, { diff --git a/src/app/pages/datasets/modules/encryption/components/encryption-options-dialog/encryption-options-dialog.component.spec.ts b/src/app/pages/datasets/modules/encryption/components/encryption-options-dialog/encryption-options-dialog.component.spec.ts index 570ecc212af..21813f12923 100644 --- a/src/app/pages/datasets/modules/encryption/components/encryption-options-dialog/encryption-options-dialog.component.spec.ts +++ b/src/app/pages/datasets/modules/encryption/components/encryption-options-dialog/encryption-options-dialog.component.spec.ts @@ -6,7 +6,7 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { EncryptionKeyFormat } from 'app/enums/encryption-key-format.enum'; import { Dataset } from 'app/interfaces/dataset.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -35,7 +35,7 @@ describe('EncryptionOptionsDialogComponent', () => { afterClosed: () => of(undefined), })), }), - mockWebSocket([ + mockApi([ mockJob('pool.dataset.change_key'), mockCall('pool.dataset.inherit_parent_encryption_properties'), mockCall('pool.dataset.query', [{ diff --git a/src/app/pages/datasets/modules/encryption/components/export-all-keys-dialog/export-all-keys-dialog.component.spec.ts b/src/app/pages/datasets/modules/encryption/components/export-all-keys-dialog/export-all-keys-dialog.component.spec.ts index b0f295e0b1d..942013053ab 100644 --- a/src/app/pages/datasets/modules/encryption/components/export-all-keys-dialog/export-all-keys-dialog.component.spec.ts +++ b/src/app/pages/datasets/modules/encryption/components/export-all-keys-dialog/export-all-keys-dialog.component.spec.ts @@ -5,7 +5,7 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { Dataset } from 'app/interfaces/dataset.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { ExportAllKeysDialogComponent } from 'app/pages/datasets/modules/encryption/components/export-all-keys-dialog/export-all-keys-dialog.component'; @@ -20,7 +20,7 @@ describe('ExportAllKeysDialogComponent', () => { imports: [ ], providers: [ - mockWebSocket([ + mockApi([ mockCall('core.download', [1, 'http://localhost/download']), mockJob('pool.dataset.export_key', fakeSuccessfulJob('12345678')), ]), diff --git a/src/app/pages/datasets/modules/encryption/components/export-dataset-key-dialog/export-dataset-key-dialog.component.spec.ts b/src/app/pages/datasets/modules/encryption/components/export-dataset-key-dialog/export-dataset-key-dialog.component.spec.ts index 60ab961cece..b99269295c5 100644 --- a/src/app/pages/datasets/modules/encryption/components/export-dataset-key-dialog/export-dataset-key-dialog.component.spec.ts +++ b/src/app/pages/datasets/modules/encryption/components/export-dataset-key-dialog/export-dataset-key-dialog.component.spec.ts @@ -5,7 +5,7 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { Dataset } from 'app/interfaces/dataset.interface'; import { ApiService } from 'app/services/api.service'; import { DownloadService } from 'app/services/download.service'; @@ -19,7 +19,7 @@ describe('ExportDatasetKeyDialogComponent', () => { imports: [ ], providers: [ - mockWebSocket([ + mockApi([ mockCall('core.download', [1, 'http://localhost/download']), mockJob('pool.dataset.export_key', fakeSuccessfulJob('12345678')), ]), diff --git a/src/app/pages/datasets/modules/encryption/components/lock-dataset-dialog/lock-dataset-dialog.component.spec.ts b/src/app/pages/datasets/modules/encryption/components/lock-dataset-dialog/lock-dataset-dialog.component.spec.ts index 51a24a39b3b..f6e88b98c6e 100644 --- a/src/app/pages/datasets/modules/encryption/components/lock-dataset-dialog/lock-dataset-dialog.component.spec.ts +++ b/src/app/pages/datasets/modules/encryption/components/lock-dataset-dialog/lock-dataset-dialog.component.spec.ts @@ -7,7 +7,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { of } from 'rxjs'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { Dataset } from 'app/interfaces/dataset.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxCheckboxHarness } from 'app/modules/forms/ix-forms/components/ix-checkbox/ix-checkbox.harness'; @@ -30,7 +30,7 @@ describe('LockDatasetDialogComponent', () => { afterClosed: () => of(undefined), })), }), - mockWebSocket([ + mockApi([ mockJob('pool.dataset.lock', fakeSuccessfulJob()), ]), { diff --git a/src/app/pages/datasets/modules/permissions/components/save-as-preset-modal/save-as-preset-modal.component.spec.ts b/src/app/pages/datasets/modules/permissions/components/save-as-preset-modal/save-as-preset-modal.component.spec.ts index 2772e1bc327..ff8c271ea6f 100644 --- a/src/app/pages/datasets/modules/permissions/components/save-as-preset-modal/save-as-preset-modal.component.spec.ts +++ b/src/app/pages/datasets/modules/permissions/components/save-as-preset-modal/save-as-preset-modal.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { AclType } from 'app/enums/acl-type.enum'; import { Acl, AclTemplateByPath } from 'app/interfaces/acl.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -29,7 +29,7 @@ describe('SaveAsPresetModalComponent', () => { mockProvider(MatDialogRef), mockProvider(DialogService), mockProvider(UserService), - mockWebSocket([ + mockApi([ mockCall('filesystem.acltemplate.by_path', [ { id: 1, name: 'e', acltype: AclType.Nfs4, acl: [], diff --git a/src/app/pages/datasets/modules/permissions/components/select-preset-modal/select-preset-modal.component.spec.ts b/src/app/pages/datasets/modules/permissions/components/select-preset-modal/select-preset-modal.component.spec.ts index c78aa832b80..fa1aaeaa396 100644 --- a/src/app/pages/datasets/modules/permissions/components/select-preset-modal/select-preset-modal.component.spec.ts +++ b/src/app/pages/datasets/modules/permissions/components/select-preset-modal/select-preset-modal.component.spec.ts @@ -4,7 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { MatButtonHarness } from '@angular/material/button/testing'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { AclType } from 'app/enums/acl-type.enum'; import { PosixAclTag, PosixPermission } from 'app/enums/posix-acl.enum'; import { AclTemplateByPath } from 'app/interfaces/acl.interface'; @@ -56,7 +56,7 @@ describe('SelectPresetModalComponent', () => { }), mockProvider(MatDialogRef), mockProvider(DialogService), - mockWebSocket([ + mockApi([ mockCall('filesystem.acltemplate.by_path', presets), ]), { diff --git a/src/app/pages/datasets/modules/permissions/components/strip-acl-modal/strip-acl-modal.component.spec.ts b/src/app/pages/datasets/modules/permissions/components/strip-acl-modal/strip-acl-modal.component.spec.ts index 299cc859413..aabf28a6f86 100644 --- a/src/app/pages/datasets/modules/permissions/components/strip-acl-modal/strip-acl-modal.component.spec.ts +++ b/src/app/pages/datasets/modules/permissions/components/strip-acl-modal/strip-acl-modal.component.spec.ts @@ -6,7 +6,7 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; -import { mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { helptextAcl } from 'app/helptext/storage/volumes/datasets/dataset-acl'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxCheckboxHarness } from 'app/modules/forms/ix-forms/components/ix-checkbox/ix-checkbox.harness'; @@ -24,7 +24,7 @@ describe('StripAclModalComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockJob('filesystem.setacl', fakeSuccessfulJob()), ]), mockProvider(DialogService, { diff --git a/src/app/pages/datasets/modules/permissions/containers/dataset-acl-editor/dataset-acl-editor.component.spec.ts b/src/app/pages/datasets/modules/permissions/containers/dataset-acl-editor/dataset-acl-editor.component.spec.ts index 53425c019e1..93e709fe592 100644 --- a/src/app/pages/datasets/modules/permissions/containers/dataset-acl-editor/dataset-acl-editor.component.spec.ts +++ b/src/app/pages/datasets/modules/permissions/containers/dataset-acl-editor/dataset-acl-editor.component.spec.ts @@ -11,7 +11,7 @@ import { of } from 'rxjs'; import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { AclType } from 'app/enums/acl-type.enum'; import { NfsAclTag, NfsAclType, NfsBasicPermission } from 'app/enums/nfs-acl.enum'; import { NfsAcl } from 'app/interfaces/acl.interface'; @@ -98,7 +98,7 @@ describe('DatasetAclEditorComponent', () => { StorageService, DatasetAclEditorStore, mockProvider(DialogService), - mockWebSocket([ + mockApi([ mockCall('filesystem.getacl', acl), mockCall('filesystem.stat', { user: 'john', diff --git a/src/app/pages/datasets/modules/permissions/containers/dataset-trivial-permissions/dataset-trivial-permissions.component.spec.ts b/src/app/pages/datasets/modules/permissions/containers/dataset-trivial-permissions/dataset-trivial-permissions.component.spec.ts index cc6eef50501..92add96c287 100644 --- a/src/app/pages/datasets/modules/permissions/containers/dataset-trivial-permissions/dataset-trivial-permissions.component.spec.ts +++ b/src/app/pages/datasets/modules/permissions/containers/dataset-trivial-permissions/dataset-trivial-permissions.component.spec.ts @@ -7,7 +7,7 @@ import { createRoutingFactory, mockProvider, Spectator } from '@ngneat/spectator import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; import { - mockCall, mockJob, mockWebSocket, + mockCall, mockJob, mockApi, } from 'app/core/testing/utils/mock-websocket.utils'; import { DatasetAclType } from 'app/enums/dataset.enum'; import { Dataset } from 'app/interfaces/dataset.interface'; @@ -35,7 +35,7 @@ describe('DatasetTrivialPermissionsComponent', () => { datasetId: 'pool/trivial', }, providers: [ - mockWebSocket([ + mockApi([ mockCall('pool.dataset.query', [{ acltype: { value: DatasetAclType.Posix, diff --git a/src/app/pages/datasets/modules/permissions/containers/permissions-card/permissions-card.component.spec.ts b/src/app/pages/datasets/modules/permissions/containers/permissions-card/permissions-card.component.spec.ts index 94f7ed001b8..2b8ad77a7e0 100644 --- a/src/app/pages/datasets/modules/permissions/containers/permissions-card/permissions-card.component.spec.ts +++ b/src/app/pages/datasets/modules/permissions/containers/permissions-card/permissions-card.component.spec.ts @@ -7,7 +7,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { MockComponent } from 'ng-mocks'; import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { AclType } from 'app/enums/acl-type.enum'; import { Acl, NfsAcl, PosixAcl } from 'app/interfaces/acl.interface'; import { DatasetDetails } from 'app/interfaces/dataset.interface'; @@ -60,7 +60,7 @@ describe('PermissionsCardComponent', () => { PermissionsCardStore, mockProvider(DialogService), mockProvider(Router), - mockWebSocket([ + mockApi([ mockCall('filesystem.stat', stat), mockCall('filesystem.getacl', { trivial: true, diff --git a/src/app/pages/datasets/modules/snapshots/snapshot-add-form/snapshot-add-form.component.spec.ts b/src/app/pages/datasets/modules/snapshots/snapshot-add-form/snapshot-add-form.component.spec.ts index feb9a607338..2c4f4f5f4cb 100644 --- a/src/app/pages/datasets/modules/snapshots/snapshot-add-form/snapshot-add-form.component.spec.ts +++ b/src/app/pages/datasets/modules/snapshots/snapshot-add-form/snapshot-add-form.component.spec.ts @@ -6,7 +6,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { format } from 'date-fns-tz'; import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { Dataset } from 'app/interfaces/dataset.interface'; import { IxInputHarness } from 'app/modules/forms/ix-forms/components/ix-input/ix-input.harness'; import { FormErrorHandlerService } from 'app/modules/forms/ix-forms/services/form-error-handler.service'; @@ -35,7 +35,7 @@ describe('SnapshotAddFormComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('zfs.snapshot.create'), mockCall('pool.dataset.query', mockDatasets), mockCall('replication.list_naming_schemas', mockNamingSchema), diff --git a/src/app/pages/datasets/modules/snapshots/snapshot-batch-delete-dialog/snapshot-batch-delete-dialog.component.spec.ts b/src/app/pages/datasets/modules/snapshots/snapshot-batch-delete-dialog/snapshot-batch-delete-dialog.component.spec.ts index cfb6ed5276a..b3ec10a1c80 100644 --- a/src/app/pages/datasets/modules/snapshots/snapshot-batch-delete-dialog/snapshot-batch-delete-dialog.component.spec.ts +++ b/src/app/pages/datasets/modules/snapshots/snapshot-batch-delete-dialog/snapshot-batch-delete-dialog.component.spec.ts @@ -6,7 +6,7 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { CoreBulkResponse } from 'app/interfaces/core-bulk.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; @@ -39,7 +39,7 @@ describe('SnapshotBatchDeleteDialogComponent', () => { mockProvider(AppLoaderService), mockProvider(MatDialogRef), mockProvider(DialogService), - mockWebSocket([ + mockApi([ mockJob('core.bulk', fakeSuccessfulJob(mockJobSuccessResponse)), mockCall('zfs.snapshot.delete'), ]), diff --git a/src/app/pages/datasets/modules/snapshots/snapshot-clone-dialog/snapshot-clone-dialog.component.spec.ts b/src/app/pages/datasets/modules/snapshots/snapshot-clone-dialog/snapshot-clone-dialog.component.spec.ts index c0e7d4215fd..a982917febe 100644 --- a/src/app/pages/datasets/modules/snapshots/snapshot-clone-dialog/snapshot-clone-dialog.component.spec.ts +++ b/src/app/pages/datasets/modules/snapshots/snapshot-clone-dialog/snapshot-clone-dialog.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxInputHarness } from 'app/modules/forms/ix-forms/components/ix-input/ix-input.harness'; import { ApiService } from 'app/services/api.service'; @@ -27,7 +27,7 @@ describe('SnapshotCloneDialogComponent', () => { }, mockProvider(MatDialogRef), mockProvider(DialogService), - mockWebSocket([ + mockApi([ mockCall('zfs.snapshot.clone'), ]), ], diff --git a/src/app/pages/datasets/modules/snapshots/snapshot-details-row/snapshot-details-row.component.spec.ts b/src/app/pages/datasets/modules/snapshots/snapshot-details-row/snapshot-details-row.component.spec.ts index 06ce3d1d81e..0d67de41839 100644 --- a/src/app/pages/datasets/modules/snapshots/snapshot-details-row/snapshot-details-row.component.spec.ts +++ b/src/app/pages/datasets/modules/snapshots/snapshot-details-row/snapshot-details-row.component.spec.ts @@ -7,7 +7,7 @@ import { SpectatorRouting } from '@ngneat/spectator'; import { mockProvider, createRoutingFactory } from '@ngneat/spectator/jest'; import { of, pipe } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxCheckboxHarness } from 'app/modules/forms/ix-forms/components/ix-checkbox/ix-checkbox.harness'; import { AppLoaderService } from 'app/modules/loader/app-loader.service'; @@ -39,7 +39,7 @@ describe('SnapshotDetailsRowComponent', () => { mockProvider(DialogService, { confirm: jest.fn(() => of(true)), }), - mockWebSocket([ + mockApi([ mockCall('zfs.snapshot.query', [fakeZfsSnapshot]), mockCall('zfs.snapshot.hold'), mockCall('zfs.snapshot.release'), diff --git a/src/app/pages/datasets/modules/snapshots/snapshot-list/snapshot-list.component.spec.ts b/src/app/pages/datasets/modules/snapshots/snapshot-list/snapshot-list.component.spec.ts index bab1d2e4f96..4f08350941c 100644 --- a/src/app/pages/datasets/modules/snapshots/snapshot-list/snapshot-list.component.spec.ts +++ b/src/app/pages/datasets/modules/snapshots/snapshot-list/snapshot-list.component.spec.ts @@ -9,7 +9,7 @@ import { MockComponent } from 'ng-mocks'; import { of } from 'rxjs'; import { FakeFormatDateTimePipe } from 'app/core/testing/classes/fake-format-datetime.pipe'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxSlideToggleHarness } from 'app/modules/forms/ix-forms/components/ix-slide-toggle/ix-slide-toggle.harness'; import { SearchInput1Component } from 'app/modules/forms/search-input1/search-input1.component'; @@ -43,7 +43,7 @@ describe('SnapshotListComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('zfs.snapshot.query', fakeZfsSnapshotDataSource), mockCall('zfs.snapshot.delete'), ]), diff --git a/src/app/pages/datasets/modules/snapshots/snapshot-rollback-dialog/snapshot-rollback-dialog.component.spec.ts b/src/app/pages/datasets/modules/snapshots/snapshot-rollback-dialog/snapshot-rollback-dialog.component.spec.ts index 779613aad6a..19d43029344 100644 --- a/src/app/pages/datasets/modules/snapshots/snapshot-rollback-dialog/snapshot-rollback-dialog.component.spec.ts +++ b/src/app/pages/datasets/modules/snapshots/snapshot-rollback-dialog/snapshot-rollback-dialog.component.spec.ts @@ -6,7 +6,7 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { FakeFormatDateTimePipe } from 'app/core/testing/classes/fake-format-datetime.pipe'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; import { fakeZfsSnapshot } from 'app/pages/datasets/modules/snapshots//testing/snapshot-fake-datasource'; @@ -33,7 +33,7 @@ describe('SnapshotRollbackDialogComponent', () => { }, mockProvider(MatDialogRef), mockProvider(DialogService), - mockWebSocket([ + mockApi([ mockCall('zfs.snapshot.query', [fakeZfsSnapshot]), mockCall('zfs.snapshot.rollback'), ]), diff --git a/src/app/pages/directory-service/components/active-directory/active-directory.component.spec.ts b/src/app/pages/directory-service/components/active-directory/active-directory.component.spec.ts index 69c17d353a5..c66085acb52 100644 --- a/src/app/pages/directory-service/components/active-directory/active-directory.component.spec.ts +++ b/src/app/pages/directory-service/components/active-directory/active-directory.component.spec.ts @@ -8,7 +8,7 @@ import { of } from 'rxjs'; import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DirectoryServiceState } from 'app/enums/directory-service-state.enum'; import { helptextActiveDirectory } from 'app/helptext/directory-service/active-directory'; import { ActiveDirectoryConfig } from 'app/interfaces/active-directory-config.interface'; @@ -62,7 +62,7 @@ describe('ActiveDirectoryComponent', () => { LeaveDomainDialogComponent, ], providers: [ - mockWebSocket([ + mockApi([ mockJob('activedirectory.update', fakeSuccessfulJob()), mockCall('directoryservices.get_state', { activedirectory: DirectoryServiceState.Disabled, diff --git a/src/app/pages/directory-service/components/idmap-form/idmap-form.component.spec.ts b/src/app/pages/directory-service/components/idmap-form/idmap-form.component.spec.ts index 43ef4320a43..1c2670c1f86 100644 --- a/src/app/pages/directory-service/components/idmap-form/idmap-form.component.spec.ts +++ b/src/app/pages/directory-service/components/idmap-form/idmap-form.component.spec.ts @@ -9,7 +9,7 @@ import { of } from 'rxjs'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; import { - mockCall, mockJob, mockWebSocket, + mockCall, mockJob, mockApi, } from 'app/core/testing/utils/mock-websocket.utils'; import { IdmapBackend, IdmapName, IdmapSslEncryptionMode } from 'app/enums/idmap.enum'; import { helptextIdmap } from 'app/helptext/directory-service/idmap'; @@ -56,7 +56,7 @@ describe('IdmapFormComponent', () => { MockComponent(WithManageCertificatesLinkComponent), ], providers: [ - mockWebSocket([ + mockApi([ mockCall('idmap.create'), mockCall('idmap.update'), mockJob('idmap.clear_idmap_cache', fakeSuccessfulJob()), diff --git a/src/app/pages/directory-service/components/idmap-list/idmap-list.component.spec.ts b/src/app/pages/directory-service/components/idmap-list/idmap-list.component.spec.ts index 43665c1c5be..ebcc0371b70 100644 --- a/src/app/pages/directory-service/components/idmap-list/idmap-list.component.spec.ts +++ b/src/app/pages/directory-service/components/idmap-list/idmap-list.component.spec.ts @@ -5,7 +5,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { MockComponent } from 'ng-mocks'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DirectoryServiceState } from 'app/enums/directory-service-state.enum'; import { IdmapBackend, IdmapName } from 'app/enums/idmap.enum'; import { ActiveDirectoryConfig } from 'app/interfaces/active-directory-config.interface'; @@ -61,7 +61,7 @@ describe('IdmapListComponent', () => { SearchInput1Component, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('idmap.query', idmapRecords), mockCall('idmap.delete'), mockCall('directoryservices.get_state', () => servicesState), diff --git a/src/app/pages/directory-service/components/kerberos-keytabs/kerberos-keytabs-form/kerberos-keytabs-form.component.spec.ts b/src/app/pages/directory-service/components/kerberos-keytabs/kerberos-keytabs-form/kerberos-keytabs-form.component.spec.ts index 8605758b5c7..7ebcefe6ea9 100644 --- a/src/app/pages/directory-service/components/kerberos-keytabs/kerberos-keytabs-form/kerberos-keytabs-form.component.spec.ts +++ b/src/app/pages/directory-service/components/kerberos-keytabs/kerberos-keytabs-form/kerberos-keytabs-form.component.spec.ts @@ -3,7 +3,7 @@ import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { ReactiveFormsModule } from '@angular/forms'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { KerberosKeytab } from 'app/interfaces/kerberos-config.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; @@ -35,7 +35,7 @@ describe('KerberosKeytabsFormComponent', () => { mockProvider(DialogService), mockProvider(SlideInRef), { provide: SLIDE_IN_DATA, useValue: undefined }, - mockWebSocket([ + mockApi([ mockCall('kerberos.keytab.create'), mockCall('kerberos.keytab.update'), ]), diff --git a/src/app/pages/directory-service/components/kerberos-realms-form/kerberos-realms-form.component.spec.ts b/src/app/pages/directory-service/components/kerberos-realms-form/kerberos-realms-form.component.spec.ts index 1d5d461d443..2a27e90d7ea 100644 --- a/src/app/pages/directory-service/components/kerberos-realms-form/kerberos-realms-form.component.spec.ts +++ b/src/app/pages/directory-service/components/kerberos-realms-form/kerberos-realms-form.component.spec.ts @@ -4,7 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { KerberosRealm } from 'app/interfaces/kerberos-realm.interface'; import { FormErrorHandlerService } from 'app/modules/forms/ix-forms/services/form-error-handler.service'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; @@ -24,7 +24,7 @@ describe('KerberosRealmsFormComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('kerberos.realm.create'), mockCall('kerberos.realm.update'), ]), diff --git a/src/app/pages/directory-service/components/kerberos-settings/kerberos-settings.component.spec.ts b/src/app/pages/directory-service/components/kerberos-settings/kerberos-settings.component.spec.ts index 85fb93eeabd..4482f5166cf 100644 --- a/src/app/pages/directory-service/components/kerberos-settings/kerberos-settings.component.spec.ts +++ b/src/app/pages/directory-service/components/kerberos-settings/kerberos-settings.component.spec.ts @@ -4,7 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { KerberosConfig } from 'app/interfaces/kerberos-config.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { FormErrorHandlerService } from 'app/modules/forms/ix-forms/services/form-error-handler.service'; @@ -25,7 +25,7 @@ describe('KerberosSettingsComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('kerberos.config', { appdefaults_aux: 'testparam', libdefaults_aux: 'clockskew=2', diff --git a/src/app/pages/directory-service/components/ldap/ldap.component.spec.ts b/src/app/pages/directory-service/components/ldap/ldap.component.spec.ts index a0a4013102d..9ee83dfdcd1 100644 --- a/src/app/pages/directory-service/components/ldap/ldap.component.spec.ts +++ b/src/app/pages/directory-service/components/ldap/ldap.component.spec.ts @@ -6,7 +6,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { of } from 'rxjs'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { helptextLdap } from 'app/helptext/directory-service/ldap'; import { KerberosRealm } from 'app/interfaces/kerberos-realm.interface'; import { LdapConfig } from 'app/interfaces/ldap-config.interface'; @@ -53,7 +53,7 @@ describe('LdapComponent', () => { WithManageCertificatesLinkComponent, ], providers: [ - mockWebSocket([ + mockApi([ mockJob('ldap.update', fakeSuccessfulJob()), mockCall('ldap.config', existingLdapConfig), mockCall('kerberos.keytab.kerberos_principal_choices', [ diff --git a/src/app/pages/directory-service/components/leave-domain-dialog/leave-domain-dialog.component.spec.ts b/src/app/pages/directory-service/components/leave-domain-dialog/leave-domain-dialog.component.spec.ts index 26f54401705..b3a5ccf6de7 100644 --- a/src/app/pages/directory-service/components/leave-domain-dialog/leave-domain-dialog.component.spec.ts +++ b/src/app/pages/directory-service/components/leave-domain-dialog/leave-domain-dialog.component.spec.ts @@ -6,7 +6,7 @@ import { MatDialogRef } from '@angular/material/dialog'; import { createComponentFactory, Spectator, mockProvider } from '@ngneat/spectator/jest'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; import { SnackbarService } from 'app/modules/snackbar/services/snackbar.service'; @@ -22,7 +22,7 @@ describe('LeaveDomainDialogComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockJob('activedirectory.leave', fakeSuccessfulJob()), ]), mockProvider(DialogService), diff --git a/src/app/pages/jobs/jobs-list.component.spec.ts b/src/app/pages/jobs/jobs-list.component.spec.ts index 5dcaf3c6831..818d3ffac5c 100644 --- a/src/app/pages/jobs/jobs-list.component.spec.ts +++ b/src/app/pages/jobs/jobs-list.component.spec.ts @@ -9,7 +9,7 @@ import { MockStore, provideMockStore } from '@ngrx/store/testing'; import { MockComponent } from 'ng-mocks'; import { of } from 'rxjs'; import { FakeFormatDateTimePipe } from 'app/core/testing/classes/fake-format-datetime.pipe'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { JobState } from 'app/enums/job-state.enum'; import { Job } from 'app/interfaces/job.interface'; import { CopyButtonComponent } from 'app/modules/buttons/copy-button/copy-button.component'; @@ -91,7 +91,7 @@ describe('JobsListComponent', () => { }), mockProvider(DialogService), mockProvider(MatSnackBar), - mockWebSocket([ + mockApi([ mockCall('core.job_download_logs', 'http://localhost/download/log'), ]), mockProvider(DownloadService, { diff --git a/src/app/pages/network/components/configuration/configuration.component.spec.ts b/src/app/pages/network/components/configuration/configuration.component.spec.ts index 93ebd59cd32..0d40fb02c62 100644 --- a/src/app/pages/network/components/configuration/configuration.component.spec.ts +++ b/src/app/pages/network/components/configuration/configuration.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { Router } from '@angular/router'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { NetworkActivityType } from 'app/enums/network-activity-type.enum'; import { NetworkConfiguration } from 'app/interfaces/network-configuration.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -30,7 +30,7 @@ describe('NetworkConfigurationComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('network.configuration.activity_choices', [ ['acme', 'ACME'], ['catalog', 'Catalog(s) information'], diff --git a/src/app/pages/network/components/default-gateway-dialog/default-gateway-dialog.component.spec.ts b/src/app/pages/network/components/default-gateway-dialog/default-gateway-dialog.component.spec.ts index 3d970f274cb..924a57ad145 100644 --- a/src/app/pages/network/components/default-gateway-dialog/default-gateway-dialog.component.spec.ts +++ b/src/app/pages/network/components/default-gateway-dialog/default-gateway-dialog.component.spec.ts @@ -6,7 +6,7 @@ import { MatDialogRef } from '@angular/material/dialog'; import { Spectator, byText } from '@ngneat/spectator'; import { createComponentFactory, mockProvider } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { NetworkSummary } from 'app/interfaces/network-summary.interface'; import { IxInputHarness } from 'app/modules/forms/ix-forms/components/ix-input/ix-input.harness'; import { DefaultGatewayDialogComponent } from 'app/pages/network/components/default-gateway-dialog/default-gateway-dialog.component'; @@ -24,7 +24,7 @@ describe('DefaultGatewayDialogComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('network.general.summary', { default_routes: ['1.1.1.1'], } as NetworkSummary), diff --git a/src/app/pages/network/components/interface-form/interface-form.component.spec.ts b/src/app/pages/network/components/interface-form/interface-form.component.spec.ts index 4fbb60b2bc1..4a5d0fe984d 100644 --- a/src/app/pages/network/components/interface-form/interface-form.component.spec.ts +++ b/src/app/pages/network/components/interface-form/interface-form.component.spec.ts @@ -9,7 +9,7 @@ import { Store, StoreModule } from '@ngrx/store'; import { of } from 'rxjs'; import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { LacpduRate, LinkAggregationProtocol, NetworkInterfaceAliasType, @@ -87,7 +87,7 @@ describe('InterfaceFormComponent', () => { dispatch: jest.fn(), }, }, - mockWebSocket([ + mockApi([ mockCall('interface.xmit_hash_policy_choices', { [XmitHashPolicy.Layer2]: XmitHashPolicy.Layer2, [XmitHashPolicy.Layer2Plus3]: XmitHashPolicy.Layer2Plus3, diff --git a/src/app/pages/network/components/interfaces-card/interfaces-card.component.spec.ts b/src/app/pages/network/components/interfaces-card/interfaces-card.component.spec.ts index 7b5cb421b82..af7297ab49c 100644 --- a/src/app/pages/network/components/interfaces-card/interfaces-card.component.spec.ts +++ b/src/app/pages/network/components/interfaces-card/interfaces-card.component.spec.ts @@ -5,7 +5,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { MockComponent } from 'ng-mocks'; import { of, Subject } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { LinkState, NetworkInterfaceAliasType, NetworkInterfaceType } from 'app/enums/network-interface.enum'; import { AllNetworkInterfacesUpdate, NetworkInterfaceUpdate } from 'app/interfaces/reporting.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -79,7 +79,7 @@ describe('InterfacesCardComponent', () => { isLoading: false, } as InterfacesState), }), - mockWebSocket([ + mockApi([ mockCall('interface.delete'), ]), mockProvider(NetworkService, { diff --git a/src/app/pages/network/components/ipmi-card/ipmi-events-dialog/ipmi-events-dialog.component.spec.ts b/src/app/pages/network/components/ipmi-card/ipmi-events-dialog/ipmi-events-dialog.component.spec.ts index c902f516e14..b4181f16791 100644 --- a/src/app/pages/network/components/ipmi-card/ipmi-events-dialog/ipmi-events-dialog.component.spec.ts +++ b/src/app/pages/network/components/ipmi-card/ipmi-events-dialog/ipmi-events-dialog.component.spec.ts @@ -5,7 +5,7 @@ import { createComponentFactory, Spectator } from '@ngneat/spectator/jest'; import { FakeFormatDateTimePipe } from 'app/core/testing/classes/fake-format-datetime.pipe'; import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; -import { mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { IpmiEvent } from 'app/interfaces/ipmi.interface'; import { EmptyComponent } from 'app/modules/empty/empty.component'; import { FakeProgressBarComponent } from 'app/modules/loader/components/fake-progress-bar/fake-progress-bar.component'; @@ -25,7 +25,7 @@ describe('IpmiEventsDialogComponent', () => { FakeProgressBarComponent, ], providers: [ - mockWebSocket([ + mockApi([ mockJob('ipmi.sel.elist', fakeSuccessfulJob([ { id: 1, diff --git a/src/app/pages/network/components/ipmi-card/ipmi-form/ipmi-form.component.spec.ts b/src/app/pages/network/components/ipmi-card/ipmi-form/ipmi-form.component.spec.ts index 7e4caea6216..497a8945f04 100644 --- a/src/app/pages/network/components/ipmi-card/ipmi-form/ipmi-form.component.spec.ts +++ b/src/app/pages/network/components/ipmi-card/ipmi-form/ipmi-form.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { StoreModule } from '@ngrx/store'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { IpmiChassisIdentifyState, IpmiIpAddressSource } from 'app/enums/ipmi.enum'; import { OnOff } from 'app/enums/on-off.enum'; import { ProductType } from 'app/enums/product-type.enum'; @@ -61,7 +61,7 @@ describe('IpmiFormComponent', () => { mockProvider(SnackbarService), mockProvider(SlideInRef), { provide: SLIDE_IN_DATA, useValue: undefined }, - mockWebSocket([ + mockApi([ mockCall('failover.licensed', true), mockCall('failover.node', 'A'), mockCall('ipmi.lan.query', (params) => { diff --git a/src/app/pages/network/components/network-configuration-card/network-configuration-card.component.spec.ts b/src/app/pages/network/components/network-configuration-card/network-configuration-card.component.spec.ts index e0434008750..37810097fa5 100644 --- a/src/app/pages/network/components/network-configuration-card/network-configuration-card.component.spec.ts +++ b/src/app/pages/network/components/network-configuration-card/network-configuration-card.component.spec.ts @@ -5,7 +5,7 @@ import { byText, createComponentFactory, mockProvider, Spectator, } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { NetworkActivityType } from 'app/enums/network-activity-type.enum'; import { NetworkConfiguration } from 'app/interfaces/network-configuration.interface'; import { NetworkSummary } from 'app/interfaces/network-summary.interface'; @@ -24,7 +24,7 @@ describe('NetworkConfigurationCardComponent', () => { CastPipe, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('network.configuration.config', { hostname: 'truenas', domain: 'local', diff --git a/src/app/pages/network/components/static-route-form/static-route-form.component.spec.ts b/src/app/pages/network/components/static-route-form/static-route-form.component.spec.ts index 07c4b70921a..a96c41bbece 100644 --- a/src/app/pages/network/components/static-route-form/static-route-form.component.spec.ts +++ b/src/app/pages/network/components/static-route-form/static-route-form.component.spec.ts @@ -4,7 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { StaticRoute } from 'app/interfaces/static-route.interface'; import { FormErrorHandlerService } from 'app/modules/forms/ix-forms/services/form-error-handler.service'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; @@ -24,7 +24,7 @@ describe('StaticRouteFormComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('staticroute.create'), mockCall('staticroute.update'), ]), diff --git a/src/app/pages/network/components/static-routes-card/static-routes-card.component.spec.ts b/src/app/pages/network/components/static-routes-card/static-routes-card.component.spec.ts index 5353b20b44e..9dd40f4323e 100644 --- a/src/app/pages/network/components/static-routes-card/static-routes-card.component.spec.ts +++ b/src/app/pages/network/components/static-routes-card/static-routes-card.component.spec.ts @@ -5,7 +5,7 @@ import { MatDialog } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxIconHarness } from 'app/modules/ix-icon/ix-icon.harness'; import { IxTableHarness } from 'app/modules/ix-table/components/ix-table/ix-table.harness'; @@ -36,7 +36,7 @@ describe('StaticRoutesCardComponent', () => { IxTablePagerShowMoreComponent, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('staticroute.query', staticRoutes), mockCall('staticroute.delete'), ]), diff --git a/src/app/pages/network/tests/checkin.spec.ts b/src/app/pages/network/tests/checkin.spec.ts index 981c214ab47..6aea9ce28d0 100644 --- a/src/app/pages/network/tests/checkin.spec.ts +++ b/src/app/pages/network/tests/checkin.spec.ts @@ -12,7 +12,7 @@ import { MockComponents } from 'ng-mocks'; import { of } from 'rxjs'; import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { NetworkInterfaceAliasType, NetworkInterfaceType } from 'app/enums/network-interface.enum'; import { ProductType } from 'app/enums/product-type.enum'; import { helptextInterfaces } from 'app/helptext/network/interfaces/interfaces-list'; @@ -72,7 +72,7 @@ describe('NetworkComponent', () => { providers: [ InterfacesStore, mockAuth(), - mockWebSocket([ + mockApi([ mockCall('interface.checkin_waiting', () => (isTestingChanges ? 60 : null)), mockCall('interface.has_pending_changes', () => wasEditMade), mockCall('interface.services_restarted_on_sync', []), diff --git a/src/app/pages/reports-dashboard/components/exporters/reporting-exporters-form/reporting-exporters-form.component.spec.ts b/src/app/pages/reports-dashboard/components/exporters/reporting-exporters-form/reporting-exporters-form.component.spec.ts index 76f2c63cdf4..a052c91ca82 100644 --- a/src/app/pages/reports-dashboard/components/exporters/reporting-exporters-form/reporting-exporters-form.component.spec.ts +++ b/src/app/pages/reports-dashboard/components/exporters/reporting-exporters-form/reporting-exporters-form.component.spec.ts @@ -4,7 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { MatButtonHarness } from '@angular/material/button/testing'; import { mockProvider, Spectator, createComponentFactory } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { SchemaType } from 'app/enums/schema.enum'; import { ReportingExporter, ReportingExporterKey } from 'app/interfaces/reporting-exporters.interface'; import { Schema } from 'app/interfaces/schema.interface'; @@ -39,7 +39,7 @@ describe('ReportingExportersFormComponent', () => { ], providers: [ mockProvider(SlideInRef), - mockWebSocket([ + mockApi([ mockCall('reporting.exporters.exporter_schemas', [{ key: ReportingExporterKey.Graphite, schema: [ diff --git a/src/app/pages/reports-dashboard/components/exporters/reporting-exporters-list/reporting-exporters-list.component.spec.ts b/src/app/pages/reports-dashboard/components/exporters/reporting-exporters-list/reporting-exporters-list.component.spec.ts index 304d5f508a6..62cdba312e6 100644 --- a/src/app/pages/reports-dashboard/components/exporters/reporting-exporters-list/reporting-exporters-list.component.spec.ts +++ b/src/app/pages/reports-dashboard/components/exporters/reporting-exporters-list/reporting-exporters-list.component.spec.ts @@ -4,7 +4,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { Spectator, createComponentFactory, mockProvider } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { ReportingExporter, ReportingExporterKey } from 'app/interfaces/reporting-exporters.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { SearchInput1Component } from 'app/modules/forms/search-input1/search-input1.component'; @@ -42,7 +42,7 @@ describe('ReportingExportersListComponent', () => { FakeProgressBarComponent, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('reporting.exporters.query', exporters), mockCall('reporting.exporters.delete'), mockCall('reporting.exporters.update'), diff --git a/src/app/pages/reports-dashboard/components/line-chart/line-chart.component.spec.ts b/src/app/pages/reports-dashboard/components/line-chart/line-chart.component.spec.ts index dbe73980340..9f75b254887 100644 --- a/src/app/pages/reports-dashboard/components/line-chart/line-chart.component.spec.ts +++ b/src/app/pages/reports-dashboard/components/line-chart/line-chart.component.spec.ts @@ -2,7 +2,7 @@ import { Spectator, createComponentFactory, mockProvider } from '@ngneat/spectat import { provideMockStore } from '@ngrx/store/testing'; import { dygraphs } from 'dygraphs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { ReportingGraphName } from 'app/enums/reporting.enum'; import { LineChartComponent } from 'app/pages/reports-dashboard/components/line-chart/line-chart.component'; import { Report } from 'app/pages/reports-dashboard/interfaces/report.interface'; @@ -20,7 +20,7 @@ describe('LineChartComponent', () => { const createComponent = createComponentFactory({ component: LineChartComponent, providers: [ - mockWebSocket(), + mockApi(), mockProvider(ReportsService, { emitLegendEvent: jest.fn(), }), diff --git a/src/app/pages/reports-dashboard/components/reports-global-controls/netdata-dialog/netdata-dialog.component.spec.ts b/src/app/pages/reports-dashboard/components/reports-global-controls/netdata-dialog/netdata-dialog.component.spec.ts index 028171ef965..2428e94f492 100644 --- a/src/app/pages/reports-dashboard/components/reports-global-controls/netdata-dialog/netdata-dialog.component.spec.ts +++ b/src/app/pages/reports-dashboard/components/reports-global-controls/netdata-dialog/netdata-dialog.component.spec.ts @@ -4,7 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { IxInputHarness } from 'app/modules/forms/ix-forms/components/ix-input/ix-input.harness'; import { NetdataDialogComponent, @@ -22,7 +22,7 @@ describe('NetdataDialogComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('reporting.netdataweb_generate_password', '12345678'), ]), mockProvider(ReportsService), diff --git a/src/app/pages/reports-dashboard/components/reports-global-controls/reports-global-controls.component.spec.ts b/src/app/pages/reports-dashboard/components/reports-global-controls/reports-global-controls.component.spec.ts index 378d5fe0977..ddbb7e37b5f 100644 --- a/src/app/pages/reports-dashboard/components/reports-global-controls/reports-global-controls.component.spec.ts +++ b/src/app/pages/reports-dashboard/components/reports-global-controls/reports-global-controls.component.spec.ts @@ -8,7 +8,7 @@ import { mockProvider, Spectator, createComponentFactory } from '@ngneat/spectat import { provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { Preferences } from 'app/interfaces/preferences.interface'; import { NetdataDialogComponent, @@ -28,7 +28,7 @@ describe('ReportsGlobalControlsComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('disk.query', []), mockCall('disk.temperatures'), mockCall('reporting.netdata_graphs', []), diff --git a/src/app/pages/services/components/service-ftp/service-ftp.component.spec.ts b/src/app/pages/services/components/service-ftp/service-ftp.component.spec.ts index fe13a2134e2..c98da6c9e28 100644 --- a/src/app/pages/services/components/service-ftp/service-ftp.component.spec.ts +++ b/src/app/pages/services/components/service-ftp/service-ftp.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { createRoutingFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { FtpConfig } from 'app/interfaces/ftp-config.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxPermissionsComponent } from 'app/modules/forms/ix-forms/components/ix-permissions/ix-permissions.component'; @@ -74,7 +74,7 @@ describe('ServiceFtpComponent', () => { WithManageCertificatesLinkComponent, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('ftp.config', { ...existingFtpConfig, id: 1, diff --git a/src/app/pages/services/components/service-nfs/add-spn-dialog/add-spn-dialog.component.spec.ts b/src/app/pages/services/components/service-nfs/add-spn-dialog/add-spn-dialog.component.spec.ts index 5fcbca33c42..d9551b96687 100644 --- a/src/app/pages/services/components/service-nfs/add-spn-dialog/add-spn-dialog.component.spec.ts +++ b/src/app/pages/services/components/service-nfs/add-spn-dialog/add-spn-dialog.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { MatDialogRef } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; import { SnackbarService } from 'app/modules/snackbar/services/snackbar.service'; import { AddSpnDialogComponent } from 'app/pages/services/components/service-nfs/add-spn-dialog/add-spn-dialog.component'; @@ -21,7 +21,7 @@ describe('AddSpnDialogComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('nfs.add_principal'), ]), mockProvider(MatDialogRef), diff --git a/src/app/pages/services/components/service-nfs/service-nfs.component.spec.ts b/src/app/pages/services/components/service-nfs/service-nfs.component.spec.ts index 9e1014fcca6..9be5791fb65 100644 --- a/src/app/pages/services/components/service-nfs/service-nfs.component.spec.ts +++ b/src/app/pages/services/components/service-nfs/service-nfs.component.spec.ts @@ -7,7 +7,7 @@ import { createRoutingFactory, mockProvider, Spectator } from '@ngneat/spectator import { MockStore, provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DirectoryServiceState } from 'app/enums/directory-service-state.enum'; import { NfsProtocol } from 'app/enums/nfs-protocol.enum'; import { RdmaProtocolName } from 'app/enums/service-name.enum'; @@ -37,7 +37,7 @@ describe('ServiceNfsComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('nfs.config', { allow_nonroot: false, servers: 3, diff --git a/src/app/pages/services/components/service-smart/service-smart.component.spec.ts b/src/app/pages/services/components/service-smart/service-smart.component.spec.ts index 3a8c882685c..1d7bb185823 100644 --- a/src/app/pages/services/components/service-smart/service-smart.component.spec.ts +++ b/src/app/pages/services/components/service-smart/service-smart.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { Router } from '@angular/router'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { SmartPowerMode } from 'app/enums/smart-power.mode'; import { SmartConfig } from 'app/interfaces/smart-test.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -27,7 +27,7 @@ describe('ServiceSmartComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('smart.config', { interval: 30, powermode: SmartPowerMode.Never, diff --git a/src/app/pages/services/components/service-smb/service-smb.component.spec.ts b/src/app/pages/services/components/service-smb/service-smb.component.spec.ts index be62ed36851..d6e735264fb 100644 --- a/src/app/pages/services/components/service-smb/service-smb.component.spec.ts +++ b/src/app/pages/services/components/service-smb/service-smb.component.spec.ts @@ -6,7 +6,7 @@ import { Router } from '@angular/router'; import { createRoutingFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { SmbEncryption } from 'app/enums/smb-encryption.enum'; import { SmbConfig } from 'app/interfaces/smb-config.interface'; import { User } from 'app/interfaces/user.interface'; @@ -33,7 +33,7 @@ describe('ServiceSmbComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('smb.config', { id: 1, netbiosname: 'truenas', diff --git a/src/app/pages/services/components/service-snmp/service-snmp.component.spec.ts b/src/app/pages/services/components/service-snmp/service-snmp.component.spec.ts index fe042d2bddb..3b86b6b67f5 100644 --- a/src/app/pages/services/components/service-snmp/service-snmp.component.spec.ts +++ b/src/app/pages/services/components/service-snmp/service-snmp.component.spec.ts @@ -4,7 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { MatButtonHarness } from '@angular/material/button/testing'; import { createRoutingFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { SnmpConfig } from 'app/interfaces/snmp-config.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; @@ -25,7 +25,7 @@ describe('ServiceSnmpComponent', () => { routes: [], providers: [ mockProvider(DialogService), - mockWebSocket([ + mockApi([ mockCall('snmp.update'), mockCall('snmp.config', { location: 'My location', diff --git a/src/app/pages/services/components/service-ssh/service-ssh.component.spec.ts b/src/app/pages/services/components/service-ssh/service-ssh.component.spec.ts index d924617b543..5496d3894b2 100644 --- a/src/app/pages/services/components/service-ssh/service-ssh.component.spec.ts +++ b/src/app/pages/services/components/service-ssh/service-ssh.component.spec.ts @@ -4,7 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { MatButtonHarness } from '@angular/material/button/testing'; import { createRoutingFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { SshSftpLogFacility, SshSftpLogLevel, SshWeakCipher } from 'app/enums/ssh.enum'; import { Group } from 'app/interfaces/group.interface'; import { SshConfig } from 'app/interfaces/ssh-config.interface'; @@ -36,7 +36,7 @@ describe('ServiceSshComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('group.query', fakeGroupDataSource), mockCall('ssh.config', { tcpport: 22, diff --git a/src/app/pages/services/components/service-state-column/service-state-column.component.spec.ts b/src/app/pages/services/components/service-state-column/service-state-column.component.spec.ts index 390ab6a4a4a..f01f9abcf50 100644 --- a/src/app/pages/services/components/service-state-column/service-state-column.component.spec.ts +++ b/src/app/pages/services/components/service-state-column/service-state-column.component.spec.ts @@ -3,7 +3,7 @@ import { MatSlideToggleHarness } from '@angular/material/slide-toggle/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { ServiceName } from 'app/enums/service-name.enum'; import { ServiceStatus } from 'app/enums/service-status.enum'; import { IscsiGlobalSession } from 'app/interfaces/iscsi-global-config.interface'; @@ -28,7 +28,7 @@ describe('ServiceStateColumnComponent', () => { mockProvider(IscsiService, { getGlobalSessions: jest.fn(() => of([])), }), - mockWebSocket([ + mockApi([ mockCall('service.start', true), mockCall('service.stop', true), ]), diff --git a/src/app/pages/services/components/service-ups/service-ups.component.spec.ts b/src/app/pages/services/components/service-ups/service-ups.component.spec.ts index 5015d5ab068..00241254d4b 100644 --- a/src/app/pages/services/components/service-ups/service-ups.component.spec.ts +++ b/src/app/pages/services/components/service-ups/service-ups.component.spec.ts @@ -4,7 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { MatButtonHarness } from '@angular/material/button/testing'; import { createRoutingFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { UpsConfig, UpsConfigUpdate } from 'app/interfaces/ups-config.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxComboboxHarness } from 'app/modules/forms/ix-forms/components/ix-combobox/ix-combobox.harness'; @@ -25,7 +25,7 @@ describe('ServiceUpsComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('ups.config', { complete_identifier: 'ups@localhost:3', description: '', diff --git a/src/app/pages/services/services.component.spec.ts b/src/app/pages/services/services.component.spec.ts index 5d8c29ca11e..8b3900abe32 100644 --- a/src/app/pages/services/services.component.spec.ts +++ b/src/app/pages/services/services.component.spec.ts @@ -9,7 +9,7 @@ import { import { provideMockStore } from '@ngrx/store/testing'; import { MockComponent } from 'ng-mocks'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { ServiceName, serviceNames } from 'app/enums/service-name.enum'; import { ServiceStatus } from 'app/enums/service-status.enum'; import { Service } from 'app/interfaces/service.interface'; @@ -65,7 +65,7 @@ describe('ServicesComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('service.update', 1), mockCall('service.start'), mockCall('service.stop'), diff --git a/src/app/pages/sharing/components/shares-dashboard/iscsi-card/iscsi-card.component.spec.ts b/src/app/pages/sharing/components/shares-dashboard/iscsi-card/iscsi-card.component.spec.ts index f980f480575..5d2e25d8819 100644 --- a/src/app/pages/sharing/components/shares-dashboard/iscsi-card/iscsi-card.component.spec.ts +++ b/src/app/pages/sharing/components/shares-dashboard/iscsi-card/iscsi-card.component.spec.ts @@ -9,7 +9,7 @@ import { provideMockStore } from '@ngrx/store/testing'; import { MockComponents } from 'ng-mocks'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; import { ServiceName } from 'app/enums/service-name.enum'; import { ServiceStatus } from 'app/enums/service-status.enum'; import { IscsiTarget } from 'app/interfaces/iscsi.interface'; @@ -64,7 +64,7 @@ describe('IscsiCardComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('iscsi.target.query', iscsiShares), mockCall('iscsi.target.delete'), ]), diff --git a/src/app/pages/sharing/components/shares-dashboard/nfs-card/nfs-card.component.spec.ts b/src/app/pages/sharing/components/shares-dashboard/nfs-card/nfs-card.component.spec.ts index 08741b2aa31..0a636848e05 100644 --- a/src/app/pages/sharing/components/shares-dashboard/nfs-card/nfs-card.component.spec.ts +++ b/src/app/pages/sharing/components/shares-dashboard/nfs-card/nfs-card.component.spec.ts @@ -8,7 +8,7 @@ import { provideMockStore } from '@ngrx/store/testing'; import { MockComponents } from 'ng-mocks'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; import { ServiceName } from 'app/enums/service-name.enum'; import { ServiceStatus } from 'app/enums/service-status.enum'; import { NfsShare } from 'app/interfaces/nfs-share.interface'; @@ -65,7 +65,7 @@ describe('NfsCardComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('sharing.nfs.query', nfsShares), mockCall('sharing.nfs.delete'), mockCall('sharing.nfs.update'), diff --git a/src/app/pages/sharing/components/shares-dashboard/smb-card/smb-card.component.spec.ts b/src/app/pages/sharing/components/shares-dashboard/smb-card/smb-card.component.spec.ts index 99964a7ba74..deb8d4be5f4 100644 --- a/src/app/pages/sharing/components/shares-dashboard/smb-card/smb-card.component.spec.ts +++ b/src/app/pages/sharing/components/shares-dashboard/smb-card/smb-card.component.spec.ts @@ -9,7 +9,7 @@ import { provideMockStore } from '@ngrx/store/testing'; import { MockComponents } from 'ng-mocks'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; import { ServiceName } from 'app/enums/service-name.enum'; import { ServiceStatus } from 'app/enums/service-status.enum'; import { Service } from 'app/interfaces/service.interface'; @@ -65,7 +65,7 @@ describe('SmbCardComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('sharing.smb.query', smbShares), mockCall('sharing.smb.delete'), mockCall('sharing.smb.update'), diff --git a/src/app/pages/sharing/iscsi/associated-target/associated-target-form/associated-target-form.component.spec.ts b/src/app/pages/sharing/iscsi/associated-target/associated-target-form/associated-target-form.component.spec.ts index 72377d45e9c..e1a9e934c99 100644 --- a/src/app/pages/sharing/iscsi/associated-target/associated-target-form/associated-target-form.component.spec.ts +++ b/src/app/pages/sharing/iscsi/associated-target/associated-target-form/associated-target-form.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { IscsiTargetExtent } from 'app/interfaces/iscsi.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; @@ -47,7 +47,7 @@ describe('AssociatedTargetFormComponent', () => { }), mockProvider(SlideInService), mockProvider(DialogService), - mockWebSocket([ + mockApi([ mockCall('iscsi.targetextent.create'), mockCall('iscsi.targetextent.update'), ]), diff --git a/src/app/pages/sharing/iscsi/associated-target/associated-target-list/associated-target-list.component.spec.ts b/src/app/pages/sharing/iscsi/associated-target/associated-target-list/associated-target-list.component.spec.ts index d79909f89a3..bdc8d004cf9 100644 --- a/src/app/pages/sharing/iscsi/associated-target/associated-target-list/associated-target-list.component.spec.ts +++ b/src/app/pages/sharing/iscsi/associated-target/associated-target-list/associated-target-list.component.spec.ts @@ -4,7 +4,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { Spectator, createComponentFactory, mockProvider } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { IscsiExtent, IscsiTarget, IscsiTargetExtent } from 'app/interfaces/iscsi.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { EmptyService } from 'app/modules/empty/empty.service'; @@ -53,7 +53,7 @@ describe('AssociatedTargetListComponent', () => { providers: [ mockAuth(), mockProvider(EmptyService), - mockWebSocket([ + mockApi([ mockCall('iscsi.targetextent.query', targetExtents), mockCall('iscsi.targetextent.delete'), mockCall('iscsi.target.query', targets), diff --git a/src/app/pages/sharing/iscsi/authorized-access/authorized-access-form/authorized-access-form.component.spec.ts b/src/app/pages/sharing/iscsi/authorized-access/authorized-access-form/authorized-access-form.component.spec.ts index e9f650bf3e3..f09ad454257 100644 --- a/src/app/pages/sharing/iscsi/authorized-access/authorized-access-form/authorized-access-form.component.spec.ts +++ b/src/app/pages/sharing/iscsi/authorized-access/authorized-access-form/authorized-access-form.component.spec.ts @@ -4,7 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { IscsiAuthAccess } from 'app/interfaces/iscsi.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; @@ -39,7 +39,7 @@ describe('AuthorizedAccessFormComponent', () => { mockAuth(), mockProvider(SlideInService), mockProvider(DialogService), - mockWebSocket([ + mockApi([ mockCall('iscsi.auth.create'), mockCall('iscsi.auth.update'), ]), diff --git a/src/app/pages/sharing/iscsi/authorized-access/authorized-access-list/authorized-access-list.component.spec.ts b/src/app/pages/sharing/iscsi/authorized-access/authorized-access-list/authorized-access-list.component.spec.ts index a9c4b8ac784..f50120303fb 100644 --- a/src/app/pages/sharing/iscsi/authorized-access/authorized-access-list/authorized-access-list.component.spec.ts +++ b/src/app/pages/sharing/iscsi/authorized-access/authorized-access-list/authorized-access-list.component.spec.ts @@ -5,7 +5,7 @@ import { MatDialog } from '@angular/material/dialog'; import { Spectator, createComponentFactory, mockProvider } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { IscsiAuthAccess } from 'app/interfaces/iscsi.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { EmptyService } from 'app/modules/empty/empty.service'; @@ -46,7 +46,7 @@ describe('AuthorizedAccessListComponent', () => { providers: [ mockAuth(), mockProvider(EmptyService), - mockWebSocket([ + mockApi([ mockCall('iscsi.auth.query', authAccess), mockCall('iscsi.auth.delete'), ]), diff --git a/src/app/pages/sharing/iscsi/extent/extent-form/extent-form.component.spec.ts b/src/app/pages/sharing/iscsi/extent/extent-form/extent-form.component.spec.ts index 596bbfabf41..2d41f224690 100644 --- a/src/app/pages/sharing/iscsi/extent/extent-form/extent-form.component.spec.ts +++ b/src/app/pages/sharing/iscsi/extent/extent-form/extent-form.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { KiB } from 'app/constants/bytes.constant'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { IscsiExtentRpm, IscsiExtentType } from 'app/enums/iscsi.enum'; import { Choices } from 'app/interfaces/choices.interface'; import { IscsiExtent } from 'app/interfaces/iscsi.interface'; @@ -52,7 +52,7 @@ describe('ExtentFormComponent', () => { mockProvider(SlideInService), mockProvider(StorageService), mockProvider(DialogService), - mockWebSocket([ + mockApi([ mockCall('iscsi.extent.create'), mockCall('iscsi.extent.update'), mockCall('iscsi.extent.disk_choices', { diff --git a/src/app/pages/sharing/iscsi/extent/extent-list/delete-extent-dialog/delete-extent-dialog.component.spec.ts b/src/app/pages/sharing/iscsi/extent/extent-list/delete-extent-dialog/delete-extent-dialog.component.spec.ts index 5da82c9fa93..6d9a4e64da0 100644 --- a/src/app/pages/sharing/iscsi/extent/extent-list/delete-extent-dialog/delete-extent-dialog.component.spec.ts +++ b/src/app/pages/sharing/iscsi/extent/extent-list/delete-extent-dialog/delete-extent-dialog.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { IscsiExtentType } from 'app/enums/iscsi.enum'; import { IscsiExtent } from 'app/interfaces/iscsi.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -25,7 +25,7 @@ describe('DeleteExtentDialogComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('iscsi.extent.delete'), ]), mockProvider(MatDialogRef), diff --git a/src/app/pages/sharing/iscsi/extent/extent-list/extent-list.component.spec.ts b/src/app/pages/sharing/iscsi/extent/extent-list/extent-list.component.spec.ts index a29119cdc2f..16fc169ce0d 100644 --- a/src/app/pages/sharing/iscsi/extent/extent-list/extent-list.component.spec.ts +++ b/src/app/pages/sharing/iscsi/extent/extent-list/extent-list.component.spec.ts @@ -5,7 +5,7 @@ import { MatDialog } from '@angular/material/dialog'; import { Spectator, createComponentFactory, mockProvider } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { IscsiExtent } from 'app/interfaces/iscsi.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { EmptyService } from 'app/modules/empty/empty.service'; @@ -48,7 +48,7 @@ describe('ExtentListComponent', () => { ], providers: [ mockProvider(EmptyService), - mockWebSocket([ + mockApi([ mockCall('iscsi.extent.query', extents), mockCall('iscsi.extent.delete'), ]), diff --git a/src/app/pages/sharing/iscsi/initiator/initiator-form/initiator-form.component.spec.ts b/src/app/pages/sharing/iscsi/initiator/initiator-form/initiator-form.component.spec.ts index 0a838342738..41e0f64f954 100644 --- a/src/app/pages/sharing/iscsi/initiator/initiator-form/initiator-form.component.spec.ts +++ b/src/app/pages/sharing/iscsi/initiator/initiator-form/initiator-form.component.spec.ts @@ -6,7 +6,7 @@ import { MatListHarness } from '@angular/material/list/testing'; import { Router } from '@angular/router'; import { createRoutingFactory, mockProvider, SpectatorRouting } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { suppressJsDomCssErrors } from 'app/core/testing/utils/suppress-jsdom-css-errors.utils'; import { IscsiGlobalSession } from 'app/interfaces/iscsi-global-config.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -28,7 +28,7 @@ describe('InitiatorFormComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('iscsi.global.sessions', [{ initiator: 'inr1', initiator_addr: '10.0.0.1', diff --git a/src/app/pages/sharing/iscsi/initiator/initiator-list/initiator-list.component.spec.ts b/src/app/pages/sharing/iscsi/initiator/initiator-list/initiator-list.component.spec.ts index 4102c42b72f..176fcec6d92 100644 --- a/src/app/pages/sharing/iscsi/initiator/initiator-list/initiator-list.component.spec.ts +++ b/src/app/pages/sharing/iscsi/initiator/initiator-list/initiator-list.component.spec.ts @@ -7,7 +7,7 @@ import { SpectatorRouting } from '@ngneat/spectator'; import { mockProvider, createRoutingFactory } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { IscsiExtent, IscsiInitiatorGroup } from 'app/interfaces/iscsi.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { EmptyService } from 'app/modules/empty/empty.service'; @@ -45,7 +45,7 @@ describe('InitiatorListComponent', () => { providers: [ mockAuth(), mockProvider(EmptyService), - mockWebSocket([ + mockApi([ mockCall('iscsi.initiator.query', initiators), mockCall('iscsi.initiator.delete'), ]), diff --git a/src/app/pages/sharing/iscsi/iscsi-wizard/iscsi-wizard.component.spec.ts b/src/app/pages/sharing/iscsi/iscsi-wizard/iscsi-wizard.component.spec.ts index 83ee6cdae22..8b505d713e3 100644 --- a/src/app/pages/sharing/iscsi/iscsi-wizard/iscsi-wizard.component.spec.ts +++ b/src/app/pages/sharing/iscsi/iscsi-wizard/iscsi-wizard.component.spec.ts @@ -9,7 +9,7 @@ import { Store } from '@ngrx/store'; import { provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { ServiceName } from 'app/enums/service-name.enum'; import { ServiceStatus } from 'app/enums/service-status.enum'; import { Dataset } from 'app/interfaces/dataset.interface'; @@ -54,7 +54,7 @@ describe('IscsiWizardComponent', () => { mockProvider(DialogService, { confirm: jest.fn(() => of(true)), }), - mockWebSocket([ + mockApi([ mockCall('iscsi.global.sessions', [] as IscsiGlobalSession[]), mockCall('iscsi.extent.query', []), mockCall('iscsi.target.query', []), diff --git a/src/app/pages/sharing/iscsi/portal/portal-form/portal-form.component.spec.ts b/src/app/pages/sharing/iscsi/portal/portal-form/portal-form.component.spec.ts index 3574a505305..648d317fad0 100644 --- a/src/app/pages/sharing/iscsi/portal/portal-form/portal-form.component.spec.ts +++ b/src/app/pages/sharing/iscsi/portal/portal-form/portal-form.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { provideMockStore } from '@ngrx/store/testing'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { IscsiAuthMethod } from 'app/enums/iscsi.enum'; import { IscsiPortal } from 'app/interfaces/iscsi.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -27,7 +27,7 @@ describe('PortalFormComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('iscsi.auth.query', [{ id: 1, peersecret: '', diff --git a/src/app/pages/sharing/iscsi/portal/portal-list/portal-list.component.spec.ts b/src/app/pages/sharing/iscsi/portal/portal-list/portal-list.component.spec.ts index d1bf27cf337..c61edadffe1 100644 --- a/src/app/pages/sharing/iscsi/portal/portal-list/portal-list.component.spec.ts +++ b/src/app/pages/sharing/iscsi/portal/portal-list/portal-list.component.spec.ts @@ -6,7 +6,7 @@ import { SpectatorRouting } from '@ngneat/spectator'; import { mockProvider, createRoutingFactory } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { Choices } from 'app/interfaces/choices.interface'; import { IscsiPortal } from 'app/interfaces/iscsi.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -52,7 +52,7 @@ describe('PortalListComponent', () => { ], providers: [ mockProvider(EmptyService), - mockWebSocket([ + mockApi([ mockCall('iscsi.portal.query', portals), mockCall('iscsi.portal.delete'), mockCall('iscsi.portal.listen_ip_choices', { '0.0.0.0': '0.0.0.0' } as Choices), diff --git a/src/app/pages/sharing/iscsi/target-global-configuration/target-global-configuration.component.spec.ts b/src/app/pages/sharing/iscsi/target-global-configuration/target-global-configuration.component.spec.ts index c9e811124c0..610bd104931 100644 --- a/src/app/pages/sharing/iscsi/target-global-configuration/target-global-configuration.component.spec.ts +++ b/src/app/pages/sharing/iscsi/target-global-configuration/target-global-configuration.component.spec.ts @@ -8,7 +8,7 @@ import { Store } from '@ngrx/store'; import { MockStore, provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { ServiceName } from 'app/enums/service-name.enum'; import { IscsiGlobalConfig } from 'app/interfaces/iscsi-global-config.interface'; import { Service } from 'app/interfaces/service.interface'; @@ -36,7 +36,7 @@ describe('TargetGlobalConfigurationComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('iscsi.global.config', { basename: 'iqn.2005-10.org.freenas.ctl', isns_servers: ['188.23.4.23', '92.233.1.1'], diff --git a/src/app/pages/sharing/iscsi/target/target-form/target-form.component.spec.ts b/src/app/pages/sharing/iscsi/target/target-form/target-form.component.spec.ts index 3c5e9872bc9..2ddeefe445e 100644 --- a/src/app/pages/sharing/iscsi/target/target-form/target-form.component.spec.ts +++ b/src/app/pages/sharing/iscsi/target/target-form/target-form.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { IscsiAuthMethod, IscsiTargetMode } from 'app/enums/iscsi.enum'; import { IscsiAuthAccess, IscsiInitiatorGroup, IscsiPortal, IscsiTarget, @@ -60,7 +60,7 @@ describe('TargetFormComponent', () => { mockProvider(DialogService), mockProvider(SlideInRef), { provide: SLIDE_IN_DATA, useValue: undefined }, - mockWebSocket([ + mockApi([ mockCall('iscsi.target.create'), mockCall('iscsi.target.update'), mockCall('iscsi.target.validate_name', null), diff --git a/src/app/pages/sharing/iscsi/target/target-list/target-list.component.spec.ts b/src/app/pages/sharing/iscsi/target/target-list/target-list.component.spec.ts index b4e6c4017cf..92c98ace4a0 100644 --- a/src/app/pages/sharing/iscsi/target/target-list/target-list.component.spec.ts +++ b/src/app/pages/sharing/iscsi/target/target-list/target-list.component.spec.ts @@ -4,7 +4,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { Spectator, createComponentFactory, mockProvider } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { IscsiTarget } from 'app/interfaces/iscsi.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { EmptyService } from 'app/modules/empty/empty.service'; @@ -41,7 +41,7 @@ describe('TargetListComponent', () => { ], providers: [ mockProvider(EmptyService), - mockWebSocket([ + mockApi([ mockCall('iscsi.target.query', targets), mockCall('iscsi.target.delete'), mockCall('iscsi.global.sessions', []), diff --git a/src/app/pages/sharing/nfs/nfs-form/nfs-form.component.spec.ts b/src/app/pages/sharing/nfs/nfs-form/nfs-form.component.spec.ts index 94c3f428f3d..2ed4654d19c 100644 --- a/src/app/pages/sharing/nfs/nfs-form/nfs-form.component.spec.ts +++ b/src/app/pages/sharing/nfs/nfs-form/nfs-form.component.spec.ts @@ -9,7 +9,7 @@ import { MockStore, provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { NfsProtocol } from 'app/enums/nfs-protocol.enum'; import { ServiceName } from 'app/enums/service-name.enum'; import { NfsConfig } from 'app/interfaces/nfs-config.interface'; @@ -68,7 +68,7 @@ describe('NfsFormComponent', () => { IxIpInputWithNetmaskComponent, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('sharing.nfs.create'), mockCall('sharing.nfs.update'), mockCall('nfs.config', { diff --git a/src/app/pages/sharing/nfs/nfs-list/nfs-list.component.spec.ts b/src/app/pages/sharing/nfs/nfs-list/nfs-list.component.spec.ts index cef6e355306..f7478e17349 100644 --- a/src/app/pages/sharing/nfs/nfs-list/nfs-list.component.spec.ts +++ b/src/app/pages/sharing/nfs/nfs-list/nfs-list.component.spec.ts @@ -4,7 +4,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { Spectator, createComponentFactory, mockProvider } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { NfsShare } from 'app/interfaces/nfs-share.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { EmptyService } from 'app/modules/empty/empty.service'; @@ -47,7 +47,7 @@ describe('NfsListComponent', () => { providers: [ mockAuth(), mockProvider(EmptyService), - mockWebSocket([ + mockApi([ mockCall('sharing.nfs.query', shares as NfsShare[]), mockCall('sharing.nfs.delete'), mockCall('sharing.nfs.update'), diff --git a/src/app/pages/sharing/nfs/nfs-session-list/nfs-session-list.component.spec.ts b/src/app/pages/sharing/nfs/nfs-session-list/nfs-session-list.component.spec.ts index a60e572b92b..f866ab7f8f1 100644 --- a/src/app/pages/sharing/nfs/nfs-session-list/nfs-session-list.component.spec.ts +++ b/src/app/pages/sharing/nfs/nfs-session-list/nfs-session-list.component.spec.ts @@ -4,7 +4,7 @@ import { MatButtonToggleChange, MatButtonToggleModule } from '@angular/material/ import { Spectator } from '@ngneat/spectator'; import { createComponentFactory } from '@ngneat/spectator/jest'; import { MockComponent } from 'ng-mocks'; -import { mockWebSocket, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; import { Nfs3Session, Nfs4Session, NfsType } from 'app/interfaces/nfs-share.interface'; import { SearchInput1Component } from 'app/modules/forms/search-input1/search-input1.component'; import { IxTableHarness } from 'app/modules/ix-table/components/ix-table/ix-table.harness'; @@ -53,7 +53,7 @@ describe('NfsSessionListComponent', () => { IxTableColumnsSelectorComponent, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('nfs.get_nfs3_clients', nfs3Sessions), mockCall('nfs.get_nfs4_clients', nfs4Sessions), ]), diff --git a/src/app/pages/sharing/smb/smb-acl/smb-acl.component.spec.ts b/src/app/pages/sharing/smb/smb-acl/smb-acl.component.spec.ts index aeef3eda3d3..d09e7196e6e 100644 --- a/src/app/pages/sharing/smb/smb-acl/smb-acl.component.spec.ts +++ b/src/app/pages/sharing/smb/smb-acl/smb-acl.component.spec.ts @@ -6,7 +6,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { User } from '@sentry/angular'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { NfsAclTag } from 'app/enums/nfs-acl.enum'; import { SmbSharesecPermission, SmbSharesecType } from 'app/enums/smb-sharesec.enum'; import { Group } from 'app/interfaces/group.interface'; @@ -66,7 +66,7 @@ describe('SmbAclComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('sharing.smb.getacl', mockAcl), mockCall('sharing.smb.setacl'), mockCall('user.query', [rootUser] as TnUser[]), diff --git a/src/app/pages/sharing/smb/smb-form/smb-form.component.spec.ts b/src/app/pages/sharing/smb/smb-form/smb-form.component.spec.ts index fcd599237fb..183d306677b 100644 --- a/src/app/pages/sharing/smb/smb-form/smb-form.component.spec.ts +++ b/src/app/pages/sharing/smb/smb-form/smb-form.component.spec.ts @@ -9,7 +9,7 @@ import { Store } from '@ngrx/store'; import { MockStore, provideMockStore } from '@ngrx/store/testing'; import { of, throwError } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { ServiceName } from 'app/enums/service-name.enum'; import { ServiceStatus } from 'app/enums/service-status.enum'; import { helptextSharingSmb } from 'app/helptext/sharing'; @@ -144,7 +144,7 @@ describe('SmbFormComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('group.query', [{ group: 'test' }] as Group[]), mockCall('sharing.smb.create', { ...existingShare }), mockCall('sharing.smb.update', { ...existingShare }), diff --git a/src/app/pages/sharing/smb/smb-list/smb-list.component.spec.ts b/src/app/pages/sharing/smb/smb-list/smb-list.component.spec.ts index f09536ef370..e02be4c7390 100644 --- a/src/app/pages/sharing/smb/smb-list/smb-list.component.spec.ts +++ b/src/app/pages/sharing/smb/smb-list/smb-list.component.spec.ts @@ -7,7 +7,7 @@ import { provideMockStore } from '@ngrx/store/testing'; import { MockComponents } from 'ng-mocks'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { ServiceName } from 'app/enums/service-name.enum'; import { ServiceStatus } from 'app/enums/service-status.enum'; import { Service } from 'app/interfaces/service.interface'; @@ -63,7 +63,7 @@ describe('SmbListComponent', () => { ], providers: [ mockProvider(EmptyService), - mockWebSocket([ + mockApi([ mockCall('sharing.smb.query', shares as SmbShare[]), mockCall('sharing.smb.delete'), mockCall('sharing.smb.update'), diff --git a/src/app/pages/sharing/smb/smb-status/components/smb-lock-list/smb-lock-list.component.spec.ts b/src/app/pages/sharing/smb/smb-status/components/smb-lock-list/smb-lock-list.component.spec.ts index 135db7886ce..e31705afca5 100644 --- a/src/app/pages/sharing/smb/smb-status/components/smb-lock-list/smb-lock-list.component.spec.ts +++ b/src/app/pages/sharing/smb/smb-status/components/smb-lock-list/smb-lock-list.component.spec.ts @@ -3,7 +3,7 @@ import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { MatButtonHarness } from '@angular/material/button/testing'; import { Spectator } from '@ngneat/spectator'; import { createComponentFactory } from '@ngneat/spectator/jest'; -import { mockWebSocket, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; import { SmbLockInfo, SmbOpenInfo } from 'app/interfaces/smb-status.interface'; import { SearchInput1Component } from 'app/modules/forms/search-input1/search-input1.component'; import { IxTableHarness } from 'app/modules/ix-table/components/ix-table/ix-table.harness'; @@ -69,7 +69,7 @@ describe('SmbLockListComponent', () => { IxTableDetailsRowDirective, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('smb.status', locks), ]), ], diff --git a/src/app/pages/sharing/smb/smb-status/components/smb-notification-list/smb-notification-list.component.spec.ts b/src/app/pages/sharing/smb/smb-status/components/smb-notification-list/smb-notification-list.component.spec.ts index 6bf9992269f..6de3e8bd2fe 100644 --- a/src/app/pages/sharing/smb/smb-status/components/smb-notification-list/smb-notification-list.component.spec.ts +++ b/src/app/pages/sharing/smb/smb-status/components/smb-notification-list/smb-notification-list.component.spec.ts @@ -3,7 +3,7 @@ import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { MatButtonHarness } from '@angular/material/button/testing'; import { Spectator } from '@ngneat/spectator'; import { createComponentFactory } from '@ngneat/spectator/jest'; -import { mockWebSocket, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; import { SmbNotificationInfo } from 'app/interfaces/smb-status.interface'; import { SearchInput1Component } from 'app/modules/forms/search-input1/search-input1.component'; import { IxTableHarness } from 'app/modules/ix-table/components/ix-table/ix-table.harness'; @@ -36,7 +36,7 @@ describe('SmbNotificationListComponent', () => { SearchInput1Component, IxTableColumnsSelectorComponent, ], - providers: [mockWebSocket([mockCall('smb.status', notifications)])], + providers: [mockApi([mockCall('smb.status', notifications)])], }); beforeEach(async () => { diff --git a/src/app/pages/sharing/smb/smb-status/components/smb-session-list/smb-session-list.component.spec.ts b/src/app/pages/sharing/smb/smb-status/components/smb-session-list/smb-session-list.component.spec.ts index b123243655c..2a0c70cf3f9 100644 --- a/src/app/pages/sharing/smb/smb-status/components/smb-session-list/smb-session-list.component.spec.ts +++ b/src/app/pages/sharing/smb/smb-status/components/smb-session-list/smb-session-list.component.spec.ts @@ -3,7 +3,7 @@ import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { MatButtonHarness } from '@angular/material/button/testing'; import { Spectator } from '@ngneat/spectator'; import { createComponentFactory } from '@ngneat/spectator/jest'; -import { mockWebSocket, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; import { SmbSession } from 'app/interfaces/smb-status.interface'; import { SearchInput1Component } from 'app/modules/forms/search-input1/search-input1.component'; import { IxTableHarness } from 'app/modules/ix-table/components/ix-table/ix-table.harness'; @@ -50,7 +50,7 @@ describe('SmbSessionListComponent', () => { SearchInput1Component, IxTableColumnsSelectorComponent, ], - providers: [mockWebSocket([mockCall('smb.status', sessions)])], + providers: [mockApi([mockCall('smb.status', sessions)])], }); beforeEach(async () => { diff --git a/src/app/pages/sharing/smb/smb-status/components/smb-share-list/smb-share-list.component.spec.ts b/src/app/pages/sharing/smb/smb-status/components/smb-share-list/smb-share-list.component.spec.ts index f7dfc358101..620258f5c04 100644 --- a/src/app/pages/sharing/smb/smb-status/components/smb-share-list/smb-share-list.component.spec.ts +++ b/src/app/pages/sharing/smb/smb-status/components/smb-share-list/smb-share-list.component.spec.ts @@ -3,7 +3,7 @@ import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { MatButtonHarness } from '@angular/material/button/testing'; import { Spectator } from '@ngneat/spectator'; import { createComponentFactory } from '@ngneat/spectator/jest'; -import { mockWebSocket, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; import { SmbShareInfo } from 'app/interfaces/smb-status.interface'; import { SearchInput1Component } from 'app/modules/forms/search-input1/search-input1.component'; import { IxTableHarness } from 'app/modules/ix-table/components/ix-table/ix-table.harness'; @@ -41,7 +41,7 @@ describe('SmbShareListComponent', () => { SearchInput1Component, IxTableColumnsSelectorComponent, ], - providers: [mockWebSocket([mockCall('smb.status', shares)])], + providers: [mockApi([mockCall('smb.status', shares)])], }); beforeEach(async () => { diff --git a/src/app/pages/signin/set-admin-password-form/set-admin-password-form.component.spec.ts b/src/app/pages/signin/set-admin-password-form/set-admin-password-form.component.spec.ts index 0c7da93247b..99feace84aa 100644 --- a/src/app/pages/signin/set-admin-password-form/set-admin-password-form.component.spec.ts +++ b/src/app/pages/signin/set-admin-password-form/set-admin-password-form.component.spec.ts @@ -4,7 +4,7 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { LoginResult } from 'app/enums/login-result.enum'; import { IxInputHarness } from 'app/modules/forms/ix-forms/components/ix-input/ix-input.harness'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; @@ -26,7 +26,7 @@ describe('SetAdminPasswordFormComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('user.setup_local_administrator'), ]), mockProvider(SigninStore, { diff --git a/src/app/pages/signin/signin-form/signin-form.component.spec.ts b/src/app/pages/signin/signin-form/signin-form.component.spec.ts index 723ef4255b3..8c0f22f5690 100644 --- a/src/app/pages/signin/signin-form/signin-form.component.spec.ts +++ b/src/app/pages/signin/signin-form/signin-form.component.spec.ts @@ -6,7 +6,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { MockComponent } from 'ng-mocks'; import { of } from 'rxjs'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { LoginResult } from 'app/enums/login-result.enum'; import { LoginExResponseType } from 'app/interfaces/auth.interface'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; @@ -31,7 +31,7 @@ describe('SigninFormComponent', () => { mockProvider(AuthService, { login: jest.fn(() => of(LoginResult.Success)), }), - mockWebSocket([ + mockApi([ mockCall('auth.login_ex', { response_type: LoginExResponseType.Success }), ]), mockProvider(SigninStore, { diff --git a/src/app/pages/signin/store/signin.store.spec.ts b/src/app/pages/signin/store/signin.store.spec.ts index b3687810133..0eaf9bf95f5 100644 --- a/src/app/pages/signin/store/signin.store.spec.ts +++ b/src/app/pages/signin/store/signin.store.spec.ts @@ -4,7 +4,7 @@ import { mockProvider } from '@ngneat/spectator/jest'; import { BehaviorSubject, firstValueFrom, of } from 'rxjs'; import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; import { getTestScheduler } from 'app/core/testing/utils/get-test-scheduler.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { FailoverDisabledReason } from 'app/enums/failover-disabled-reason.enum'; import { FailoverStatus } from 'app/enums/failover-status.enum'; import { LoginResult } from 'app/enums/login-result.enum'; @@ -32,7 +32,7 @@ describe('SigninStore', () => { const createService = createServiceFactory({ service: SigninStore, providers: [ - mockWebSocket([ + mockApi([ mockCall('user.has_local_administrator_set_up', true), mockCall('failover.status', FailoverStatus.Single), mockCall('failover.get_ips', ['123.23.44.54']), diff --git a/src/app/pages/signin/true-command-status/true-command-status.component.spec.ts b/src/app/pages/signin/true-command-status/true-command-status.component.spec.ts index 1aff3fb6d96..c57f6237752 100644 --- a/src/app/pages/signin/true-command-status/true-command-status.component.spec.ts +++ b/src/app/pages/signin/true-command-status/true-command-status.component.spec.ts @@ -1,5 +1,5 @@ import { createComponentFactory, Spectator } from '@ngneat/spectator/jest'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { TrueCommandStatusComponent, } from 'app/pages/signin/true-command-status/true-command-status.component'; @@ -10,7 +10,7 @@ describe('TrueCommandStatusComponent', () => { const createComponent = createComponentFactory({ component: TrueCommandStatusComponent, providers: [ - mockWebSocket([ + mockApi([ mockCall('truenas.managed_by_truecommand', true), ]), ], diff --git a/src/app/pages/storage/components/dashboard-pool/dashboard-pool.component.spec.ts b/src/app/pages/storage/components/dashboard-pool/dashboard-pool.component.spec.ts index e815c12e8c7..85b326f2c91 100644 --- a/src/app/pages/storage/components/dashboard-pool/dashboard-pool.component.spec.ts +++ b/src/app/pages/storage/components/dashboard-pool/dashboard-pool.component.spec.ts @@ -8,7 +8,7 @@ import { MockComponent } from 'ng-mocks'; import { of } from 'rxjs'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { helptextVolumes } from 'app/helptext/storage/volumes/volume-list'; import { Pool } from 'app/interfaces/pool.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -55,7 +55,7 @@ describe('DashboardPoolComponent', () => { mockProvider(DialogService, { confirm: jest.fn(() => of(true)), }), - mockWebSocket([ + mockApi([ mockCall('disk.query', []), mockCall('pool.upgrade'), mockJob('pool.expand', fakeSuccessfulJob()), diff --git a/src/app/pages/storage/components/dashboard-pool/export-disconnect-modal/export-disconnect-modal.component.spec.ts b/src/app/pages/storage/components/dashboard-pool/export-disconnect-modal/export-disconnect-modal.component.spec.ts index d685ab09d9d..ad78c4877b7 100644 --- a/src/app/pages/storage/components/dashboard-pool/export-disconnect-modal/export-disconnect-modal.component.spec.ts +++ b/src/app/pages/storage/components/dashboard-pool/export-disconnect-modal/export-disconnect-modal.component.spec.ts @@ -9,7 +9,7 @@ import { import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; import { - mockCall, mockJob, mockWebSocket, + mockCall, mockJob, mockApi, } from 'app/core/testing/utils/mock-websocket.utils'; import { PoolStatus } from 'app/enums/pool-status.enum'; import { DatasetAttachment, PoolAttachment } from 'app/interfaces/pool-attachment.interface'; @@ -67,7 +67,7 @@ describe('ExportDisconnectModalComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('pool.attachments', data.attachments), mockCall('pool.processes', data.processes), mockCall('systemdataset.config', { pool: 'fakeSystemPool' } as SystemDatasetConfig), diff --git a/src/app/pages/storage/components/dashboard-pool/topology-card/topology-card.component.spec.ts b/src/app/pages/storage/components/dashboard-pool/topology-card/topology-card.component.spec.ts index becebcc7643..8e3fc252d4a 100644 --- a/src/app/pages/storage/components/dashboard-pool/topology-card/topology-card.component.spec.ts +++ b/src/app/pages/storage/components/dashboard-pool/topology-card/topology-card.component.spec.ts @@ -1,7 +1,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { createComponentFactory, Spectator } from '@ngneat/spectator/jest'; import { MockComponent } from 'ng-mocks'; -import { mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { PoolCardIconType } from 'app/enums/pool-card-icon-type.enum'; import { PoolStatus } from 'app/enums/pool-status.enum'; import { Disk } from 'app/interfaces/disk.interface'; @@ -28,7 +28,7 @@ describe('TopologyCardComponent', () => { MockComponent(PoolCardIconComponent), ], providers: [ - mockWebSocket([]), + mockApi([]), ], }); diff --git a/src/app/pages/storage/components/dashboard-pool/zfs-health-card/autotrim-dialog/autotrim-dialog.component.spec.ts b/src/app/pages/storage/components/dashboard-pool/zfs-health-card/autotrim-dialog/autotrim-dialog.component.spec.ts index f9c2bf4174a..359b251d1c6 100644 --- a/src/app/pages/storage/components/dashboard-pool/zfs-health-card/autotrim-dialog/autotrim-dialog.component.spec.ts +++ b/src/app/pages/storage/components/dashboard-pool/zfs-health-card/autotrim-dialog/autotrim-dialog.component.spec.ts @@ -6,7 +6,7 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { OnOff } from 'app/enums/on-off.enum'; import { Pool } from 'app/interfaces/pool.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -36,7 +36,7 @@ describe('AutotrimDialogComponent', () => { }, } as Pool, }, - mockWebSocket([ + mockApi([ mockJob('pool.update', fakeSuccessfulJob()), ]), mockProvider(SnackbarService), diff --git a/src/app/pages/storage/components/import-pool/import-pool.component.spec.ts b/src/app/pages/storage/components/import-pool/import-pool.component.spec.ts index 59ad003727d..d60b4de7979 100644 --- a/src/app/pages/storage/components/import-pool/import-pool.component.spec.ts +++ b/src/app/pages/storage/components/import-pool/import-pool.component.spec.ts @@ -7,7 +7,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { of } from 'rxjs'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { PoolStatus } from 'app/enums/pool-status.enum'; import { Dataset } from 'app/interfaces/dataset.interface'; import { PoolFindResult } from 'app/interfaces/pool-import.interface'; @@ -29,7 +29,7 @@ describe('ImportPoolComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockJob('pool.import_pool', fakeSuccessfulJob()), mockJob( 'pool.import_find', diff --git a/src/app/pages/storage/components/unused-resources/unused-resources.component.spec.ts b/src/app/pages/storage/components/unused-resources/unused-resources.component.spec.ts index cd935f16854..6f2bdb654a5 100644 --- a/src/app/pages/storage/components/unused-resources/unused-resources.component.spec.ts +++ b/src/app/pages/storage/components/unused-resources/unused-resources.component.spec.ts @@ -1,7 +1,7 @@ import { createComponentFactory, Spectator } from '@ngneat/spectator/jest'; import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DetailsDisk } from 'app/interfaces/disk.interface'; import { Pool } from 'app/interfaces/pool.interface'; import { UnusedDiskCardComponent } from 'app/pages/storage/components/unused-resources/unused-disk-card/unused-disk-card.component'; @@ -17,7 +17,7 @@ describe('UnusedResourcesComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('disk.details', { used: [ { devname: 'sdb', identifier: '{serial_lunid}BBBBB1', exported_zpool: 'pool' }, diff --git a/src/app/pages/storage/modules/devices/components/disk-info-card/replace-disk-dialog/replace-disk-dialog.component.spec.ts b/src/app/pages/storage/modules/devices/components/disk-info-card/replace-disk-dialog/replace-disk-dialog.component.spec.ts index dbc7686b306..8b4c1e584f9 100644 --- a/src/app/pages/storage/modules/devices/components/disk-info-card/replace-disk-dialog/replace-disk-dialog.component.spec.ts +++ b/src/app/pages/storage/modules/devices/components/disk-info-card/replace-disk-dialog/replace-disk-dialog.component.spec.ts @@ -8,7 +8,7 @@ import { of } from 'rxjs'; import { GiB } from 'app/constants/bytes.constant'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DetailsDisk } from 'app/interfaces/disk.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { UnusedDiskSelectComponent } from 'app/modules/forms/custom-selects/unused-disk-select/unused-disk-select.component'; @@ -31,7 +31,7 @@ describe('ReplaceDiskDialogComponent', () => { UnusedDiskSelectComponent, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('disk.details', { unused: [ { devname: 'sdb', identifier: '{serial_lunid}BBBBB1', size: 10 * GiB }, diff --git a/src/app/pages/storage/modules/devices/components/hardware-disk-encryption/hardware-disk-encryption.component.spec.ts b/src/app/pages/storage/modules/devices/components/hardware-disk-encryption/hardware-disk-encryption.component.spec.ts index 5ba6631831c..fa50d3df83b 100644 --- a/src/app/pages/storage/modules/devices/components/hardware-disk-encryption/hardware-disk-encryption.component.spec.ts +++ b/src/app/pages/storage/modules/devices/components/hardware-disk-encryption/hardware-disk-encryption.component.spec.ts @@ -4,7 +4,7 @@ import { } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { HasRoleDirective } from 'app/directives/has-role/has-role.directive'; import { Disk } from 'app/interfaces/disk.interface'; import { TopologyDisk } from 'app/interfaces/storage.interface'; @@ -22,7 +22,7 @@ describe('HardwareDiskEncryptionComponent', () => { HasRoleDirective, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('disk.query', [{ passwd: '' } as Disk]), mockCall('system.advanced.sed_global_password_is_set', true), ]), diff --git a/src/app/pages/storage/modules/devices/components/hardware-disk-encryption/manage-disk-sed-dialog/manage-disk-sed-dialog.component.spec.ts b/src/app/pages/storage/modules/devices/components/hardware-disk-encryption/manage-disk-sed-dialog/manage-disk-sed-dialog.component.spec.ts index 3d1a2c113a6..320db50d557 100644 --- a/src/app/pages/storage/modules/devices/components/hardware-disk-encryption/manage-disk-sed-dialog/manage-disk-sed-dialog.component.spec.ts +++ b/src/app/pages/storage/modules/devices/components/hardware-disk-encryption/manage-disk-sed-dialog/manage-disk-sed-dialog.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { Disk } from 'app/interfaces/disk.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxInputHarness } from 'app/modules/forms/ix-forms/components/ix-input/ix-input.harness'; @@ -24,7 +24,7 @@ describe('ManageDiskSedDialogComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('disk.query', [ { identifier: 'disk1234', diff --git a/src/app/pages/storage/modules/devices/components/smart-info-card/smart-info-card.component.spec.ts b/src/app/pages/storage/modules/devices/components/smart-info-card/smart-info-card.component.spec.ts index f0023ceb29e..680deb65bd0 100644 --- a/src/app/pages/storage/modules/devices/components/smart-info-card/smart-info-card.component.spec.ts +++ b/src/app/pages/storage/modules/devices/components/smart-info-card/smart-info-card.component.spec.ts @@ -7,7 +7,7 @@ import { } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { SmartTestResultStatus } from 'app/enums/smart-test-result-status.enum'; import { Disk } from 'app/interfaces/disk.interface'; import { SmartTestResults, SmartTestTask } from 'app/interfaces/smart-test.interface'; @@ -30,7 +30,7 @@ describe('SmartInfoCardComponent', () => { component: SmartInfoCardComponent, providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('smart.test.results', [ { disk: 'sdc', diff --git a/src/app/pages/storage/modules/devices/components/zfs-info-card/extend-dialog/extend-dialog.component.spec.ts b/src/app/pages/storage/modules/devices/components/zfs-info-card/extend-dialog/extend-dialog.component.spec.ts index 889110c119d..0be8d3340e8 100644 --- a/src/app/pages/storage/modules/devices/components/zfs-info-card/extend-dialog/extend-dialog.component.spec.ts +++ b/src/app/pages/storage/modules/devices/components/zfs-info-card/extend-dialog/extend-dialog.component.spec.ts @@ -7,7 +7,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { of } from 'rxjs'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DetailsDisk } from 'app/interfaces/disk.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { UnusedDiskSelectComponent } from 'app/modules/forms/custom-selects/unused-disk-select/unused-disk-select.component'; @@ -30,7 +30,7 @@ describe('ExtendDialogComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockJob('pool.attach', fakeSuccessfulJob()), mockCall('disk.details', { unused: [ diff --git a/src/app/pages/storage/modules/devices/components/zfs-info-card/raidz-extend-dialog/raidz-extend-dialog.component.spec.ts b/src/app/pages/storage/modules/devices/components/zfs-info-card/raidz-extend-dialog/raidz-extend-dialog.component.spec.ts index 840c91b2a9e..527aaa10e54 100644 --- a/src/app/pages/storage/modules/devices/components/zfs-info-card/raidz-extend-dialog/raidz-extend-dialog.component.spec.ts +++ b/src/app/pages/storage/modules/devices/components/zfs-info-card/raidz-extend-dialog/raidz-extend-dialog.component.spec.ts @@ -10,7 +10,7 @@ import { of } from 'rxjs'; import { TiB } from 'app/constants/bytes.constant'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DetailsDisk } from 'app/interfaces/disk.interface'; import { VDev } from 'app/interfaces/storage.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -38,7 +38,7 @@ describe('RaidzExtendDialogComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockJob('pool.attach', fakeSuccessfulJob()), mockCall('disk.details', { unused: [ diff --git a/src/app/pages/storage/modules/devices/components/zfs-info-card/zfs-info-card.component.spec.ts b/src/app/pages/storage/modules/devices/components/zfs-info-card/zfs-info-card.component.spec.ts index cd7c1cabb29..f2b09e384b9 100644 --- a/src/app/pages/storage/modules/devices/components/zfs-info-card/zfs-info-card.component.spec.ts +++ b/src/app/pages/storage/modules/devices/components/zfs-info-card/zfs-info-card.component.spec.ts @@ -7,7 +7,7 @@ import { } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket, mockCall, mockJob } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall, mockJob } from 'app/core/testing/utils/mock-websocket.utils'; import { DiskStandby } from 'app/enums/disk-standby.enum'; import { DiskType } from 'app/enums/disk-type.enum'; import { TopologyItemType, VdevType } from 'app/enums/v-dev-type.enum'; @@ -30,7 +30,7 @@ describe('ZfsInfoCardComponent', () => { const createComponent = createComponentFactory({ component: ZfsInfoCardComponent, providers: [ - mockWebSocket([ + mockApi([ mockCall('pool.detach'), mockCall('pool.offline'), mockCall('pool.online'), diff --git a/src/app/pages/storage/modules/disks/components/disk-bulk-edit/disk-bulk-edit.component.spec.ts b/src/app/pages/storage/modules/disks/components/disk-bulk-edit/disk-bulk-edit.component.spec.ts index 1f9cde75bf4..320ce7f1218 100644 --- a/src/app/pages/storage/modules/disks/components/disk-bulk-edit/disk-bulk-edit.component.spec.ts +++ b/src/app/pages/storage/modules/disks/components/disk-bulk-edit/disk-bulk-edit.component.spec.ts @@ -6,7 +6,7 @@ import { Spectator } from '@ngneat/spectator'; import { createComponentFactory, mockProvider } from '@ngneat/spectator/jest'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DiskPowerLevel } from 'app/enums/disk-power-level.enum'; import { DiskStandby } from 'app/enums/disk-standby.enum'; import { CoreBulkQuery, CoreBulkResponse } from 'app/interfaces/core-bulk.interface'; @@ -57,7 +57,7 @@ describe('DiskBulkEditComponent', () => { mockProvider(SlideInRef), mockProvider(SnackbarService), mockProvider(DialogService), - mockWebSocket([ + mockApi([ mockJob('core.bulk', fakeSuccessfulJob(mockJobSuccessResponse)), ]), ], diff --git a/src/app/pages/storage/modules/disks/components/disk-form/disk-form.component.spec.ts b/src/app/pages/storage/modules/disks/components/disk-form/disk-form.component.spec.ts index 6117da55516..5d83261ae85 100644 --- a/src/app/pages/storage/modules/disks/components/disk-form/disk-form.component.spec.ts +++ b/src/app/pages/storage/modules/disks/components/disk-form/disk-form.component.spec.ts @@ -4,7 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DiskPowerLevel } from 'app/enums/disk-power-level.enum'; import { DiskStandby } from 'app/enums/disk-standby.enum'; import { Disk } from 'app/interfaces/disk.interface'; @@ -45,7 +45,7 @@ describe('DiskFormComponent', () => { mockProvider(SlideInRef), mockProvider(DialogService), mockProvider(SnackbarService), - mockWebSocket([ + mockApi([ mockCall('disk.update', dataDisk), ]), mockAuth(), diff --git a/src/app/pages/storage/modules/disks/components/disk-list/disk-list.component.spec.ts b/src/app/pages/storage/modules/disks/components/disk-list/disk-list.component.spec.ts index c504b8c486d..37aadaa69e3 100644 --- a/src/app/pages/storage/modules/disks/components/disk-list/disk-list.component.spec.ts +++ b/src/app/pages/storage/modules/disks/components/disk-list/disk-list.component.spec.ts @@ -7,7 +7,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { MockComponent } from 'ng-mocks'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { SmartTestResultPageType } from 'app/enums/smart-test-results-page-type.enum'; import { Choices } from 'app/interfaces/choices.interface'; import { Disk, DetailsDisk } from 'app/interfaces/disk.interface'; @@ -116,7 +116,7 @@ describe('DiskListComponent', () => { afterClosed: jest.fn(() => of(true)), })), }), - mockWebSocket([ + mockApi([ mockCall('disk.query', fakeDisks), mockCall('disk.details', { unused: [], used: fakeUnusedDisks }), mockCall('smart.test.disk_choices', fakeSmartDiskChoices), diff --git a/src/app/pages/storage/modules/disks/components/disk-wipe-dialog/disk-wipe-dialog.component.spec.ts b/src/app/pages/storage/modules/disks/components/disk-wipe-dialog/disk-wipe-dialog.component.spec.ts index c367834337a..b70672258a7 100644 --- a/src/app/pages/storage/modules/disks/components/disk-wipe-dialog/disk-wipe-dialog.component.spec.ts +++ b/src/app/pages/storage/modules/disks/components/disk-wipe-dialog/disk-wipe-dialog.component.spec.ts @@ -6,7 +6,7 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DiskWipeMethod } from 'app/enums/disk-wipe-method.enum'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; @@ -24,7 +24,7 @@ describe('DiskWipeDialogComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockJob('disk.wipe'), ]), mockProvider(DialogService, { diff --git a/src/app/pages/storage/modules/disks/components/manual-test-dialog/manual-test-dialog.component.spec.ts b/src/app/pages/storage/modules/disks/components/manual-test-dialog/manual-test-dialog.component.spec.ts index a4194cbc485..701b0cfc9ae 100644 --- a/src/app/pages/storage/modules/disks/components/manual-test-dialog/manual-test-dialog.component.spec.ts +++ b/src/app/pages/storage/modules/disks/components/manual-test-dialog/manual-test-dialog.component.spec.ts @@ -8,7 +8,7 @@ import { } from '@ngneat/spectator/jest'; import { FakeFormatDateTimePipe } from 'app/core/testing/classes/fake-format-datetime.pipe'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { SmartTestType } from 'app/enums/smart-test-type.enum'; import { Disk } from 'app/interfaces/disk.interface'; import { ManualSmartTest } from 'app/interfaces/smart-test.interface'; @@ -31,7 +31,7 @@ describe('ManualTestDialogComponent', () => { ], providers: [ mockProvider(DialogService), - mockWebSocket([ + mockApi([ mockCall('smart.test.manual_test', [ { disk: 'sda', expected_result_time: { $date: 1647438105 } }, { disk: 'sdb', error: 'Disk is on fire.' }, diff --git a/src/app/pages/storage/modules/disks/components/manual-test-dialog/test-progress-row/test-progress-row.component.spec.ts b/src/app/pages/storage/modules/disks/components/manual-test-dialog/test-progress-row/test-progress-row.component.spec.ts index 6332df1ffa8..bcb75c65ae9 100644 --- a/src/app/pages/storage/modules/disks/components/manual-test-dialog/test-progress-row/test-progress-row.component.spec.ts +++ b/src/app/pages/storage/modules/disks/components/manual-test-dialog/test-progress-row/test-progress-row.component.spec.ts @@ -2,7 +2,7 @@ import { MatProgressBar } from '@angular/material/progress-bar'; import { mockProvider, Spectator, createComponentFactory } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; -import { mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { IncomingApiMessageType } from 'app/enums/api-message-type.enum'; import { SmartTestType } from 'app/enums/smart-test-type.enum'; import { Disk } from 'app/interfaces/disk.interface'; @@ -29,7 +29,7 @@ describe('IxTestProgressRowComponent', () => { error: jest.fn(() => of(true)), }), mockProvider(ErrorHandlerService), - mockWebSocket(), + mockApi(), ], }); diff --git a/src/app/pages/storage/modules/disks/components/smart-test-result-list/smart-test-result-list.component.spec.ts b/src/app/pages/storage/modules/disks/components/smart-test-result-list/smart-test-result-list.component.spec.ts index 2a2449110fd..9d857633ec3 100644 --- a/src/app/pages/storage/modules/disks/components/smart-test-result-list/smart-test-result-list.component.spec.ts +++ b/src/app/pages/storage/modules/disks/components/smart-test-result-list/smart-test-result-list.component.spec.ts @@ -4,7 +4,7 @@ import { Spectator } from '@ngneat/spectator'; import { createComponentFactory } from '@ngneat/spectator/jest'; import { MockComponent } from 'ng-mocks'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; import { SmartTestResultStatus } from 'app/enums/smart-test-result-status.enum'; import { Disk } from 'app/interfaces/disk.interface'; import { SmartTestResults } from 'app/interfaces/smart-test.interface'; @@ -104,7 +104,7 @@ describe('SmartTestResultListComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('disk.query', disks), mockCall('smart.test.results', smartTestResults), mockCall('rsynctask.update'), diff --git a/src/app/pages/storage/modules/pool-manager/components/download-key-dialog/download-key-dialog.component.spec.ts b/src/app/pages/storage/modules/pool-manager/components/download-key-dialog/download-key-dialog.component.spec.ts index 8c0ce22faa1..37f35331d2d 100644 --- a/src/app/pages/storage/modules/pool-manager/components/download-key-dialog/download-key-dialog.component.spec.ts +++ b/src/app/pages/storage/modules/pool-manager/components/download-key-dialog/download-key-dialog.component.spec.ts @@ -4,7 +4,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { MAT_DIALOG_DATA } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of, throwError } from 'rxjs'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { AppLoaderService } from 'app/modules/loader/app-loader.service'; import { @@ -24,7 +24,7 @@ describe('DownloadKeyDialogComponent', () => { imports: [ ], providers: [ - mockWebSocket([ + mockApi([ mockCall('core.download', [null, 'http://localhost:8000/key.json']), ]), mockProvider(AppLoaderService, { diff --git a/src/app/pages/storage/modules/pool-manager/components/pool-manager-wizard/pool-manager-wizard.component.spec.ts b/src/app/pages/storage/modules/pool-manager/components/pool-manager-wizard/pool-manager-wizard.component.spec.ts index 600107e7f17..4f2c74186c2 100644 --- a/src/app/pages/storage/modules/pool-manager/components/pool-manager-wizard/pool-manager-wizard.component.spec.ts +++ b/src/app/pages/storage/modules/pool-manager/components/pool-manager-wizard/pool-manager-wizard.component.spec.ts @@ -9,7 +9,7 @@ import { provideMockStore } from '@ngrx/store/testing'; import { MockComponents } from 'ng-mocks'; import { BehaviorSubject, Subject, of } from 'rxjs'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { CreateVdevLayout, VdevType } from 'app/enums/v-dev-type.enum'; import { Pool } from 'app/interfaces/pool.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -120,7 +120,7 @@ describe('PoolManagerWizardComponent', () => { startOver$, isLoading$: of(false), }), - mockWebSocket([ + mockApi([ mockCall('pool.query', []), mockJob('pool.create', fakeSuccessfulJob(createdPool)), ]), diff --git a/src/app/pages/storage/modules/pool-manager/components/pool-manager-wizard/steps/1-general-wizard-step/general-wizard-step.component.spec.ts b/src/app/pages/storage/modules/pool-manager/components/pool-manager-wizard/steps/1-general-wizard-step/general-wizard-step.component.spec.ts index a14cec0673f..bab5105156a 100644 --- a/src/app/pages/storage/modules/pool-manager/components/pool-manager-wizard/steps/1-general-wizard-step/general-wizard-step.component.spec.ts +++ b/src/app/pages/storage/modules/pool-manager/components/pool-manager-wizard/steps/1-general-wizard-step/general-wizard-step.component.spec.ts @@ -4,7 +4,7 @@ import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { ReactiveFormsModule } from '@angular/forms'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of, Subject } from 'rxjs'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { helptextManager } from 'app/helptext/storage/volumes/manager/manager'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxCheckboxHarness } from 'app/modules/forms/ix-forms/components/ix-checkbox/ix-checkbox.harness'; @@ -32,7 +32,7 @@ describe('GeneralWizardStepComponent', () => { ], providers: [ CdkStepper, - mockWebSocket([ + mockApi([ mockCall('pool.query', []), mockCall('pool.validate_name', true), mockCall('pool.dataset.encryption_algorithm_choices', { diff --git a/src/app/pages/storage/modules/pool-manager/components/pool-manager/tests/add-vdev-to-pool.spec.ts b/src/app/pages/storage/modules/pool-manager/components/pool-manager/tests/add-vdev-to-pool.spec.ts index 7d405786042..b1dab6cba39 100644 --- a/src/app/pages/storage/modules/pool-manager/components/pool-manager/tests/add-vdev-to-pool.spec.ts +++ b/src/app/pages/storage/modules/pool-manager/components/pool-manager/tests/add-vdev-to-pool.spec.ts @@ -5,7 +5,7 @@ import { of } from 'rxjs'; import { GiB } from 'app/constants/bytes.constant'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DiskType } from 'app/enums/disk-type.enum'; import { TopologyItemType } from 'app/enums/v-dev-type.enum'; import { DetailsDisk } from 'app/interfaces/disk.interface'; @@ -35,7 +35,7 @@ describe('AddVdevsComponent – Add Vdev to existing pool', () => { ], componentProviders: [ ...commonProviders, - mockWebSocket([ + mockApi([ mockCall('pool.validate_name', true), mockCall('disk.details', { used: [ diff --git a/src/app/pages/storage/modules/pool-manager/components/pool-manager/tests/create-pool.spec.ts b/src/app/pages/storage/modules/pool-manager/components/pool-manager/tests/create-pool.spec.ts index 11c6b21338f..a08d41d0ae6 100644 --- a/src/app/pages/storage/modules/pool-manager/components/pool-manager/tests/create-pool.spec.ts +++ b/src/app/pages/storage/modules/pool-manager/components/pool-manager/tests/create-pool.spec.ts @@ -5,7 +5,7 @@ import { of } from 'rxjs'; import { GiB } from 'app/constants/bytes.constant'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DiskType } from 'app/enums/disk-type.enum'; import { DetailsDisk } from 'app/interfaces/disk.interface'; import { Enclosure } from 'app/interfaces/enclosure.interface'; @@ -32,7 +32,7 @@ describe('PoolManagerComponent – create pool', () => { ], providers: [ ...commonProviders, - mockWebSocket([ + mockApi([ mockCall('pool.validate_name', true), mockCall('disk.details', { used: [ diff --git a/src/app/pages/storage/modules/pool-manager/components/pool-manager/tests/draid-pool-creation.spec.ts b/src/app/pages/storage/modules/pool-manager/components/pool-manager/tests/draid-pool-creation.spec.ts index c70e9a63052..04e9d9d7129 100644 --- a/src/app/pages/storage/modules/pool-manager/components/pool-manager/tests/draid-pool-creation.spec.ts +++ b/src/app/pages/storage/modules/pool-manager/components/pool-manager/tests/draid-pool-creation.spec.ts @@ -5,7 +5,7 @@ import { of } from 'rxjs'; import { GiB } from 'app/constants/bytes.constant'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DiskType } from 'app/enums/disk-type.enum'; import { CreateVdevLayout } from 'app/enums/v-dev-type.enum'; import { DetailsDisk } from 'app/interfaces/disk.interface'; @@ -34,7 +34,7 @@ describe('PoolManagerComponent – creating dRAID pool', () => { ], providers: [ ...commonProviders, - mockWebSocket([ + mockApi([ mockCall('pool.validate_name', true), mockCall('disk.details', { used: [ diff --git a/src/app/pages/storage/modules/pool-manager/components/pool-manager/tests/step-changing.spec.ts b/src/app/pages/storage/modules/pool-manager/components/pool-manager/tests/step-changing.spec.ts index 4640387466b..39d406491ed 100644 --- a/src/app/pages/storage/modules/pool-manager/components/pool-manager/tests/step-changing.spec.ts +++ b/src/app/pages/storage/modules/pool-manager/components/pool-manager/tests/step-changing.spec.ts @@ -4,7 +4,7 @@ import { of } from 'rxjs'; import { GiB } from 'app/constants/bytes.constant'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DiskType } from 'app/enums/disk-type.enum'; import { VdevType } from 'app/enums/v-dev-type.enum'; import { DetailsDisk } from 'app/interfaces/disk.interface'; @@ -33,7 +33,7 @@ describe('PoolManagerComponent – step changing', () => { ], componentProviders: [ ...commonProviders, - mockWebSocket([ + mockApi([ mockCall('pool.validate_name', true), mockCall('disk.details', { used: [ diff --git a/src/app/pages/storage/modules/pool-manager/components/pool-manager/tests/unsetting-on-fewer-disks.spec.ts b/src/app/pages/storage/modules/pool-manager/components/pool-manager/tests/unsetting-on-fewer-disks.spec.ts index de504b408d6..322794855fb 100644 --- a/src/app/pages/storage/modules/pool-manager/components/pool-manager/tests/unsetting-on-fewer-disks.spec.ts +++ b/src/app/pages/storage/modules/pool-manager/components/pool-manager/tests/unsetting-on-fewer-disks.spec.ts @@ -4,7 +4,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { of } from 'rxjs'; import { GiB } from 'app/constants/bytes.constant'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DiskType } from 'app/enums/disk-type.enum'; import { DetailsDisk } from 'app/interfaces/disk.interface'; import { Enclosure } from 'app/interfaces/enclosure.interface'; @@ -31,7 +31,7 @@ describe('PoolManagerComponent – unsetting on fewer disks', () => { ], providers: [ ...commonProviders, - mockWebSocket([ + mockApi([ mockCall('pool.validate_name', true), mockCall('disk.details', { used: [ diff --git a/src/app/pages/storage/modules/pool-manager/components/pool-manager/tests/wizard-reset-step.spec.ts b/src/app/pages/storage/modules/pool-manager/components/pool-manager/tests/wizard-reset-step.spec.ts index 51317a90ca9..61e284702b6 100644 --- a/src/app/pages/storage/modules/pool-manager/components/pool-manager/tests/wizard-reset-step.spec.ts +++ b/src/app/pages/storage/modules/pool-manager/components/pool-manager/tests/wizard-reset-step.spec.ts @@ -4,7 +4,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { of } from 'rxjs'; import { GiB } from 'app/constants/bytes.constant'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DiskType } from 'app/enums/disk-type.enum'; import { DetailsDisk } from 'app/interfaces/disk.interface'; import { Enclosure } from 'app/interfaces/enclosure.interface'; @@ -31,7 +31,7 @@ describe('PoolManagerComponent – wizard step reset', () => { ], componentProviders: [ ...commonProviders, - mockWebSocket([ + mockApi([ mockCall('pool.validate_name', true), // TODO: see if all disk.details calls from multiple files can be extracted somewhere. mockCall('disk.details', { diff --git a/src/app/pages/storage/modules/pool-manager/components/pool-manager/tests/wizard-start-over.spec.ts b/src/app/pages/storage/modules/pool-manager/components/pool-manager/tests/wizard-start-over.spec.ts index df8e364d26a..1e05c2e0275 100644 --- a/src/app/pages/storage/modules/pool-manager/components/pool-manager/tests/wizard-start-over.spec.ts +++ b/src/app/pages/storage/modules/pool-manager/components/pool-manager/tests/wizard-start-over.spec.ts @@ -3,7 +3,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { of } from 'rxjs'; import { GiB } from 'app/constants/bytes.constant'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DiskType } from 'app/enums/disk-type.enum'; import { DetailsDisk } from 'app/interfaces/disk.interface'; import { Enclosure } from 'app/interfaces/enclosure.interface'; @@ -31,7 +31,7 @@ describe('PoolManagerComponent – start over functionality', () => { ], providers: [ ...commonProviders, - mockWebSocket([ + mockApi([ mockCall('pool.validate_name', true), mockCall('disk.details', { used: [ diff --git a/src/app/pages/storage/modules/pool-manager/store/pool-manager.store.spec.ts b/src/app/pages/storage/modules/pool-manager/store/pool-manager.store.spec.ts index 7226dbc9290..75b6d9dc4e0 100644 --- a/src/app/pages/storage/modules/pool-manager/store/pool-manager.store.spec.ts +++ b/src/app/pages/storage/modules/pool-manager/store/pool-manager.store.spec.ts @@ -4,7 +4,7 @@ import { BehaviorSubject, firstValueFrom, of, } from 'rxjs'; import { TiB } from 'app/constants/bytes.constant'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DiskType } from 'app/enums/disk-type.enum'; import { CreateVdevLayout, VdevType } from 'app/enums/v-dev-type.enum'; import { DetailsDisk } from 'app/interfaces/disk.interface'; @@ -61,7 +61,7 @@ describe('PoolManagerStore', () => { const createService = createServiceFactory({ service: PoolManagerStore, providers: [ - mockWebSocket([ + mockApi([ mockCall('enclosure2.query', enclosures), ]), mockProvider(DiskStore, { diff --git a/src/app/pages/system-tasks/config-reset/config-reset.component.spec.ts b/src/app/pages/system-tasks/config-reset/config-reset.component.spec.ts index 28fd49c8ad7..4ae78d21a49 100644 --- a/src/app/pages/system-tasks/config-reset/config-reset.component.spec.ts +++ b/src/app/pages/system-tasks/config-reset/config-reset.component.spec.ts @@ -6,7 +6,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { MockComponent } from 'ng-mocks'; import { BehaviorSubject, of } from 'rxjs'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; -import { mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxIconComponent } from 'app/modules/ix-icon/ix-icon.component'; import { CopyrightLineComponent } from 'app/modules/layout/copyright-line/copyright-line.component'; @@ -25,7 +25,7 @@ describe('ConfigResetComponent', () => { MockComponent(CopyrightLineComponent), ], providers: [ - mockWebSocket([ + mockApi([ mockJob('config.reset', fakeSuccessfulJob()), ]), mockProvider(MatDialog), diff --git a/src/app/pages/system/advanced/access/access-card/access-card.component.spec.ts b/src/app/pages/system/advanced/access/access-card/access-card.component.spec.ts index 170b40b10d1..b58c660cb3f 100644 --- a/src/app/pages/system/advanced/access/access-card/access-card.component.spec.ts +++ b/src/app/pages/system/advanced/access/access-card/access-card.component.spec.ts @@ -7,7 +7,7 @@ import { provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { FakeFormatDateTimePipe } from 'app/core/testing/classes/fake-format-datetime.pipe'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { CredentialType } from 'app/interfaces/credential-type.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxIconHarness } from 'app/modules/ix-icon/ix-icon.harness'; @@ -60,7 +60,7 @@ describe('AccessCardComponent', () => { mockProvider(LocaleService, { timezone: 'America/Los_Angeles', }), - mockWebSocket([ + mockApi([ mockCall('auth.sessions', sessions), mockCall('auth.terminate_session'), mockCall('auth.terminate_other_sessions'), diff --git a/src/app/pages/system/advanced/access/access-form/access-form.component.spec.ts b/src/app/pages/system/advanced/access/access-form/access-form.component.spec.ts index 4aef901e44d..9d4514d05bf 100644 --- a/src/app/pages/system/advanced/access/access-form/access-form.component.spec.ts +++ b/src/app/pages/system/advanced/access/access-form/access-form.component.spec.ts @@ -7,7 +7,7 @@ import { Store } from '@ngrx/store'; import { provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { mockWindow } from 'app/core/testing/utils/mock-window.utils'; import { Preferences } from 'app/interfaces/preferences.interface'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; @@ -39,7 +39,7 @@ describe('AccessFormComponent', () => { setItem: jest.fn, }, }), - mockWebSocket([ + mockApi([ mockCall('system.general.update'), mockCall('system.advanced.update'), ]), diff --git a/src/app/pages/system/advanced/advanced-settings.component.spec.ts b/src/app/pages/system/advanced/advanced-settings.component.spec.ts index a6f17c3a058..0390b81f51b 100644 --- a/src/app/pages/system/advanced/advanced-settings.component.spec.ts +++ b/src/app/pages/system/advanced/advanced-settings.component.spec.ts @@ -1,7 +1,7 @@ import { createComponentFactory, Spectator } from '@ngneat/spectator/jest'; import { MockComponent, MockComponents } from 'ng-mocks'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { SearchInput1Component } from 'app/modules/forms/search-input1/search-input1.component'; import { PageHeaderComponent } from 'app/modules/page-header/page-title-header/page-header.component'; import { AccessCardComponent } from 'app/pages/system/advanced/access/access-card/access-card.component'; @@ -59,7 +59,7 @@ describe('AdvancedSettingsComponent', () => { ), ], providers: [ - mockWebSocket([ + mockApi([ mockCall('system.security.info.fips_available', true), ]), mockAuth(), diff --git a/src/app/pages/system/advanced/allowed-addresses/allowed-addresses-card/allowed-addresses-card.component.spec.ts b/src/app/pages/system/advanced/allowed-addresses/allowed-addresses-card/allowed-addresses-card.component.spec.ts index 3a44ecf11ef..d2fde63c8c8 100644 --- a/src/app/pages/system/advanced/allowed-addresses/allowed-addresses-card/allowed-addresses-card.component.spec.ts +++ b/src/app/pages/system/advanced/allowed-addresses/allowed-addresses-card/allowed-addresses-card.component.spec.ts @@ -5,7 +5,7 @@ import { Spectator } from '@ngneat/spectator'; import { createComponentFactory, mockProvider } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { SystemGeneralConfig } from 'app/interfaces/system-config.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxIconHarness } from 'app/modules/ix-icon/ix-icon.harness'; @@ -39,7 +39,7 @@ describe('AllowedAddressesCardComponent', () => { mockProvider(AdvancedSettingsService, { showFirstTimeWarningIfNeeded: jest.fn(() => of(true)), }), - mockWebSocket([ + mockApi([ mockCall('system.general.config', config), mockCall('system.general.update'), ]), diff --git a/src/app/pages/system/advanced/allowed-addresses/allowed-addresses-form/allowed-addresses-form.component.spec.ts b/src/app/pages/system/advanced/allowed-addresses/allowed-addresses-form/allowed-addresses-form.component.spec.ts index d73a6053370..68e8e84dc16 100644 --- a/src/app/pages/system/advanced/allowed-addresses/allowed-addresses-form/allowed-addresses-form.component.spec.ts +++ b/src/app/pages/system/advanced/allowed-addresses/allowed-addresses-form/allowed-addresses-form.component.spec.ts @@ -8,7 +8,7 @@ import { import { provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { SystemGeneralConfig } from 'app/interfaces/system-config.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; @@ -28,7 +28,7 @@ describe('AllowedAddressesComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('system.general.update'), mockCall('system.general.ui_restart'), mockCall('system.general.config', { diff --git a/src/app/pages/system/advanced/audit/audit-card/audit-card.component.spec.ts b/src/app/pages/system/advanced/audit/audit-card/audit-card.component.spec.ts index 4f33db5ea03..00a1f577d00 100644 --- a/src/app/pages/system/advanced/audit/audit-card/audit-card.component.spec.ts +++ b/src/app/pages/system/advanced/audit/audit-card/audit-card.component.spec.ts @@ -5,7 +5,7 @@ import { MatListItemHarness } from '@angular/material/list/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { AdvancedSettingsService } from 'app/pages/system/advanced/advanced-settings.service'; import { AuditCardComponent } from 'app/pages/system/advanced/audit/audit-card/audit-card.component'; import { AuditFormComponent } from 'app/pages/system/advanced/audit/audit-form/audit-form.component'; @@ -24,7 +24,7 @@ describe('AuditCardComponent', () => { mockProvider(AdvancedSettingsService, { showFirstTimeWarningIfNeeded: jest.fn(() => of(true)), }), - mockWebSocket([ + mockApi([ mockCall('audit.config', { retention: 30, reservation: 100, diff --git a/src/app/pages/system/advanced/audit/audit-form/audit-form.component.spec.ts b/src/app/pages/system/advanced/audit/audit-form/audit-form.component.spec.ts index e98a029ffe0..faa1bd24fbb 100644 --- a/src/app/pages/system/advanced/audit/audit-form/audit-form.component.spec.ts +++ b/src/app/pages/system/advanced/audit/audit-form/audit-form.component.spec.ts @@ -6,7 +6,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { AuditConfig } from 'app/interfaces/audit/audit.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; @@ -25,7 +25,7 @@ describe('AuditFormComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('audit.config', { retention: 30, reservation: 100, diff --git a/src/app/pages/system/advanced/console/console-form/console-form.component.spec.ts b/src/app/pages/system/advanced/console/console-form/console-form.component.spec.ts index ff304bfcf43..b0c0285ff51 100644 --- a/src/app/pages/system/advanced/console/console-form/console-form.component.spec.ts +++ b/src/app/pages/system/advanced/console/console-form/console-form.component.spec.ts @@ -8,7 +8,7 @@ import { import { provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { AdvancedConfig } from 'app/interfaces/advanced-config.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxCheckboxHarness } from 'app/modules/forms/ix-forms/components/ix-checkbox/ix-checkbox.harness'; @@ -32,7 +32,7 @@ describe('ConsoleFormComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('system.advanced.serial_port_choices', { ttyS0: 'ttyS0', ttyS1: 'ttyS1', diff --git a/src/app/pages/system/advanced/cron/cron-card/cron-card.component.spec.ts b/src/app/pages/system/advanced/cron/cron-card/cron-card.component.spec.ts index d87b0c05b26..f0b707f4af7 100644 --- a/src/app/pages/system/advanced/cron/cron-card/cron-card.component.spec.ts +++ b/src/app/pages/system/advanced/cron/cron-card/cron-card.component.spec.ts @@ -7,7 +7,7 @@ import { provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { invalidDate } from 'app/constants/invalid-date'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxIconHarness } from 'app/modules/ix-icon/ix-icon.harness'; import { IxTableHarness } from 'app/modules/ix-table/components/ix-table/ix-table.harness'; @@ -59,7 +59,7 @@ describe('CronCardComponent', () => { }, ], }), - mockWebSocket([ + mockApi([ mockCall('cronjob.query', cronJobs), mockCall('cronjob.run'), ]), diff --git a/src/app/pages/system/advanced/cron/cron-form/cron-form.component.spec.ts b/src/app/pages/system/advanced/cron/cron-form/cron-form.component.spec.ts index 596f8ecc856..0db00291d92 100644 --- a/src/app/pages/system/advanced/cron/cron-form/cron-form.component.spec.ts +++ b/src/app/pages/system/advanced/cron/cron-form/cron-form.component.spec.ts @@ -6,7 +6,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { Cronjob } from 'app/interfaces/cronjob.interface'; import { User } from 'app/interfaces/user.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -55,7 +55,7 @@ describe('CronFormComponent', () => { timezone: 'America/New_York', }), mockProvider(DialogService), - mockWebSocket([ + mockApi([ mockCall('cronjob.create'), mockCall('cronjob.update'), ]), diff --git a/src/app/pages/system/advanced/cron/cron-list/cron-list.component.spec.ts b/src/app/pages/system/advanced/cron/cron-list/cron-list.component.spec.ts index 17b0fe6fad9..2ee219e06b5 100644 --- a/src/app/pages/system/advanced/cron/cron-list/cron-list.component.spec.ts +++ b/src/app/pages/system/advanced/cron/cron-list/cron-list.component.spec.ts @@ -8,7 +8,7 @@ import { provideMockStore } from '@ngrx/store/testing'; import { MockComponent } from 'ng-mocks'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { SearchInput1Component } from 'app/modules/forms/search-input1/search-input1.component'; import { IxTableHarness } from 'app/modules/ix-table/components/ix-table/ix-table.harness'; @@ -72,7 +72,7 @@ describe('CronListComponent', () => { }, ], }), - mockWebSocket([ + mockApi([ mockCall('cronjob.query', cronJobs), mockCall('cronjob.run'), ]), diff --git a/src/app/pages/system/advanced/global-two-factor-auth/global-two-factor-card/global-two-factor-card.component.spec.ts b/src/app/pages/system/advanced/global-two-factor-auth/global-two-factor-card/global-two-factor-card.component.spec.ts index 1336e333c37..9c897987d16 100644 --- a/src/app/pages/system/advanced/global-two-factor-auth/global-two-factor-card/global-two-factor-card.component.spec.ts +++ b/src/app/pages/system/advanced/global-two-factor-auth/global-two-factor-card/global-two-factor-card.component.spec.ts @@ -5,7 +5,7 @@ import { MatListItemHarness } from '@angular/material/list/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { GlobalTwoFactorConfig } from 'app/interfaces/two-factor-config.interface'; import { AdvancedSettingsService } from 'app/pages/system/advanced/advanced-settings.service'; import { GlobalTwoFactorAuthCardComponent } from 'app/pages/system/advanced/global-two-factor-auth/global-two-factor-card/global-two-factor-card.component'; @@ -25,7 +25,7 @@ describe('GlobalTwoFactorAuthCardComponent', () => { mockProvider(AdvancedSettingsService, { showFirstTimeWarningIfNeeded: jest.fn(() => of(true)), }), - mockWebSocket([ + mockApi([ mockCall('auth.twofactor.config', { window: 3, enabled: false, diff --git a/src/app/pages/system/advanced/init-shutdown/init-shutdown-card/init-shutdown-card.component.spec.ts b/src/app/pages/system/advanced/init-shutdown/init-shutdown-card/init-shutdown-card.component.spec.ts index ed7b7145337..8f46cf8ab0e 100644 --- a/src/app/pages/system/advanced/init-shutdown/init-shutdown-card/init-shutdown-card.component.spec.ts +++ b/src/app/pages/system/advanced/init-shutdown/init-shutdown-card/init-shutdown-card.component.spec.ts @@ -4,7 +4,7 @@ import { Spectator } from '@ngneat/spectator'; import { createComponentFactory, mockProvider } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { InitShutdownScriptType } from 'app/enums/init-shutdown-script-type.enum'; import { InitShutdownScriptWhen } from 'app/enums/init-shutdown-script-when.enum'; import { InitShutdownScript } from 'app/interfaces/init-shutdown-script.interface'; @@ -54,7 +54,7 @@ describe('InitShutdownCardComponent', () => { imports: [ ], providers: [ - mockWebSocket([ + mockApi([ mockCall('initshutdownscript.query', scripts), mockCall('initshutdownscript.delete'), ]), diff --git a/src/app/pages/system/advanced/init-shutdown/init-shutdown-form/init-shutdown-form.component.spec.ts b/src/app/pages/system/advanced/init-shutdown/init-shutdown-form/init-shutdown-form.component.spec.ts index 5be12c50a6d..bd0a97eb68f 100644 --- a/src/app/pages/system/advanced/init-shutdown/init-shutdown-form/init-shutdown-form.component.spec.ts +++ b/src/app/pages/system/advanced/init-shutdown/init-shutdown-form/init-shutdown-form.component.spec.ts @@ -7,7 +7,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { of } from 'rxjs'; import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { InitShutdownScriptType } from 'app/enums/init-shutdown-script-type.enum'; import { InitShutdownScriptWhen } from 'app/enums/init-shutdown-script-when.enum'; import { InitShutdownScript } from 'app/interfaces/init-shutdown-script.interface'; @@ -30,7 +30,7 @@ describe('InitShutdownFormComponent', () => { TreeModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('initshutdownscript.create'), mockCall('initshutdownscript.update'), ]), diff --git a/src/app/pages/system/advanced/init-shutdown/init-shutdown-list/init-shutdown-list.component.spec.ts b/src/app/pages/system/advanced/init-shutdown/init-shutdown-list/init-shutdown-list.component.spec.ts index 4e8e65b06eb..82b02880b34 100644 --- a/src/app/pages/system/advanced/init-shutdown/init-shutdown-list/init-shutdown-list.component.spec.ts +++ b/src/app/pages/system/advanced/init-shutdown/init-shutdown-list/init-shutdown-list.component.spec.ts @@ -3,7 +3,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { MockComponent } from 'ng-mocks'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { InitShutdownScriptType } from 'app/enums/init-shutdown-script-type.enum'; import { InitShutdownScriptWhen } from 'app/enums/init-shutdown-script-when.enum'; import { InitShutdownScript } from 'app/interfaces/init-shutdown-script.interface'; @@ -50,7 +50,7 @@ describe('InitShutdownListComponent', () => { SearchInput1Component, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('initshutdownscript.query', scripts), mockCall('initshutdownscript.delete'), ]), diff --git a/src/app/pages/system/advanced/isolated-gpus/isolated-gpus-form/isolated-gpus-form.component.spec.ts b/src/app/pages/system/advanced/isolated-gpus/isolated-gpus-form/isolated-gpus-form.component.spec.ts index aeeec91d360..aef207a3bdc 100644 --- a/src/app/pages/system/advanced/isolated-gpus/isolated-gpus-form/isolated-gpus-form.component.spec.ts +++ b/src/app/pages/system/advanced/isolated-gpus/isolated-gpus-form/isolated-gpus-form.component.spec.ts @@ -6,7 +6,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { AdvancedConfig } from 'app/interfaces/advanced-config.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { FormErrorHandlerService } from 'app/modules/forms/ix-forms/services/form-error-handler.service'; @@ -41,7 +41,7 @@ describe('IsolatedGpuPcisFormComponent', () => { }, ], }), - mockWebSocket([ + mockApi([ mockCall('system.advanced.update_gpu_pci_ids'), mockCall('system.advanced.get_gpu_pci_choices', { 'Fake HD Graphics [0000:00:01.0]': '0000:00:01.0', diff --git a/src/app/pages/system/advanced/kernel/kernel-form/kernel-form.component.spec.ts b/src/app/pages/system/advanced/kernel/kernel-form/kernel-form.component.spec.ts index 1eb790c89cf..aba02c93c9a 100644 --- a/src/app/pages/system/advanced/kernel/kernel-form/kernel-form.component.spec.ts +++ b/src/app/pages/system/advanced/kernel/kernel-form/kernel-form.component.spec.ts @@ -6,7 +6,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; import { ChainedRef } from 'app/modules/slide-ins/chained-component-ref'; import { KernelFormComponent } from 'app/pages/system/advanced/kernel/kernel-form/kernel-form.component'; @@ -23,7 +23,7 @@ describe('KernelFormComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('system.advanced.update'), ]), mockProvider(ChainedSlideInService, { diff --git a/src/app/pages/system/advanced/replication/replication-settings-card/replication-settings-card.component.spec.ts b/src/app/pages/system/advanced/replication/replication-settings-card/replication-settings-card.component.spec.ts index 203cbf10d8d..281b4ae205d 100644 --- a/src/app/pages/system/advanced/replication/replication-settings-card/replication-settings-card.component.spec.ts +++ b/src/app/pages/system/advanced/replication/replication-settings-card/replication-settings-card.component.spec.ts @@ -5,7 +5,7 @@ import { MatListItemHarness } from '@angular/material/list/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { ChainedRef } from 'app/modules/slide-ins/chained-component-ref'; import { AdvancedSettingsService } from 'app/pages/system/advanced/advanced-settings.service'; import { @@ -23,7 +23,7 @@ describe('ReplicationSettingsCardComponent', () => { component: ReplicationSettingsCardComponent, providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('replication.config.config', { max_parallel_replication_tasks: 5, }), diff --git a/src/app/pages/system/advanced/replication/replication-settings-form/replication-settings-form.component.spec.ts b/src/app/pages/system/advanced/replication/replication-settings-form/replication-settings-form.component.spec.ts index 20d0e57de71..40c834de441 100644 --- a/src/app/pages/system/advanced/replication/replication-settings-form/replication-settings-form.component.spec.ts +++ b/src/app/pages/system/advanced/replication/replication-settings-form/replication-settings-form.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; import { ChainedRef } from 'app/modules/slide-ins/chained-component-ref'; @@ -24,7 +24,7 @@ describe('ReplicationSettingsFormComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('replication.config.update'), ]), mockProvider(ChainedRef, { close: jest.fn(), getData: jest.fn(() => ({ max_parallel_replication_tasks: 1 })) }), diff --git a/src/app/pages/system/advanced/save-debug-button/save-debug-button.component.spec.ts b/src/app/pages/system/advanced/save-debug-button/save-debug-button.component.spec.ts index 7e52a2a5aa8..58d0f63fbcc 100644 --- a/src/app/pages/system/advanced/save-debug-button/save-debug-button.component.spec.ts +++ b/src/app/pages/system/advanced/save-debug-button/save-debug-button.component.spec.ts @@ -7,7 +7,7 @@ import { provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { SystemInfo } from 'app/interfaces/system-info.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { selectJob } from 'app/modules/jobs/store/job.selectors'; @@ -21,7 +21,7 @@ describe('SaveDebugButtonComponent', () => { const createComponent = createComponentFactory({ component: SaveDebugButtonComponent, providers: [ - mockWebSocket([ + mockApi([ mockCall('core.download', [45, 'http://localhost/download/url']), ]), mockProvider(DialogService, { diff --git a/src/app/pages/system/advanced/self-encrypting-drive/self-encrypting-drive-card/self-encrypting-drive-card.component.spec.ts b/src/app/pages/system/advanced/self-encrypting-drive/self-encrypting-drive-card/self-encrypting-drive-card.component.spec.ts index 56da61aa5f8..ff80f995a3f 100644 --- a/src/app/pages/system/advanced/self-encrypting-drive/self-encrypting-drive-card/self-encrypting-drive-card.component.spec.ts +++ b/src/app/pages/system/advanced/self-encrypting-drive/self-encrypting-drive-card/self-encrypting-drive-card.component.spec.ts @@ -6,7 +6,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { AdvancedSettingsService } from 'app/pages/system/advanced/advanced-settings.service'; import { SelfEncryptingDriveCardComponent, @@ -24,7 +24,7 @@ describe('SelfEncryptingDriveCardComponent', () => { component: SelfEncryptingDriveCardComponent, providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('system.advanced.sed_global_password', '12345678'), ]), provideMockStore({ diff --git a/src/app/pages/system/advanced/self-encrypting-drive/self-encrypting-drive-form/self-encrypting-drive-form.component.spec.ts b/src/app/pages/system/advanced/self-encrypting-drive/self-encrypting-drive-form/self-encrypting-drive-form.component.spec.ts index 7e83527ec97..75a76bb95e3 100644 --- a/src/app/pages/system/advanced/self-encrypting-drive/self-encrypting-drive-form/self-encrypting-drive-form.component.spec.ts +++ b/src/app/pages/system/advanced/self-encrypting-drive/self-encrypting-drive-form/self-encrypting-drive-form.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { SedUser } from 'app/enums/sed-user.enum'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; import { ChainedRef } from 'app/modules/slide-ins/chained-component-ref'; @@ -23,7 +23,7 @@ describe('SedFormComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('system.advanced.update'), mockCall('system.advanced.sed_global_password', '123'), ]), diff --git a/src/app/pages/system/advanced/storage/storage-card/storage-card.component.spec.ts b/src/app/pages/system/advanced/storage/storage-card/storage-card.component.spec.ts index 1aac4299f79..3040eded4ae 100644 --- a/src/app/pages/system/advanced/storage/storage-card/storage-card.component.spec.ts +++ b/src/app/pages/system/advanced/storage/storage-card/storage-card.component.spec.ts @@ -5,7 +5,7 @@ import { MatListItemHarness } from '@angular/material/list/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { SystemDatasetConfig } from 'app/interfaces/system-dataset-config.interface'; import { AdvancedSettingsService } from 'app/pages/system/advanced/advanced-settings.service'; import { StorageCardComponent } from 'app/pages/system/advanced/storage/storage-card/storage-card.component'; @@ -21,7 +21,7 @@ describe('StorageCardComponent', () => { component: StorageCardComponent, providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('systemdataset.config', { pool: 'tank', } as SystemDatasetConfig), diff --git a/src/app/pages/system/advanced/storage/storage-settings-form/storage-settings-form.component.spec.ts b/src/app/pages/system/advanced/storage/storage-settings-form/storage-settings-form.component.spec.ts index bf07cde7652..44966731c15 100644 --- a/src/app/pages/system/advanced/storage/storage-settings-form/storage-settings-form.component.spec.ts +++ b/src/app/pages/system/advanced/storage/storage-settings-form/storage-settings-form.component.spec.ts @@ -8,7 +8,7 @@ import { of } from 'rxjs'; import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { ServiceName } from 'app/enums/service-name.enum'; import { ServiceStatus } from 'app/enums/service-status.enum'; import { Service } from 'app/interfaces/service.interface'; @@ -31,7 +31,7 @@ describe('StorageSettingsFormComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('systemdataset.pool_choices', { 'current-pool': 'current-pool', 'new-pool': 'new-pool', diff --git a/src/app/pages/system/advanced/sysctl/sysctl-card/sysctl-card.component.spec.ts b/src/app/pages/system/advanced/sysctl/sysctl-card/sysctl-card.component.spec.ts index c4899a20974..29fcd65945a 100644 --- a/src/app/pages/system/advanced/sysctl/sysctl-card/sysctl-card.component.spec.ts +++ b/src/app/pages/system/advanced/sysctl/sysctl-card/sysctl-card.component.spec.ts @@ -5,7 +5,7 @@ import { createComponentFactory, mockProvider } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { Tunable } from 'app/interfaces/tunable.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxIconHarness } from 'app/modules/ix-icon/ix-icon.harness'; @@ -44,7 +44,7 @@ describe('SysctlCardComponent', () => { imports: [ ], providers: [ - mockWebSocket([ + mockApi([ mockCall('tunable.query', items), mockJob('tunable.delete', fakeSuccessfulJob()), ]), diff --git a/src/app/pages/system/advanced/sysctl/tunable-form/tunable-form.component.spec.ts b/src/app/pages/system/advanced/sysctl/tunable-form/tunable-form.component.spec.ts index 2398347c381..725f0bad3f0 100644 --- a/src/app/pages/system/advanced/sysctl/tunable-form/tunable-form.component.spec.ts +++ b/src/app/pages/system/advanced/sysctl/tunable-form/tunable-form.component.spec.ts @@ -6,7 +6,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { of } from 'rxjs'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { TunableType } from 'app/enums/tunable-type.enum'; import { Tunable } from 'app/interfaces/tunable.interface'; import { FormErrorHandlerService } from 'app/modules/forms/ix-forms/services/form-error-handler.service'; @@ -26,7 +26,7 @@ describe('TunableFormComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockJob('tunable.create', fakeSuccessfulJob()), mockJob('tunable.update', fakeSuccessfulJob()), ]), diff --git a/src/app/pages/system/advanced/sysctl/tunable-list/tunable-list.component.spec.ts b/src/app/pages/system/advanced/sysctl/tunable-list/tunable-list.component.spec.ts index 3e01e55f725..8cd8f671de4 100644 --- a/src/app/pages/system/advanced/sysctl/tunable-list/tunable-list.component.spec.ts +++ b/src/app/pages/system/advanced/sysctl/tunable-list/tunable-list.component.spec.ts @@ -8,7 +8,7 @@ import { of } from 'rxjs'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; import { - mockWebSocket, mockCall, mockJob, + mockApi, mockCall, mockJob, } from 'app/core/testing/utils/mock-websocket.utils'; import { Tunable } from 'app/interfaces/tunable.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -117,7 +117,7 @@ describe('TunableListComponent', () => { afterClosed: of(null), })), }), - mockWebSocket([ + mockApi([ mockCall('core.get_jobs'), mockCall('tunable.query', tunables), mockJob('tunable.delete', fakeSuccessfulJob()), diff --git a/src/app/pages/system/advanced/syslog/syslog-form/syslog-form.component.spec.ts b/src/app/pages/system/advanced/syslog/syslog-form/syslog-form.component.spec.ts index 5bd64f43ee7..75cefbfe809 100644 --- a/src/app/pages/system/advanced/syslog/syslog-form/syslog-form.component.spec.ts +++ b/src/app/pages/system/advanced/syslog/syslog-form/syslog-form.component.spec.ts @@ -6,7 +6,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { SyslogLevel, SyslogTransport } from 'app/enums/syslog.enum'; import { AdvancedConfig } from 'app/interfaces/advanced-config.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -26,7 +26,7 @@ describe('SyslogFormComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('system.advanced.config', { fqdn_syslog: true, sysloglevel: SyslogLevel.Error, diff --git a/src/app/pages/system/advanced/system-security/system-security-card/system-security-card.component.spec.ts b/src/app/pages/system/advanced/system-security/system-security-card/system-security-card.component.spec.ts index d75af0dc514..58fccca8d9c 100644 --- a/src/app/pages/system/advanced/system-security/system-security-card/system-security-card.component.spec.ts +++ b/src/app/pages/system/advanced/system-security/system-security-card/system-security-card.component.spec.ts @@ -5,7 +5,7 @@ import { MatListItemHarness } from '@angular/material/list/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { SystemSecurityConfig } from 'app/interfaces/system-security-config.interface'; import { SystemSecurityCardComponent } from 'app/pages/system/advanced/system-security/system-security-card/system-security-card.component'; import { SystemSecurityFormComponent } from 'app/pages/system/advanced/system-security/system-security-form/system-security-form.component'; @@ -22,7 +22,7 @@ describe('SystemSecurityCardComponent', () => { component: SystemSecurityCardComponent, providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('system.security.config', fakeSystemSecurityConfig), ]), mockProvider(ChainedSlideInService, { diff --git a/src/app/pages/system/advanced/system-security/system-security-form/system-security-form.component.spec.ts b/src/app/pages/system/advanced/system-security/system-security-form/system-security-form.component.spec.ts index bffde141b7a..4acf9d2da34 100644 --- a/src/app/pages/system/advanced/system-security/system-security-form/system-security-form.component.spec.ts +++ b/src/app/pages/system/advanced/system-security/system-security-form/system-security-form.component.spec.ts @@ -7,7 +7,7 @@ import { MockStore, provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { ProductType } from 'app/enums/product-type.enum'; import { SystemSecurityConfig } from 'app/interfaces/system-security-config.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -62,7 +62,7 @@ describe('SystemSecurityFormComponent', () => { afterClosed: () => of(undefined), })), }), - mockWebSocket([ + mockApi([ mockJob('system.security.update', fakeSuccessfulJob()), ]), ], diff --git a/src/app/pages/system/alert-config-form/alert-config-form.component.spec.ts b/src/app/pages/system/alert-config-form/alert-config-form.component.spec.ts index 1d2b5df3a78..767ab9460d9 100644 --- a/src/app/pages/system/alert-config-form/alert-config-form.component.spec.ts +++ b/src/app/pages/system/alert-config-form/alert-config-form.component.spec.ts @@ -3,7 +3,7 @@ import { createComponentFactory, mockProvider, Spectator, } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { AlertLevel } from 'app/enums/alert-level.enum'; import { AlertPolicy } from 'app/enums/alert-policy.enum'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -21,7 +21,7 @@ describe('AlertConfigFormComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('alert.list_categories', [ { id: 'APPLICATIONS', diff --git a/src/app/pages/system/alert-service/alert-service-list/alert-service-list.component.spec.ts b/src/app/pages/system/alert-service/alert-service-list/alert-service-list.component.spec.ts index 8f86cf278c7..01c59e3606c 100644 --- a/src/app/pages/system/alert-service/alert-service-list/alert-service-list.component.spec.ts +++ b/src/app/pages/system/alert-service/alert-service-list/alert-service-list.component.spec.ts @@ -5,7 +5,7 @@ import { Spectator } from '@ngneat/spectator'; import { createComponentFactory, mockProvider } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi, mockCall } from 'app/core/testing/utils/mock-websocket.utils'; import { AlertService } from 'app/interfaces/alert-service.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { SearchInput1Component } from 'app/modules/forms/search-input1/search-input1.component'; @@ -46,7 +46,7 @@ describe('AlertServiceListComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('alertservice.query', alertServices), mockCall('alertservice.delete'), ]), diff --git a/src/app/pages/system/alert-service/alert-service/alert-service.component.spec.ts b/src/app/pages/system/alert-service/alert-service/alert-service.component.spec.ts index 6b54656cafb..5c80d29f8fe 100644 --- a/src/app/pages/system/alert-service/alert-service/alert-service.component.spec.ts +++ b/src/app/pages/system/alert-service/alert-service/alert-service.component.spec.ts @@ -8,7 +8,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, Spectator } from '@ngneat/spectator/jest'; import { MockProvider } from 'ng-mocks'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { AlertLevel } from 'app/enums/alert-level.enum'; import { AlertServiceType } from 'app/enums/alert-service-type.enum'; import { AlertService } from 'app/interfaces/alert-service.interface'; @@ -110,7 +110,7 @@ describe('AlertServiceComponent', () => { MockProvider(DialogService, { info: jest.fn(), }), - mockWebSocket([ + mockApi([ mockCall('alertservice.test', true), mockCall('alertservice.create'), mockCall('alertservice.update'), diff --git a/src/app/pages/system/bootenv/boot-pool-attach/boot-pool-attach-dialog.component.spec.ts b/src/app/pages/system/bootenv/boot-pool-attach/boot-pool-attach-dialog.component.spec.ts index 18c94968cff..98cf96eef9b 100644 --- a/src/app/pages/system/bootenv/boot-pool-attach/boot-pool-attach-dialog.component.spec.ts +++ b/src/app/pages/system/bootenv/boot-pool-attach/boot-pool-attach-dialog.component.spec.ts @@ -6,7 +6,7 @@ import { MatDialogRef } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DetailsDisk } from 'app/interfaces/disk.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { @@ -30,7 +30,7 @@ describe('BootPoolAttachDialogComponent', () => { UnusedDiskSelectComponent, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('disk.details', { unused: [ { diff --git a/src/app/pages/system/bootenv/boot-pool-delete-dialog/boot-pool-delete-dialog.component.spec.ts b/src/app/pages/system/bootenv/boot-pool-delete-dialog/boot-pool-delete-dialog.component.spec.ts index c1d5280f72e..0440f9c3928 100644 --- a/src/app/pages/system/bootenv/boot-pool-delete-dialog/boot-pool-delete-dialog.component.spec.ts +++ b/src/app/pages/system/bootenv/boot-pool-delete-dialog/boot-pool-delete-dialog.component.spec.ts @@ -7,7 +7,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { CoreBulkQuery, CoreBulkResponse } from 'app/interfaces/core-bulk.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; @@ -52,7 +52,7 @@ describe('BootPoolDeleteDialogComponent', () => { mockProvider(AppLoaderService), mockProvider(MatDialogRef), mockProvider(DialogService), - mockWebSocket([ + mockApi([ mockJob('core.bulk'), ]), ], diff --git a/src/app/pages/system/bootenv/boot-pool-replace/boot-pool-replace-dialog.component.spec.ts b/src/app/pages/system/bootenv/boot-pool-replace/boot-pool-replace-dialog.component.spec.ts index 4ff5a0a0f5a..2d9a8805bae 100644 --- a/src/app/pages/system/bootenv/boot-pool-replace/boot-pool-replace-dialog.component.spec.ts +++ b/src/app/pages/system/bootenv/boot-pool-replace/boot-pool-replace-dialog.component.spec.ts @@ -7,7 +7,7 @@ import { createRoutingFactory, mockProvider, Spectator } from '@ngneat/spectator import { of } from 'rxjs'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DetailsDisk } from 'app/interfaces/disk.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { @@ -28,7 +28,7 @@ describe('BootPoolReplaceDialogComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('disk.details', { unused: [ { diff --git a/src/app/pages/system/bootenv/bootenv-form/bootenv-form.component.spec.ts b/src/app/pages/system/bootenv/bootenv-form/bootenv-form.component.spec.ts index b02fe9cff24..c9ca9e5dece 100644 --- a/src/app/pages/system/bootenv/bootenv-form/bootenv-form.component.spec.ts +++ b/src/app/pages/system/bootenv/bootenv-form/bootenv-form.component.spec.ts @@ -4,7 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { BootEnvironmentAction } from 'app/enums/boot-environment-action.enum'; import { IxInputHarness } from 'app/modules/forms/ix-forms/components/ix-input/ix-input.harness'; import { FormErrorHandlerService } from 'app/modules/forms/ix-forms/services/form-error-handler.service'; @@ -25,7 +25,7 @@ describe('BootEnvironmentFormComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('bootenv.create'), mockCall('bootenv.update'), ]), diff --git a/src/app/pages/system/bootenv/bootenv-list/bootenv-list.component.spec.ts b/src/app/pages/system/bootenv/bootenv-list/bootenv-list.component.spec.ts index ed0c35cc3f4..4c80bca729b 100644 --- a/src/app/pages/system/bootenv/bootenv-list/bootenv-list.component.spec.ts +++ b/src/app/pages/system/bootenv/bootenv-list/bootenv-list.component.spec.ts @@ -6,7 +6,7 @@ import { MockComponent } from 'ng-mocks'; import { of, Subject } from 'rxjs'; import { FakeFormatDateTimePipe } from 'app/core/testing/classes/fake-format-datetime.pipe'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { SearchInput1Component } from 'app/modules/forms/search-input1/search-input1.component'; import { IxTableHarness } from 'app/modules/ix-table/components/ix-table/ix-table.harness'; @@ -36,7 +36,7 @@ describe('BootEnvironmentListComponent', () => { mockProvider(LocaleService, { timezone: 'America/Los_Angeles', }), - mockWebSocket([ + mockApi([ mockCall('bootenv.query', fakeBootEnvironmentsDataSource), ]), mockProvider(DialogService, { diff --git a/src/app/pages/system/bootenv/bootenv-stats-dialog/bootenv-stats-dialog.component.spec.ts b/src/app/pages/system/bootenv/bootenv-stats-dialog/bootenv-stats-dialog.component.spec.ts index 5f8e95d54aa..a5f05223cb4 100644 --- a/src/app/pages/system/bootenv/bootenv-stats-dialog/bootenv-stats-dialog.component.spec.ts +++ b/src/app/pages/system/bootenv/bootenv-stats-dialog/bootenv-stats-dialog.component.spec.ts @@ -8,7 +8,7 @@ import { provideMockStore } from '@ngrx/store/testing'; import { FakeFormatDateTimePipe } from 'app/core/testing/classes/fake-format-datetime.pipe'; import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { PoolStatus } from 'app/enums/pool-status.enum'; import { AdvancedConfig } from 'app/interfaces/advanced-config.interface'; import { PoolInstance } from 'app/interfaces/pool.interface'; @@ -47,7 +47,7 @@ describe('BootenvStatsDialogComponent', () => { mockProvider(DialogService), mockProvider(SnackbarService), mockProvider(MatDialogRef), - mockWebSocket([ + mockApi([ mockCall('boot.get_state', poolInstance), mockCall('boot.set_scrub_interval'), ]), diff --git a/src/app/pages/system/bootenv/bootenv-status/bootenv-status.component.spec.ts b/src/app/pages/system/bootenv/bootenv-status/bootenv-status.component.spec.ts index d46dbf53294..7a29c46528f 100644 --- a/src/app/pages/system/bootenv/bootenv-status/bootenv-status.component.spec.ts +++ b/src/app/pages/system/bootenv/bootenv-status/bootenv-status.component.spec.ts @@ -5,7 +5,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { FakeFormatDateTimePipe } from 'app/core/testing/classes/fake-format-datetime.pipe'; import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { PoolStatus } from 'app/enums/pool-status.enum'; import { TopologyItemType } from 'app/enums/v-dev-type.enum'; import { TopologyItemStatus } from 'app/enums/vdev-status.enum'; @@ -71,7 +71,7 @@ describe('BootStatusListComponent', () => { mockProvider(SnackbarService), mockProvider(MatDialogRef), mockProvider(SnackbarService), - mockWebSocket([ + mockApi([ mockCall('boot.get_state', poolInstance), mockCall('boot.detach'), ]), diff --git a/src/app/pages/system/enclosure/components/identify-light/identify-light.component.spec.ts b/src/app/pages/system/enclosure/components/identify-light/identify-light.component.spec.ts index c5adfb809bb..12e95c8af9b 100644 --- a/src/app/pages/system/enclosure/components/identify-light/identify-light.component.spec.ts +++ b/src/app/pages/system/enclosure/components/identify-light/identify-light.component.spec.ts @@ -4,7 +4,7 @@ import { signal } from '@angular/core'; import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { throwError } from 'rxjs'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DriveBayLightStatus } from 'app/enums/enclosure-slot-status.enum'; import { DashboardEnclosureSlot } from 'app/interfaces/enclosure.interface'; import { IxIconHarness } from 'app/modules/ix-icon/ix-icon.harness'; @@ -21,7 +21,7 @@ describe('IdentifyLightComponent', () => { const createComponent = createComponentFactory({ component: IdentifyLightComponent, providers: [ - mockWebSocket([ + mockApi([ mockCall('enclosure2.set_slot_status'), ]), mockProvider(EnclosureStore, { diff --git a/src/app/pages/system/enclosure/components/jbof-list/jbof-form/jbof-form.component.spec.ts b/src/app/pages/system/enclosure/components/jbof-list/jbof-form/jbof-form.component.spec.ts index aafdfbce301..9e80caa8eb7 100644 --- a/src/app/pages/system/enclosure/components/jbof-list/jbof-form/jbof-form.component.spec.ts +++ b/src/app/pages/system/enclosure/components/jbof-list/jbof-form/jbof-form.component.spec.ts @@ -4,7 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { Jbof } from 'app/interfaces/jbof.interface'; import { FormErrorHandlerService } from 'app/modules/forms/ix-forms/services/form-error-handler.service'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; @@ -24,7 +24,7 @@ describe('JbofFormComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('jbof.create'), mockCall('jbof.update'), ]), diff --git a/src/app/pages/system/enclosure/components/jbof-list/jbof-list.component.spec.ts b/src/app/pages/system/enclosure/components/jbof-list/jbof-list.component.spec.ts index f3a0b1e3004..8441dc03047 100644 --- a/src/app/pages/system/enclosure/components/jbof-list/jbof-list.component.spec.ts +++ b/src/app/pages/system/enclosure/components/jbof-list/jbof-list.component.spec.ts @@ -5,7 +5,7 @@ import { MockComponent } from 'ng-mocks'; import { of } from 'rxjs'; import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { Jbof } from 'app/interfaces/jbof.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { SearchInput1Component } from 'app/modules/forms/search-input1/search-input1.component'; @@ -48,7 +48,7 @@ describe('JbofListComponent', () => { SearchInput1Component, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('jbof.query', fakeJbofDataSource), mockCall('jbof.delete', true), mockCall('jbof.licensed', 1), diff --git a/src/app/pages/system/enclosure/components/set-enclosure-label-dialog/set-enclosure-label-dialog.component.spec.ts b/src/app/pages/system/enclosure/components/set-enclosure-label-dialog/set-enclosure-label-dialog.component.spec.ts index 3f932c3bcad..13e22894114 100644 --- a/src/app/pages/system/enclosure/components/set-enclosure-label-dialog/set-enclosure-label-dialog.component.spec.ts +++ b/src/app/pages/system/enclosure/components/set-enclosure-label-dialog/set-enclosure-label-dialog.component.spec.ts @@ -4,7 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { MatButtonHarness } from '@angular/material/button/testing'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxCheckboxHarness } from 'app/modules/forms/ix-forms/components/ix-checkbox/ix-checkbox.harness'; import { IxInputHarness } from 'app/modules/forms/ix-forms/components/ix-input/ix-input.harness'; @@ -22,7 +22,7 @@ describe('SetEnclosureLabelDialogComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('enclosure.update'), ]), mockProvider(DialogService), diff --git a/src/app/pages/system/enclosure/enclosure-dashboard.component.spec.ts b/src/app/pages/system/enclosure/enclosure-dashboard.component.spec.ts index 14af5a32680..22144f147fd 100644 --- a/src/app/pages/system/enclosure/enclosure-dashboard.component.spec.ts +++ b/src/app/pages/system/enclosure/enclosure-dashboard.component.spec.ts @@ -7,7 +7,7 @@ import { import { MockComponent } from 'ng-mocks'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { EmptyComponent } from 'app/modules/empty/empty.component'; import { PageHeaderComponent } from 'app/modules/page-header/page-title-header/page-header.component'; import { @@ -33,7 +33,7 @@ describe('EnclosureDashboardComponent', () => { }), ], providers: [ - mockWebSocket([ + mockApi([ mockCall('jbof.licensed', 5), ]), mockProvider(MatDialog), diff --git a/src/app/pages/system/enclosure/services/enclosure.store.spec.ts b/src/app/pages/system/enclosure/services/enclosure.store.spec.ts index 1415d0a59f9..aeee78cebe8 100644 --- a/src/app/pages/system/enclosure/services/enclosure.store.spec.ts +++ b/src/app/pages/system/enclosure/services/enclosure.store.spec.ts @@ -5,7 +5,7 @@ import { SpectatorService, } from '@ngneat/spectator/jest'; import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { IncomingApiMessageType } from 'app/enums/api-message-type.enum'; import { EnclosureElementType } from 'app/enums/enclosure-slot-status.enum'; import { @@ -52,7 +52,7 @@ describe('EnclosureStore', () => { const createService = createServiceFactory({ service: EnclosureStore, providers: [ - mockWebSocket([ + mockApi([ mockCall('webui.enclosure.dashboard', enclosures), ]), mockProvider(ThemeService), diff --git a/src/app/pages/system/failover-settings/failover-settings.component.spec.ts b/src/app/pages/system/failover-settings/failover-settings.component.spec.ts index 84635cb461a..46ac37aa377 100644 --- a/src/app/pages/system/failover-settings/failover-settings.component.spec.ts +++ b/src/app/pages/system/failover-settings/failover-settings.component.spec.ts @@ -6,7 +6,7 @@ import { MatCheckboxHarness } from '@angular/material/checkbox/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { helptextSystemFailover } from 'app/helptext/system/failover'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; @@ -29,7 +29,7 @@ describe('FailoverComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('failover.update'), mockCall('failover.sync_to_peer'), mockCall('failover.sync_from_peer'), diff --git a/src/app/pages/system/general-settings/email/email-card/email-card.component.spec.ts b/src/app/pages/system/general-settings/email/email-card/email-card.component.spec.ts index 6638597f2ba..551e066f6a7 100644 --- a/src/app/pages/system/general-settings/email/email-card/email-card.component.spec.ts +++ b/src/app/pages/system/general-settings/email/email-card/email-card.component.spec.ts @@ -4,7 +4,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { MatListItemHarness } from '@angular/material/list/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { MailSecurity } from 'app/enums/mail-security.enum'; import { MailConfig } from 'app/interfaces/mail-config.interface'; import { EmailCardComponent } from 'app/pages/system/general-settings/email/email-card/email-card.component'; @@ -30,7 +30,7 @@ describe('EmailCardComponent', () => { const createComponent = createComponentFactory({ component: EmailCardComponent, providers: [ - mockWebSocket([ + mockApi([ mockCall('mail.config', fakeEmailConfig), ]), mockProvider(SlideInService, { diff --git a/src/app/pages/system/general-settings/email/email-form/email-form.component.spec.ts b/src/app/pages/system/general-settings/email/email-form/email-form.component.spec.ts index 4f737cef27c..d0597cb99a4 100644 --- a/src/app/pages/system/general-settings/email/email-form/email-form.component.spec.ts +++ b/src/app/pages/system/general-settings/email/email-form/email-form.component.spec.ts @@ -7,7 +7,7 @@ import { provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { mockWindow } from 'app/core/testing/utils/mock-window.utils'; import { MailSecurity } from 'app/enums/mail-security.enum'; import { ProductType } from 'app/enums/product-type.enum'; @@ -57,7 +57,7 @@ describe('EmailFormComponent', () => { { selector: selectSystemInfo, value: { hostname: 'host.truenas.com' } }, ], }), - mockWebSocket([ + mockApi([ mockCall('mail.local_administrator_email', 'authuser@ixsystems.com'), mockCall('mail.update'), mockCall('user.query', [ diff --git a/src/app/pages/system/general-settings/gui/gui-form/gui-form.component.spec.ts b/src/app/pages/system/general-settings/gui/gui-form/gui-form.component.spec.ts index 0f19e8c9ce1..640001e7af4 100644 --- a/src/app/pages/system/general-settings/gui/gui-form/gui-form.component.spec.ts +++ b/src/app/pages/system/general-settings/gui/gui-form/gui-form.component.spec.ts @@ -7,7 +7,7 @@ import { Store } from '@ngrx/store'; import { provideMockStore } from '@ngrx/store/testing'; import { BehaviorSubject, of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { mockWindow } from 'app/core/testing/utils/mock-window.utils'; import { Certificate } from 'app/interfaces/certificate.interface'; import { SystemGeneralConfig } from 'app/interfaces/system-config.interface'; @@ -61,7 +61,7 @@ describe('GuiFormComponent', () => { ], providers: [ DialogService, - mockWebSocket([ + mockApi([ mockCall('system.general.update', mockSystemGeneralConfig), mockCall('system.general.ui_restart'), ]), diff --git a/src/app/pages/system/general-settings/localization/localization-form/localization-form.component.spec.ts b/src/app/pages/system/general-settings/localization/localization-form/localization-form.component.spec.ts index 9c017ba6b67..e4b86ef5290 100644 --- a/src/app/pages/system/general-settings/localization/localization-form/localization-form.component.spec.ts +++ b/src/app/pages/system/general-settings/localization/localization-form/localization-form.component.spec.ts @@ -7,7 +7,7 @@ import { Store } from '@ngrx/store'; import { provideMockStore } from '@ngrx/store/testing'; import { Observable, of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { LocalizationSettings } from 'app/interfaces/localization-settings.interface'; import { Option } from 'app/interfaces/option.interface'; import { FormErrorHandlerService } from 'app/modules/forms/ix-forms/services/form-error-handler.service'; @@ -34,7 +34,7 @@ describe('LocalizationFormComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('system.general.update'), ]), mockProvider(SystemGeneralService, { diff --git a/src/app/pages/system/general-settings/ntp-server/ntp-server-card/ntp-server-card.component.spec.ts b/src/app/pages/system/general-settings/ntp-server/ntp-server-card/ntp-server-card.component.spec.ts index 4583883c5e2..406b55e7778 100644 --- a/src/app/pages/system/general-settings/ntp-server/ntp-server-card/ntp-server-card.component.spec.ts +++ b/src/app/pages/system/general-settings/ntp-server/ntp-server-card/ntp-server-card.component.spec.ts @@ -4,7 +4,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of, Subject } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { NtpServer } from 'app/interfaces/ntp-server.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxIconHarness } from 'app/modules/ix-icon/ix-icon.harness'; @@ -55,7 +55,7 @@ describe('NtpServerCardComponent', () => { component: NtpServerCardComponent, providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('system.ntpserver.query', fakeDataSource), mockCall('system.ntpserver.delete', true), ]), diff --git a/src/app/pages/system/general-settings/ntp-server/ntp-server-form/ntp-server-form.component.spec.ts b/src/app/pages/system/general-settings/ntp-server/ntp-server-form/ntp-server-form.component.spec.ts index 3458a8ec829..caeb6a6efad 100644 --- a/src/app/pages/system/general-settings/ntp-server/ntp-server-form/ntp-server-form.component.spec.ts +++ b/src/app/pages/system/general-settings/ntp-server/ntp-server-form/ntp-server-form.component.spec.ts @@ -4,7 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { NtpServer } from 'app/interfaces/ntp-server.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; @@ -26,7 +26,7 @@ describe('NtpServerFormComponent', () => { ], providers: [ mockProvider(DialogService), - mockWebSocket([ + mockApi([ mockCall('system.ntpserver.create'), mockCall('system.ntpserver.update'), ]), diff --git a/src/app/pages/system/general-settings/save-config-dialog/save-config-dialog.component.spec.ts b/src/app/pages/system/general-settings/save-config-dialog/save-config-dialog.component.spec.ts index d486ec4797b..5536abdb423 100644 --- a/src/app/pages/system/general-settings/save-config-dialog/save-config-dialog.component.spec.ts +++ b/src/app/pages/system/general-settings/save-config-dialog/save-config-dialog.component.spec.ts @@ -8,7 +8,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { SystemInfo } from 'app/interfaces/system-info.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxCheckboxHarness } from 'app/modules/forms/ix-forms/components/ix-checkbox/ix-checkbox.harness'; @@ -29,7 +29,7 @@ describe('SaveConfigDialogComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('core.download', [123, 'http://localhost/download/config']), ]), provideMockStore({ diff --git a/src/app/pages/system/general-settings/support/license/license.component.spec.ts b/src/app/pages/system/general-settings/support/license/license.component.spec.ts index 225a1c7ddcc..85b584b3da5 100644 --- a/src/app/pages/system/general-settings/support/license/license.component.spec.ts +++ b/src/app/pages/system/general-settings/support/license/license.component.spec.ts @@ -4,7 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { FormErrorHandlerService } from 'app/modules/forms/ix-forms/services/form-error-handler.service'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; @@ -24,7 +24,7 @@ describe('LicenseComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('system.license_update'), ]), mockProvider(SlideInService), diff --git a/src/app/pages/system/general-settings/support/proactive/proactive.component.spec.ts b/src/app/pages/system/general-settings/support/proactive/proactive.component.spec.ts index 68a9a4a4b44..a76423e8c56 100644 --- a/src/app/pages/system/general-settings/support/proactive/proactive.component.spec.ts +++ b/src/app/pages/system/general-settings/support/proactive/proactive.component.spec.ts @@ -8,7 +8,7 @@ import { } from '@ngneat/spectator/jest'; import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { SupportConfig } from 'app/modules/feedback/interfaces/file-ticket.interface'; import { FormErrorHandlerService } from 'app/modules/forms/ix-forms/services/form-error-handler.service'; @@ -32,7 +32,7 @@ describe('ProactiveComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('support.update'), mockCall('support.config', { enabled: true, diff --git a/src/app/pages/system/general-settings/support/support-card/support-card.component.spec.ts b/src/app/pages/system/general-settings/support/support-card/support-card.component.spec.ts index 8d19616c96f..0865c482795 100644 --- a/src/app/pages/system/general-settings/support/support-card/support-card.component.spec.ts +++ b/src/app/pages/system/general-settings/support/support-card/support-card.component.spec.ts @@ -9,7 +9,7 @@ import { MockComponent } from 'ng-mocks'; import { of } from 'rxjs'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { LicenseFeature } from 'app/enums/license-feature.enum'; import { ProductType } from 'app/enums/product-type.enum'; import { SystemInfo, SystemLicense } from 'app/interfaces/system-info.interface'; @@ -46,7 +46,7 @@ describe('SupportCardComponent', () => { mockProvider(MatDialog), mockProvider(DialogService), mockProvider(MatSnackBar), - mockWebSocket([ + mockApi([ mockCall('truenas.is_production', true), mockJob('truenas.set_production', fakeSuccessfulJob()), mockCall('system.product_type', ProductType.Scale), diff --git a/src/app/pages/system/update/components/manual-update-form/manual-update-form.component.spec.ts b/src/app/pages/system/update/components/manual-update-form/manual-update-form.component.spec.ts index 8d34eb16991..c30dcce7c4c 100644 --- a/src/app/pages/system/update/components/manual-update-form/manual-update-form.component.spec.ts +++ b/src/app/pages/system/update/components/manual-update-form/manual-update-form.component.spec.ts @@ -7,7 +7,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { provideMockStore } from '@ngrx/store/testing'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { mockWindow } from 'app/core/testing/utils/mock-window.utils'; import { ProductType } from 'app/enums/product-type.enum'; import { helptextSystemUpdate as helptext } from 'app/helptext/system/update'; @@ -33,7 +33,7 @@ describe('ManualUpdateFormComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('pool.query', [ { name: 'pool2', diff --git a/src/app/pages/system/update/components/train-card/train-card.component.spec.ts b/src/app/pages/system/update/components/train-card/train-card.component.spec.ts index 4c3fd364199..157180585db 100644 --- a/src/app/pages/system/update/components/train-card/train-card.component.spec.ts +++ b/src/app/pages/system/update/components/train-card/train-card.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { BehaviorSubject, of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { SystemUpdateTrains } from 'app/interfaces/system-update.interface'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; import { TrainCardComponent } from 'app/pages/system/update/components/train-card/train-card.component'; @@ -24,7 +24,7 @@ describe('TrainCardComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([]), + mockApi([]), mockProvider(TrainService, { getAutoDownload: jest.fn(() => of(false)), getTrains: jest.fn(() => of({ diff --git a/src/app/pages/system/update/components/update-actions-card/update-actions-card.component.spec.ts b/src/app/pages/system/update/components/update-actions-card/update-actions-card.component.spec.ts index b34d2bce8a4..c35c9309f62 100644 --- a/src/app/pages/system/update/components/update-actions-card/update-actions-card.component.spec.ts +++ b/src/app/pages/system/update/components/update-actions-card/update-actions-card.component.spec.ts @@ -8,7 +8,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { provideMockStore } from '@ngrx/store/testing'; import { BehaviorSubject, of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { JobState } from 'app/enums/job-state.enum'; import { SystemUpdateStatus } from 'app/enums/system-update.enum'; import { SystemUpdate } from 'app/interfaces/system-update.interface'; @@ -35,7 +35,7 @@ describe('UpdateActionsCardComponent', () => { component: UpdateActionsCardComponent, providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('core.get_jobs', []), mockCall('update.check_available', { status: SystemUpdateStatus.Available, diff --git a/src/app/pages/two-factor-auth/two-factor.component.spec.ts b/src/app/pages/two-factor-auth/two-factor.component.spec.ts index fefe23c73ed..435a12980d1 100644 --- a/src/app/pages/two-factor-auth/two-factor.component.spec.ts +++ b/src/app/pages/two-factor-auth/two-factor.component.spec.ts @@ -4,7 +4,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { Spectator, createComponentFactory, mockProvider } from '@ngneat/spectator/jest'; import { MockComponent } from 'ng-mocks'; import { of } from 'rxjs'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { helptext2fa } from 'app/helptext/system/2fa'; import { LoggedInUser } from 'app/interfaces/ds-cache.interface'; import { GlobalTwoFactorConfig, UserTwoFactorConfig } from 'app/interfaces/two-factor-config.interface'; @@ -32,7 +32,7 @@ describe('TwoFactorComponent', () => { mockProvider(DialogService, { confirm: jest.fn(() => of(true)), }), - mockWebSocket([ + mockApi([ mockCall('user.renew_2fa_secret'), ]), mockProvider(AuthService, { diff --git a/src/app/pages/virtualization/components/all-instances/all-instances-header/global-config-form/global-config-form.component.spec.ts b/src/app/pages/virtualization/components/all-instances/all-instances-header/global-config-form/global-config-form.component.spec.ts index 05b5527a521..22049a33e1f 100644 --- a/src/app/pages/virtualization/components/all-instances/all-instances-header/global-config-form/global-config-form.component.spec.ts +++ b/src/app/pages/virtualization/components/all-instances/all-instances-header/global-config-form/global-config-form.component.spec.ts @@ -5,7 +5,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { of } from 'rxjs'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; import { ChainedRef } from 'app/modules/slide-ins/chained-component-ref'; @@ -22,7 +22,7 @@ describe('GlobalConfigFormComponent', () => { const createComponent = createComponentFactory({ component: GlobalConfigFormComponent, providers: [ - mockWebSocket([ + mockApi([ mockCall('virt.global.pool_choices', { '[Disabled]': '[Disabled]', poolio: 'poolio', diff --git a/src/app/pages/virtualization/components/all-instances/instance-details/instance-devices/instance-devices.component.spec.ts b/src/app/pages/virtualization/components/all-instances/instance-details/instance-devices/instance-devices.component.spec.ts index f36c929cb61..9a3f3f2beca 100644 --- a/src/app/pages/virtualization/components/all-instances/instance-details/instance-devices/instance-devices.component.spec.ts +++ b/src/app/pages/virtualization/components/all-instances/instance-details/instance-devices/instance-devices.component.spec.ts @@ -2,7 +2,7 @@ import { HarnessLoader } from '@angular/cdk/testing'; import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { VirtualizationDeviceType } from 'app/enums/virtualization.enum'; import { VirtualizationProxy, VirtualizationUsb } from 'app/interfaces/virtualization.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -23,7 +23,7 @@ describe('InstanceDevicesComponent', () => { mockProvider(DialogService, { confirm: jest.fn(() => of(true)), }), - mockWebSocket([ + mockApi([ mockCall('virt.instance.device_delete'), ]), mockProvider(SnackbarService), diff --git a/src/app/pages/virtualization/components/all-instances/instance-details/instance-general-info/instance-general-info.component.spec.ts b/src/app/pages/virtualization/components/all-instances/instance-details/instance-general-info/instance-general-info.component.spec.ts index 72b2c59cf52..65aa02dde37 100644 --- a/src/app/pages/virtualization/components/all-instances/instance-details/instance-general-info/instance-general-info.component.spec.ts +++ b/src/app/pages/virtualization/components/all-instances/instance-details/instance-general-info/instance-general-info.component.spec.ts @@ -4,7 +4,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { VirtualizationInstance } from 'app/interfaces/virtualization.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { InstanceGeneralInfoComponent } from 'app/pages/virtualization/components/all-instances/instance-details/instance-general-info/instance-general-info.component'; @@ -48,7 +48,7 @@ describe('InstanceGeneralInfoComponent', () => { mockProvider(SlideInService, { open: jest.fn(), }), - mockWebSocket([ + mockApi([ mockJob('virt.instance.delete'), ]), mockProvider(VirtualizationInstancesStore, { diff --git a/src/app/pages/virtualization/components/all-instances/instance-details/instance-proxies/instance-proxies.component.spec.ts b/src/app/pages/virtualization/components/all-instances/instance-details/instance-proxies/instance-proxies.component.spec.ts index 0f70f445a1d..eddbc17919e 100644 --- a/src/app/pages/virtualization/components/all-instances/instance-details/instance-proxies/instance-proxies.component.spec.ts +++ b/src/app/pages/virtualization/components/all-instances/instance-details/instance-proxies/instance-proxies.component.spec.ts @@ -3,7 +3,7 @@ import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { VirtualizationDeviceType, VirtualizationProxyProtocol } from 'app/enums/virtualization.enum'; import { VirtualizationProxy, VirtualizationUsb } from 'app/interfaces/virtualization.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -31,7 +31,7 @@ describe('InstanceProxiesComponent', () => { mockProvider(DialogService, { confirm: jest.fn(() => of(true)), }), - mockWebSocket([ + mockApi([ mockCall('virt.instance.device_delete'), ]), mockProvider(SnackbarService), diff --git a/src/app/pages/virtualization/components/all-instances/instance-details/instance-proxies/instance-proxy-form/instance-proxy-form.component.spec.ts b/src/app/pages/virtualization/components/all-instances/instance-details/instance-proxies/instance-proxy-form/instance-proxy-form.component.spec.ts index ebff0afce34..84496d8b29c 100644 --- a/src/app/pages/virtualization/components/all-instances/instance-details/instance-proxies/instance-proxy-form/instance-proxy-form.component.spec.ts +++ b/src/app/pages/virtualization/components/all-instances/instance-details/instance-proxies/instance-proxy-form/instance-proxy-form.component.spec.ts @@ -2,7 +2,7 @@ import { HarnessLoader } from '@angular/cdk/testing'; import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { VirtualizationDeviceType, VirtualizationProxyProtocol } from 'app/enums/virtualization.enum'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; import { ChainedRef } from 'app/modules/slide-ins/chained-component-ref'; @@ -18,7 +18,7 @@ describe('InstanceProxyFormComponent', () => { const createComponent = createComponentFactory({ component: InstanceProxyFormComponent, providers: [ - mockWebSocket([ + mockApi([ mockCall('virt.instance.device_add'), ]), mockProvider(ChainedRef, { diff --git a/src/app/pages/virtualization/components/instance-edit-form/instance-edit-form.component.spec.ts b/src/app/pages/virtualization/components/instance-edit-form/instance-edit-form.component.spec.ts index 38970f660b3..036318841fd 100644 --- a/src/app/pages/virtualization/components/instance-edit-form/instance-edit-form.component.spec.ts +++ b/src/app/pages/virtualization/components/instance-edit-form/instance-edit-form.component.spec.ts @@ -12,7 +12,7 @@ import { map } from 'rxjs/operators'; import { GiB } from 'app/constants/bytes.constant'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { Job } from 'app/interfaces/job.interface'; import { VirtualizationInstance } from 'app/interfaces/virtualization.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -46,7 +46,7 @@ describe('InstanceEditFormComponent', () => { { provide: SLIDE_IN_DATA, useValue: mockInstance }, mockAuth(), mockProvider(SlideInRef), - mockWebSocket([ + mockApi([ mockJob('virt.instance.update', fakeSuccessfulJob({ id: 'test' } as VirtualizationInstance)), ]), mockProvider(SnackbarService), diff --git a/src/app/pages/virtualization/components/instance-wizard/instance-wizard.component.spec.ts b/src/app/pages/virtualization/components/instance-wizard/instance-wizard.component.spec.ts index b2684a55fb7..ae6e2d24c99 100644 --- a/src/app/pages/virtualization/components/instance-wizard/instance-wizard.component.spec.ts +++ b/src/app/pages/virtualization/components/instance-wizard/instance-wizard.component.spec.ts @@ -13,7 +13,7 @@ import { Observable, of } from 'rxjs'; import { map } from 'rxjs/operators'; import { GiB } from 'app/constants/bytes.constant'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { VirtualizationDeviceType, VirtualizationProxyProtocol, @@ -45,7 +45,7 @@ describe('InstanceWizardComponent', () => { providers: [ mockProvider(AuthService, { hasRole: () => of(true) }), mockProvider(Router), - mockWebSocket([ + mockApi([ mockCall('virt.instance.query', [{ id: 'test', name: 'test', diff --git a/src/app/pages/virtualization/components/instance-wizard/select-image-dialog/select-image-dialog.component.spec.ts b/src/app/pages/virtualization/components/instance-wizard/select-image-dialog/select-image-dialog.component.spec.ts index 0c9fd5e3cc1..7a2b4776d17 100644 --- a/src/app/pages/virtualization/components/instance-wizard/select-image-dialog/select-image-dialog.component.spec.ts +++ b/src/app/pages/virtualization/components/instance-wizard/select-image-dialog/select-image-dialog.component.spec.ts @@ -10,7 +10,7 @@ import { } from '@ngneat/spectator/jest'; import { mockCall, - mockWebSocket, + mockApi, } from 'app/core/testing/utils/mock-websocket.utils'; import { VirtualizationRemote } from 'app/enums/virtualization.enum'; import { VirtualizationImage } from 'app/interfaces/virtualization.interface'; @@ -43,7 +43,7 @@ describe('SelectImageDialogComponent', () => { component: SelectImageDialogComponent, imports: [ReactiveFormsModule], providers: [ - mockWebSocket([mockCall('virt.instance.image_choices', imageChoices)]), + mockApi([mockCall('virt.instance.image_choices', imageChoices)]), mockProvider(MatDialogRef), { provide: MAT_DIALOG_DATA, diff --git a/src/app/pages/virtualization/stores/virtualization-config.store.spec.ts b/src/app/pages/virtualization/stores/virtualization-config.store.spec.ts index e940bf26eb3..3dc95048d79 100644 --- a/src/app/pages/virtualization/stores/virtualization-config.store.spec.ts +++ b/src/app/pages/virtualization/stores/virtualization-config.store.spec.ts @@ -1,5 +1,5 @@ import { createServiceFactory, SpectatorService } from '@ngneat/spectator/jest'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { VirtualizationGlobalState } from 'app/enums/virtualization.enum'; import { VirtualizationGlobalConfig } from 'app/interfaces/virtualization.interface'; import { VirtualizationConfigStore } from 'app/pages/virtualization/stores/virtualization-config.store'; @@ -20,7 +20,7 @@ describe('VirtualizationConfigStore', () => { const createService = createServiceFactory({ service: VirtualizationConfigStore, providers: [ - mockWebSocket([ + mockApi([ mockCall('virt.global.config', config), ]), ], diff --git a/src/app/pages/virtualization/stores/virtualization-instances.store.spec.ts b/src/app/pages/virtualization/stores/virtualization-instances.store.spec.ts index 7f27fb7f2c5..e356fd0d068 100644 --- a/src/app/pages/virtualization/stores/virtualization-instances.store.spec.ts +++ b/src/app/pages/virtualization/stores/virtualization-instances.store.spec.ts @@ -1,5 +1,5 @@ import { createServiceFactory, SpectatorService } from '@ngneat/spectator/jest'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { VirtualizationDevice, VirtualizationInstance } from 'app/interfaces/virtualization.interface'; import { VirtualizationInstancesStore } from 'app/pages/virtualization/stores/virtualization-instances.store'; import { ApiService } from 'app/services/api.service'; @@ -20,7 +20,7 @@ describe('VirtualizationInstancesStore', () => { const createService = createServiceFactory({ service: VirtualizationInstancesStore, providers: [ - mockWebSocket([ + mockApi([ mockCall('virt.instance.query', instances), mockCall('virt.instance.device_list', devices), ]), diff --git a/src/app/pages/vm/devices/device-form/device-form.component.spec.ts b/src/app/pages/vm/devices/device-form/device-form.component.spec.ts index d0c217ff2ab..5c317c1a407 100644 --- a/src/app/pages/vm/devices/device-form/device-form.component.spec.ts +++ b/src/app/pages/vm/devices/device-form/device-form.component.spec.ts @@ -6,7 +6,7 @@ import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectat import { of } from 'rxjs'; import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { VmDeviceType, VmDiskMode, VmDisplayType, VmNicType, } from 'app/enums/vm.enum'; @@ -44,7 +44,7 @@ describe('DeviceFormComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('vm.device.create'), mockCall('vm.device.update'), mockCall('vm.get_display_devices', [{}, {}] as VmDisplayDevice[]), diff --git a/src/app/pages/vm/devices/device-list/device-delete-modal/device-delete-modal.component.spec.ts b/src/app/pages/vm/devices/device-list/device-delete-modal/device-delete-modal.component.spec.ts index 4aaa6640b32..0565574c15b 100644 --- a/src/app/pages/vm/devices/device-list/device-delete-modal/device-delete-modal.component.spec.ts +++ b/src/app/pages/vm/devices/device-list/device-delete-modal/device-delete-modal.component.spec.ts @@ -7,7 +7,7 @@ import { createComponentFactory, mockProvider, Spectator, SpectatorFactory, } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { VmDeviceType } from 'app/enums/vm.enum'; import { VmDevice, VmDiskDevice, VmRawFileDevice } from 'app/interfaces/vm-device.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -27,7 +27,7 @@ describe('DeviceDeleteModalComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('vm.device.delete'), ]), mockProvider(DialogService), diff --git a/src/app/pages/vm/devices/device-list/device-list/device-list.component.spec.ts b/src/app/pages/vm/devices/device-list/device-list/device-list.component.spec.ts index bc7a6a4ac57..c9669a92a10 100644 --- a/src/app/pages/vm/devices/device-list/device-list/device-list.component.spec.ts +++ b/src/app/pages/vm/devices/device-list/device-list/device-list.component.spec.ts @@ -7,7 +7,7 @@ import { createRoutingFactory, mockProvider, Spectator } from '@ngneat/spectator import { MockComponent } from 'ng-mocks'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { VmDeviceType } from 'app/enums/vm.enum'; import { VmDevice } from 'app/interfaces/vm-device.interface'; import { SearchInput1Component } from 'app/modules/forms/search-input1/search-input1.component'; @@ -55,7 +55,7 @@ describe('DeviceListComponent', () => { pk: 76, }, providers: [ - mockWebSocket([ + mockApi([ mockCall('vm.device.query', devices), ]), mockAuth(), diff --git a/src/app/pages/vm/utils/cpu-validator.service.spec.ts b/src/app/pages/vm/utils/cpu-validator.service.spec.ts index 80b1803b405..27f3cf25b6c 100644 --- a/src/app/pages/vm/utils/cpu-validator.service.spec.ts +++ b/src/app/pages/vm/utils/cpu-validator.service.spec.ts @@ -1,7 +1,7 @@ import { FormControl, FormGroup } from '@angular/forms'; import { createServiceFactory, SpectatorService } from '@ngneat/spectator/jest'; import { lastValueFrom } from 'rxjs'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { CpuValidatorService } from 'app/pages/vm/utils/cpu-validator.service'; import { ApiService } from 'app/services/api.service'; @@ -10,7 +10,7 @@ describe('CpuValidatorService', () => { const createService = createServiceFactory({ service: CpuValidatorService, providers: [ - mockWebSocket([ + mockApi([ mockCall('vm.maximum_supported_vcpus', 7), ]), ], diff --git a/src/app/pages/vm/utils/free-space-validator.service.spec.ts b/src/app/pages/vm/utils/free-space-validator.service.spec.ts index 9f5a32492c6..bd324ccc140 100644 --- a/src/app/pages/vm/utils/free-space-validator.service.spec.ts +++ b/src/app/pages/vm/utils/free-space-validator.service.spec.ts @@ -2,7 +2,7 @@ import { FormControl, FormGroup } from '@angular/forms'; import { createServiceFactory, SpectatorService } from '@ngneat/spectator/jest'; import { firstValueFrom } from 'rxjs'; import { TiB } from 'app/constants/bytes.constant'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { Statfs } from 'app/interfaces/filesystem-stat.interface'; import { FreeSpaceValidatorService } from 'app/pages/vm/utils/free-space-validator.service'; @@ -11,7 +11,7 @@ describe('FreeSpaceValidatorService', () => { const createService = createServiceFactory({ service: FreeSpaceValidatorService, providers: [ - mockWebSocket([ + mockApi([ mockCall('filesystem.statfs', { free_bytes: 10 * TiB, } as Statfs), diff --git a/src/app/pages/vm/utils/vm-gpu.service.spec.ts b/src/app/pages/vm/utils/vm-gpu.service.spec.ts index 03df51a8079..3130695bf8a 100644 --- a/src/app/pages/vm/utils/vm-gpu.service.spec.ts +++ b/src/app/pages/vm/utils/vm-gpu.service.spec.ts @@ -1,7 +1,7 @@ import { createServiceFactory, SpectatorService, SpyObject } from '@ngneat/spectator'; import { mockProvider } from '@ngneat/spectator/jest'; import { lastValueFrom, of } from 'rxjs'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { VmDeviceType } from 'app/enums/vm.enum'; import { Device } from 'app/interfaces/device.interface'; import { VirtualMachine } from 'app/interfaces/virtual-machine.interface'; @@ -61,7 +61,7 @@ describe('VmGpuService', () => { arc, ] as Device[]), }), - mockWebSocket([ + mockApi([ mockCall('vm.device.create'), mockCall('vm.device.delete'), ]), diff --git a/src/app/pages/vm/vm-edit-form/vm-edit-form.component.spec.ts b/src/app/pages/vm/vm-edit-form/vm-edit-form.component.spec.ts index 5a44c1ad165..d09c937d3de 100644 --- a/src/app/pages/vm/vm-edit-form/vm-edit-form.component.spec.ts +++ b/src/app/pages/vm/vm-edit-form/vm-edit-form.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { VmBootloader, VmCpuMode, VmDeviceType, VmTime, } from 'app/enums/vm.enum'; @@ -68,7 +68,7 @@ describe('VmEditFormComponent', () => { providers: [ mockProvider(SlideInRef), { provide: SLIDE_IN_DATA, useValue: undefined }, - mockWebSocket([ + mockApi([ mockCall('vm.bootloader_options', { UEFI: 'UEFI', UEFI_CSM: 'Legacy BIOS', diff --git a/src/app/pages/vm/vm-list.component.spec.ts b/src/app/pages/vm/vm-list.component.spec.ts index 333a657b797..ad47b285ce4 100644 --- a/src/app/pages/vm/vm-list.component.spec.ts +++ b/src/app/pages/vm/vm-list.component.spec.ts @@ -6,7 +6,7 @@ import { createComponentFactory, mockProvider } from '@ngneat/spectator/jest'; import { MockComponent } from 'ng-mocks'; import { Subject, of } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { VmState } from 'app/enums/vm.enum'; import { VirtualMachine } from 'app/interfaces/virtual-machine.interface'; import { SearchInput1Component } from 'app/modules/forms/search-input1/search-input1.component'; @@ -63,7 +63,7 @@ describe('VmListComponent', () => { ], providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('vm.query', virtualMachines), ]), mockProvider(SystemGeneralService, { diff --git a/src/app/pages/vm/vm-list/clone-vm-dialog/clone-vm-dialog.component.spec.ts b/src/app/pages/vm/vm-list/clone-vm-dialog/clone-vm-dialog.component.spec.ts index cc7141c6d7a..ef22fd15be6 100644 --- a/src/app/pages/vm/vm-list/clone-vm-dialog/clone-vm-dialog.component.spec.ts +++ b/src/app/pages/vm/vm-list/clone-vm-dialog/clone-vm-dialog.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { VirtualMachine } from 'app/interfaces/virtual-machine.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxInputHarness } from 'app/modules/forms/ix-forms/components/ix-input/ix-input.harness'; @@ -21,7 +21,7 @@ describe('CloneVmDialogComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('vm.clone'), ]), mockAuth(), diff --git a/src/app/pages/vm/vm-list/delete-vm-dialog/delete-vm-dialog.component.spec.ts b/src/app/pages/vm/vm-list/delete-vm-dialog/delete-vm-dialog.component.spec.ts index 83f9ae234cd..b0b74ce1e8d 100644 --- a/src/app/pages/vm/vm-list/delete-vm-dialog/delete-vm-dialog.component.spec.ts +++ b/src/app/pages/vm/vm-list/delete-vm-dialog/delete-vm-dialog.component.spec.ts @@ -5,7 +5,7 @@ import { MatButtonHarness } from '@angular/material/button/testing'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { VirtualMachine } from 'app/interfaces/virtual-machine.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; @@ -21,7 +21,7 @@ describe('DeleteVmDialogComponent', () => { ReactiveFormsModule, ], providers: [ - mockWebSocket([ + mockApi([ mockCall('vm.delete'), ]), mockAuth(), diff --git a/src/app/pages/vm/vm-wizard/steps/1-os-step/os-step.component.spec.ts b/src/app/pages/vm/vm-wizard/steps/1-os-step/os-step.component.spec.ts index 0983f98416f..61e1c36f866 100644 --- a/src/app/pages/vm/vm-wizard/steps/1-os-step/os-step.component.spec.ts +++ b/src/app/pages/vm/vm-wizard/steps/1-os-step/os-step.component.spec.ts @@ -3,7 +3,7 @@ import { HarnessLoader } from '@angular/cdk/testing'; import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { ReactiveFormsModule } from '@angular/forms'; import { createComponentFactory, Spectator } from '@ngneat/spectator/jest'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { VmBootloader, VmDisplayType, VmOs, VmTime, } from 'app/enums/vm.enum'; @@ -21,7 +21,7 @@ describe('OsStepComponent', () => { ], providers: [ CdkStepper, - mockWebSocket([ + mockApi([ mockCall('vm.query', []), mockCall('vm.bootloader_options', { UEFI: 'UEFI', diff --git a/src/app/pages/vm/vm-wizard/steps/2-cpu-and-memory-step/cpu-and-memory-step.component.spec.ts b/src/app/pages/vm/vm-wizard/steps/2-cpu-and-memory-step/cpu-and-memory-step.component.spec.ts index 2d006984307..7f6e7d56869 100644 --- a/src/app/pages/vm/vm-wizard/steps/2-cpu-and-memory-step/cpu-and-memory-step.component.spec.ts +++ b/src/app/pages/vm/vm-wizard/steps/2-cpu-and-memory-step/cpu-and-memory-step.component.spec.ts @@ -3,7 +3,7 @@ import { HarnessLoader } from '@angular/cdk/testing'; import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { ReactiveFormsModule } from '@angular/forms'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { VmCpuMode } from 'app/enums/vm.enum'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; import { CpuValidatorService } from 'app/pages/vm/utils/cpu-validator.service'; @@ -22,7 +22,7 @@ describe('CpuAndMemoryStepComponent', () => { ], providers: [ CdkStepper, - mockWebSocket([ + mockApi([ mockCall('vm.maximum_supported_vcpus', 27), mockCall('vm.cpu_model_choices', { 486: '486', diff --git a/src/app/pages/vm/vm-wizard/steps/3-disk-step/disk-step.component.spec.ts b/src/app/pages/vm/vm-wizard/steps/3-disk-step/disk-step.component.spec.ts index 498a3278a89..ac62fb1a5c5 100644 --- a/src/app/pages/vm/vm-wizard/steps/3-disk-step/disk-step.component.spec.ts +++ b/src/app/pages/vm/vm-wizard/steps/3-disk-step/disk-step.component.spec.ts @@ -5,7 +5,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { GiB } from 'app/constants/bytes.constant'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { VmDiskMode } from 'app/enums/vm.enum'; import { IxRadioGroupHarness } from 'app/modules/forms/ix-forms/components/ix-radio-group/ix-radio-group.harness'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; @@ -24,7 +24,7 @@ describe('DiskStepComponent', () => { ], providers: [ CdkStepper, - mockWebSocket([ + mockApi([ mockCall('pool.filesystem_choices', [ 'poolio', 'poolio/files', diff --git a/src/app/pages/vm/vm-wizard/steps/4-network-interface-step/network-interface-step.component.spec.ts b/src/app/pages/vm/vm-wizard/steps/4-network-interface-step/network-interface-step.component.spec.ts index 47006faef08..5c819bf842e 100644 --- a/src/app/pages/vm/vm-wizard/steps/4-network-interface-step/network-interface-step.component.spec.ts +++ b/src/app/pages/vm/vm-wizard/steps/4-network-interface-step/network-interface-step.component.spec.ts @@ -3,7 +3,7 @@ import { HarnessLoader } from '@angular/cdk/testing'; import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { ReactiveFormsModule } from '@angular/forms'; import { createComponentFactory, Spectator } from '@ngneat/spectator/jest'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { VmNicType } from 'app/enums/vm.enum'; import { IxInputHarness } from 'app/modules/forms/ix-forms/components/ix-input/ix-input.harness'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; @@ -23,7 +23,7 @@ describe('NetworkInterfaceStepComponent', () => { ], providers: [ CdkStepper, - mockWebSocket([ + mockApi([ mockCall('vm.random_mac', '00:00:00:00:00:01'), mockCall('vm.device.nic_attach_choices', { eno1: 'eno1', diff --git a/src/app/pages/vm/vm-wizard/steps/6-gpu-step/gpu-step.component.spec.ts b/src/app/pages/vm/vm-wizard/steps/6-gpu-step/gpu-step.component.spec.ts index 56287411396..f69347bced2 100644 --- a/src/app/pages/vm/vm-wizard/steps/6-gpu-step/gpu-step.component.spec.ts +++ b/src/app/pages/vm/vm-wizard/steps/6-gpu-step/gpu-step.component.spec.ts @@ -4,7 +4,7 @@ import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { ReactiveFormsModule } from '@angular/forms'; import { createComponentFactory, mockProvider, Spectator } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { IxFormHarness } from 'app/modules/forms/ix-forms/testing/ix-form.harness'; import { GpuStepComponent } from 'app/pages/vm/vm-wizard/steps/6-gpu-step/gpu-step.component'; import { GpuService } from 'app/services/gpu/gpu.service'; @@ -31,7 +31,7 @@ describe('GpuStepComponent', () => { mockProvider(IsolatedGpuValidatorService, { validateGpu: () => of(null), }), - mockWebSocket([ + mockApi([ mockCall('system.advanced.get_gpu_pci_choices', { 'GeForce GTX 1080 [0000:03:00.0]': '0000:03:00.0', 'GeForce GTX 1080 Ti [0000:04:00.0]': '0000:04:00.0', diff --git a/src/app/pages/vm/vm-wizard/vm-wizard.component.spec.ts b/src/app/pages/vm/vm-wizard/vm-wizard.component.spec.ts index 64ad02d5c13..07a4aba4618 100644 --- a/src/app/pages/vm/vm-wizard/vm-wizard.component.spec.ts +++ b/src/app/pages/vm/vm-wizard/vm-wizard.component.spec.ts @@ -9,7 +9,7 @@ import { MockComponent } from 'ng-mocks'; import { of } from 'rxjs'; import { GiB } from 'app/constants/bytes.constant'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { VmBootloader, VmCpuMode, VmDeviceType, VmDiskMode, VmDisplayType, VmTime, } from 'app/enums/vm.enum'; @@ -67,7 +67,7 @@ describe('VmWizardComponent', () => { mockProvider(GpuService), mockProvider(VmGpuService), mockAuth(), - mockWebSocket([ + mockApi([ mockCall('vm.create', { id: 4 } as VirtualMachine), mockCall('vm.query', []), mockCall('vm.port_wizard', { port: 13669 } as VmPortWizardResult), diff --git a/src/app/services/auth/auth.service.spec.ts b/src/app/services/auth/auth.service.spec.ts index a4fad9db741..77ad183fa00 100644 --- a/src/app/services/auth/auth.service.spec.ts +++ b/src/app/services/auth/auth.service.spec.ts @@ -11,7 +11,7 @@ import { firstValueFrom, of } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { IncomingApiMessageType } from 'app/enums/api-message-type.enum'; import { LoginResult } from 'app/enums/login-result.enum'; import { Role } from 'app/enums/role.enum'; @@ -49,7 +49,7 @@ describe('AuthService', () => { providers: [ mockAuth(), mockProvider(LocalStorageService), - mockWebSocket([ + mockApi([ mockCall('auth.me', authMeUser), ]), mockProvider(WebSocketConnectionService, { diff --git a/src/app/services/dataset-service/dataset.service.spec.ts b/src/app/services/dataset-service/dataset.service.spec.ts index 201c29330ed..211a03875ff 100644 --- a/src/app/services/dataset-service/dataset.service.spec.ts +++ b/src/app/services/dataset-service/dataset.service.spec.ts @@ -1,6 +1,6 @@ import { createServiceFactory, mockProvider, SpectatorService } from '@ngneat/spectator/jest'; import { lastValueFrom, of } from 'rxjs'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { ExplorerNodeType } from 'app/enums/explorer-type.enum'; import { ExplorerNodeData, TreeNode } from 'app/interfaces/tree-node.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -11,7 +11,7 @@ describe('DatasetService', () => { const createService = createServiceFactory({ service: DatasetService, providers: [ - mockWebSocket([ + mockApi([ mockCall('pool.filesystem_choices', [ 'pool', 'pool/subpool', diff --git a/src/app/services/disk-temperature.service.spec.ts b/src/app/services/disk-temperature.service.spec.ts index 7dfddc79e3a..d72d9de7973 100644 --- a/src/app/services/disk-temperature.service.spec.ts +++ b/src/app/services/disk-temperature.service.spec.ts @@ -1,7 +1,7 @@ import { createServiceFactory, SpectatorService } from '@ngneat/spectator/jest'; import { firstValueFrom } from 'rxjs'; import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { EnclosureElementType } from 'app/enums/enclosure-slot-status.enum'; import { DashboardEnclosure, DashboardEnclosureElements, DashboardEnclosureSlot } from 'app/interfaces/enclosure.interface'; import { DiskTemperatureService } from 'app/services/disk-temperature.service'; @@ -13,7 +13,7 @@ describe('DiskTemperatureService', () => { const createService = createServiceFactory({ service: DiskTemperatureService, providers: [ - mockWebSocket([ + mockApi([ mockCall('disk.temperatures'), mockCall('webui.enclosure.dashboard', [ { diff --git a/src/app/services/filesystem.service.spec.ts b/src/app/services/filesystem.service.spec.ts index 54703b75155..07669c21144 100644 --- a/src/app/services/filesystem.service.spec.ts +++ b/src/app/services/filesystem.service.spec.ts @@ -1,6 +1,6 @@ import { createServiceFactory, SpectatorService } from '@ngneat/spectator/jest'; import { lastValueFrom } from 'rxjs'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { ExplorerNodeType } from 'app/enums/explorer-type.enum'; import { FileAttribute } from 'app/enums/file-attribute.enum'; import { FileType } from 'app/enums/file-type.enum'; @@ -14,7 +14,7 @@ describe('FilesystemService', () => { const createService = createServiceFactory({ service: FilesystemService, providers: [ - mockWebSocket([ + mockApi([ mockCall('filesystem.listdir', [ { path: '/mnt/parent/directory', diff --git a/src/app/services/fips.service.spec.ts b/src/app/services/fips.service.spec.ts index 46d4a48fee0..a805ac5724c 100644 --- a/src/app/services/fips.service.spec.ts +++ b/src/app/services/fips.service.spec.ts @@ -6,7 +6,7 @@ import { } from '@ngneat/spectator/jest'; import { of } from 'rxjs'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; -import { mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { ApiService } from 'app/services/api.service'; import { FipsService } from 'app/services/fips.service'; @@ -23,7 +23,7 @@ describe('FipsService', () => { })), }), mockProvider(Router), - mockWebSocket([ + mockApi([ mockJob('failover.reboot.other_node', fakeSuccessfulJob()), ]), ], diff --git a/src/app/services/gpu/gpu-service.spec.ts b/src/app/services/gpu/gpu-service.spec.ts index 073c28ca203..6dd2c7cf41e 100644 --- a/src/app/services/gpu/gpu-service.spec.ts +++ b/src/app/services/gpu/gpu-service.spec.ts @@ -4,7 +4,7 @@ import { provideMockStore } from '@ngrx/store/testing'; import { firstValueFrom } from 'rxjs'; import { TestScheduler } from 'rxjs/testing'; import { getTestScheduler } from 'app/core/testing/utils/get-test-scheduler.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { DeviceType } from 'app/enums/device-type.enum'; import { AdvancedConfig } from 'app/interfaces/advanced-config.interface'; import { Device } from 'app/interfaces/device.interface'; @@ -34,7 +34,7 @@ describe('GpuService', () => { const createService = createServiceFactory({ service: GpuService, providers: [ - mockWebSocket([ + mockApi([ mockCall('system.advanced.update_gpu_pci_ids'), mockCall('device.get_info', allGpus), mockCall('system.advanced.get_gpu_pci_choices', { diff --git a/src/app/services/replication.service.spec.ts b/src/app/services/replication.service.spec.ts index d5738ac5c82..d357ba82efc 100644 --- a/src/app/services/replication.service.spec.ts +++ b/src/app/services/replication.service.spec.ts @@ -1,7 +1,7 @@ import { createServiceFactory, mockProvider, SpectatorService } from '@ngneat/spectator/jest'; import { firstValueFrom } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { ExplorerNodeType } from 'app/enums/explorer-type.enum'; import { TransportMode } from 'app/enums/transport-mode.enum'; import { ExplorerNodeData, TreeNode } from 'app/interfaces/tree-node.interface'; @@ -15,7 +15,7 @@ describe('ReplicationService', () => { service: ReplicationService, providers: [ mockAuth(), - mockWebSocket([ + mockApi([ mockCall('replication.list_datasets', [ 'parent', 'parent/child1', diff --git a/src/app/services/token-last-used.service.spec.ts b/src/app/services/token-last-used.service.spec.ts index 3b717af273c..e700a6d3ec8 100644 --- a/src/app/services/token-last-used.service.spec.ts +++ b/src/app/services/token-last-used.service.spec.ts @@ -1,7 +1,7 @@ import { SpectatorService, createServiceFactory, mockProvider } from '@ngneat/spectator/jest'; import { of, Subject } from 'rxjs'; import { oneMinuteMillis } from 'app/constants/time.constant'; -import { mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { WINDOW } from 'app/helpers/window.helper'; import { LoggedInUser } from 'app/interfaces/ds-cache.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -24,7 +24,7 @@ describe('TokenLastUsedService', () => { logout: jest.fn().mockReturnValue(new Subject()), user$: new Subject(), }), - mockWebSocket(), + mockApi(), { provide: WINDOW, useValue: { diff --git a/src/app/services/update.service.spec.ts b/src/app/services/update.service.spec.ts index 71db17197ce..339ddca43b7 100644 --- a/src/app/services/update.service.spec.ts +++ b/src/app/services/update.service.spec.ts @@ -1,6 +1,6 @@ import { createServiceFactory, SpectatorService } from '@ngneat/spectator/jest'; import { MockWebSocketService } from 'app/core/testing/classes/mock-websocket.service'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { WINDOW } from 'app/helpers/window.helper'; import { UpdateService } from 'app/services/update.service'; @@ -9,7 +9,7 @@ describe('UpdateService', () => { const createService = createServiceFactory({ service: UpdateService, providers: [ - mockWebSocket([ + mockApi([ mockCall('system.boot_id', 'boot-id-1'), ]), { diff --git a/src/app/services/vm.service.spec.ts b/src/app/services/vm.service.spec.ts index 35f59377827..c36f30d0b1b 100644 --- a/src/app/services/vm.service.spec.ts +++ b/src/app/services/vm.service.spec.ts @@ -3,7 +3,7 @@ import { SpectatorService } from '@ngneat/spectator'; import { createServiceFactory, mockProvider } from '@ngneat/spectator/jest'; import { firstValueFrom, of } from 'rxjs'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { VirtualMachine } from 'app/interfaces/virtual-machine.interface'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { StopVmDialogComponent } from 'app/pages/vm/vm-list/stop-vm-dialog/stop-vm-dialog.component'; @@ -15,7 +15,7 @@ describe('VmService', () => { const createService = createServiceFactory({ service: VmService, providers: [ - mockWebSocket([ + mockApi([ mockCall('core.download'), mockCall('vm.virtualization_details', { supported: true, error: null }), mockCall('vm.start'), diff --git a/src/app/store/eula/eula.effects.spec.ts b/src/app/store/eula/eula.effects.spec.ts index e23e21ff806..405ce8f2d9b 100644 --- a/src/app/store/eula/eula.effects.spec.ts +++ b/src/app/store/eula/eula.effects.spec.ts @@ -4,7 +4,7 @@ import { provideMockStore } from '@ngrx/store/testing'; import { of, ReplaySubject } from 'rxjs'; import { MockAuthService } from 'app/core/testing/classes/mock-auth.service'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { ProductType } from 'app/enums/product-type.enum'; import { Role } from 'app/enums/role.enum'; import { DialogService } from 'app/modules/dialog/dialog.service'; @@ -20,7 +20,7 @@ describe('EulaEffects', () => { service: EulaEffects, providers: [ provideMockActions(() => actions$), - mockWebSocket([ + mockApi([ mockCall('truenas.get_eula', 'Please do not sue us.'), mockCall('truenas.accept_eula'), mockCall('truenas.is_eula_accepted', false), diff --git a/src/app/store/ha-upgrade/ha-upgrade.effects.spec.ts b/src/app/store/ha-upgrade/ha-upgrade.effects.spec.ts index a7a607fea99..81d463ee438 100644 --- a/src/app/store/ha-upgrade/ha-upgrade.effects.spec.ts +++ b/src/app/store/ha-upgrade/ha-upgrade.effects.spec.ts @@ -4,7 +4,7 @@ import { provideMockStore } from '@ngrx/store/testing'; import { firstValueFrom, of, ReplaySubject } from 'rxjs'; import { fakeSuccessfulJob } from 'app/core/testing/utils/fake-job.utils'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockJob, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockJob, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { FailoverDisabledReason } from 'app/enums/failover-disabled-reason.enum'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { ApiService } from 'app/services/api.service'; @@ -29,7 +29,7 @@ describe('HaUpgradeEffects', () => { afterClosed: () => of({}), })), }), - mockWebSocket([ + mockApi([ mockCall('failover.upgrade_pending', true), mockJob('failover.upgrade_finish', fakeSuccessfulJob()), ]), diff --git a/src/app/store/network-interfaces/network-interfaces.effects.spec.ts b/src/app/store/network-interfaces/network-interfaces.effects.spec.ts index 244df8e423d..7f9dfe61b29 100644 --- a/src/app/store/network-interfaces/network-interfaces.effects.spec.ts +++ b/src/app/store/network-interfaces/network-interfaces.effects.spec.ts @@ -4,7 +4,7 @@ import { provideMockActions } from '@ngrx/effects/testing'; import { firstValueFrom, of, ReplaySubject } from 'rxjs'; import { MockAuthService } from 'app/core/testing/classes/mock-auth.service'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { helptextInterfaces } from 'app/helptext/network/interfaces/interfaces-list'; import { DialogService } from 'app/modules/dialog/dialog.service'; import { ApiService } from 'app/services/api.service'; @@ -22,7 +22,7 @@ describe('NetworkInterfacesEffects', () => { service: NetworkInterfacesEffects, providers: [ provideMockActions(() => actions$), - mockWebSocket([ + mockApi([ mockCall('interface.has_pending_changes', true), mockCall('interface.checkin_waiting', 60), ]), diff --git a/src/app/store/services/services.effects.spec.ts b/src/app/store/services/services.effects.spec.ts index ab6a46f0510..ce1d3dd75d0 100644 --- a/src/app/store/services/services.effects.spec.ts +++ b/src/app/store/services/services.effects.spec.ts @@ -6,7 +6,7 @@ import { BehaviorSubject, firstValueFrom, of, ReplaySubject, throwError, } from 'rxjs'; import { mockAuth } from 'app/core/testing/utils/mock-auth.utils'; -import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.utils'; +import { mockCall, mockApi } from 'app/core/testing/utils/mock-websocket.utils'; import { ServiceName } from 'app/enums/service-name.enum'; import { ServiceStatus } from 'app/enums/service-status.enum'; import { ApiEvent } from 'app/interfaces/api-message.interface'; @@ -43,7 +43,7 @@ describe('ServicesEffects', () => { service: ServicesEffects, providers: [ provideMockActions(() => actions$), - mockWebSocket([ + mockApi([ mockCall('service.query', [cifsService]), ]), mockProvider(MatDialog, {