diff --git a/src/app/features/meetings/pages/meetings-landing/meetings-landing.component.spec.ts b/src/app/features/meetings/pages/meetings-landing/meetings-landing.component.spec.ts index 7c13d0ea3..52eeb2c6e 100644 --- a/src/app/features/meetings/pages/meetings-landing/meetings-landing.component.spec.ts +++ b/src/app/features/meetings/pages/meetings-landing/meetings-landing.component.spec.ts @@ -1,9 +1,17 @@ +import { provideStates } from '@ngxs/store'; + import { TranslateModule } from '@ngx-translate/core'; -import { MockModule } from 'ng-mocks'; +import { MockComponents, MockModule } from 'ng-mocks'; +import { provideHttpClient } from '@angular/common/http'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { RouterModule } from '@angular/router'; +import { SearchInputComponent, SubHeaderComponent } from '@osf/shared/components'; + +import { MeetingsState } from '../../store'; + import { MeetingsLandingComponent } from './meetings-landing.component'; describe('MeetingsLandingComponent', () => { @@ -12,7 +20,13 @@ describe('MeetingsLandingComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [MeetingsLandingComponent, MockModule(TranslateModule), MockModule(RouterModule)], + imports: [ + MeetingsLandingComponent, + MockModule(TranslateModule), + MockModule(RouterModule), + ...MockComponents(SubHeaderComponent, SearchInputComponent), + ], + providers: [provideStates([MeetingsState]), provideHttpClient(), provideHttpClientTesting()], }).compileComponents(); fixture = TestBed.createComponent(MeetingsLandingComponent); diff --git a/src/app/features/registry/pages/registry-overview/registry-overview.component.spec.ts b/src/app/features/registry/pages/registry-overview/registry-overview.component.spec.ts index db933054b..3a3d5bbad 100644 --- a/src/app/features/registry/pages/registry-overview/registry-overview.component.spec.ts +++ b/src/app/features/registry/pages/registry-overview/registry-overview.component.spec.ts @@ -1,5 +1,22 @@ +import { provideStates } from '@ngxs/store'; + +import { MockComponents } from 'ng-mocks'; + +import { provideHttpClient } from '@angular/common/http'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { OverviewToolbarComponent } from '@osf/features/project/overview/components'; +import { + DataResourcesComponent, + LoadingSpinnerComponent, + ResourceMetadataComponent, + SubHeaderComponent, +} from '@osf/shared/components'; +import { MyResourcesState } from '@osf/shared/stores'; + +import { RegistryRevisionsComponent, RegistryStatusesComponent } from '../../components'; + import { RegistryOverviewComponent } from './registry-overview.component'; describe('RegistryOverviewComponent', () => { @@ -8,7 +25,19 @@ describe('RegistryOverviewComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [RegistryOverviewComponent], + imports: [ + RegistryOverviewComponent, + ...MockComponents( + SubHeaderComponent, + OverviewToolbarComponent, + LoadingSpinnerComponent, + ResourceMetadataComponent, + RegistryRevisionsComponent, + RegistryStatusesComponent, + DataResourcesComponent + ), + ], + providers: [provideStates([MyResourcesState]), provideHttpClient(), provideHttpClientTesting()], }).compileComponents(); fixture = TestBed.createComponent(RegistryOverviewComponent); diff --git a/src/app/shared/stores/addons/addons.models.ts b/src/app/shared/stores/addons/addons.models.ts index 3389bd3c2..ca13c78e5 100644 --- a/src/app/shared/stores/addons/addons.models.ts +++ b/src/app/shared/stores/addons/addons.models.ts @@ -1,5 +1,6 @@ import { Addon, + AsyncStateModel, AuthorizedAddon, AuthorizedAddonResponseJsonApi, ConfiguredAddon, @@ -7,8 +8,7 @@ import { OperationInvocation, ResourceReferenceJsonApi, UserReferenceJsonApi, -} from '@shared/models'; -import { AsyncStateModel } from '@shared/models/store'; +} from '@osf/shared/models'; export interface AddonsStateModel { storageAddons: AsyncStateModel; diff --git a/src/app/shared/stores/institutions/institutions.model.ts b/src/app/shared/stores/institutions/institutions.model.ts index aaa403afb..13fb7e854 100644 --- a/src/app/shared/stores/institutions/institutions.model.ts +++ b/src/app/shared/stores/institutions/institutions.model.ts @@ -1,5 +1,4 @@ -import { Institution } from '@shared/models'; -import { AsyncStateWithTotalCount } from '@shared/models/store/async-state-with-total-count.model'; +import { AsyncStateWithTotalCount, Institution } from '@osf/shared/models'; export interface InstitutionsStateModel { userInstitutions: Institution[]; diff --git a/src/app/shared/stores/institutions/institutions.state.ts b/src/app/shared/stores/institutions/institutions.state.ts index 5e9691d07..29728f2bb 100644 --- a/src/app/shared/stores/institutions/institutions.state.ts +++ b/src/app/shared/stores/institutions/institutions.state.ts @@ -5,8 +5,10 @@ import { catchError, tap, throwError } from 'rxjs'; import { inject, Injectable } from '@angular/core'; -import { InstitutionsService } from '@shared/services'; -import { FetchInstitutions, FetchUserInstitutions, InstitutionsStateModel } from '@shared/stores'; +import { InstitutionsService } from '@osf/shared/services'; + +import { FetchInstitutions, FetchUserInstitutions } from './institutions.actions'; +import { InstitutionsStateModel } from './institutions.model'; @State({ name: 'institutions', diff --git a/src/app/shared/stores/node-links/node-links.model.ts b/src/app/shared/stores/node-links/node-links.model.ts index bea7e5870..f6f6eaf6a 100644 --- a/src/app/shared/stores/node-links/node-links.model.ts +++ b/src/app/shared/stores/node-links/node-links.model.ts @@ -1,5 +1,5 @@ import { AsyncStateModel, ComponentOverview } from '@osf/shared/models'; -import { NodeLink } from '@shared/models/node-links'; +import { NodeLink } from '@osf/shared/models/node-links'; export interface NodeLinksStateModel { nodeLinks: AsyncStateModel; diff --git a/src/app/shared/stores/node-links/node-links.state.ts b/src/app/shared/stores/node-links/node-links.state.ts index 87fd15358..aba25b716 100644 --- a/src/app/shared/stores/node-links/node-links.state.ts +++ b/src/app/shared/stores/node-links/node-links.state.ts @@ -4,7 +4,7 @@ import { catchError, forkJoin, tap, throwError } from 'rxjs'; import { inject, Injectable } from '@angular/core'; -import { NodeLinksService } from '@shared/services/node-links.service'; +import { NodeLinksService } from '@osf/shared/services'; import { ClearNodeLinks, diff --git a/src/app/shared/stores/projects/projects.model.ts b/src/app/shared/stores/projects/projects.model.ts index 0217d4149..4112568ca 100644 --- a/src/app/shared/stores/projects/projects.model.ts +++ b/src/app/shared/stores/projects/projects.model.ts @@ -1,5 +1,5 @@ -import { AsyncStateModel } from '@shared/models'; -import { Project } from '@shared/models/projects'; +import { AsyncStateModel } from '@osf/shared/models'; +import { Project } from '@osf/shared/models/projects'; export interface ProjectsStateModel { projects: AsyncStateModel; diff --git a/src/app/shared/stores/projects/projects.state.ts b/src/app/shared/stores/projects/projects.state.ts index 304d5793e..2e78b9186 100644 --- a/src/app/shared/stores/projects/projects.state.ts +++ b/src/app/shared/stores/projects/projects.state.ts @@ -6,13 +6,9 @@ import { inject, Injectable } from '@angular/core'; import { handleSectionError } from '@core/handlers'; import { ProjectsService } from '@shared/services/projects.service'; -import { - ClearProjects, - GetProjects, - ProjectsStateModel, - SetSelectedProject, - UpdateProjectMetadata, -} from '@shared/stores'; + +import { ClearProjects, GetProjects, SetSelectedProject, UpdateProjectMetadata } from './projects.actions'; +import { ProjectsStateModel } from './projects.model'; const PROJECTS_DEFAULTS: ProjectsStateModel = { projects: { diff --git a/src/app/shared/stores/regions/regions.state.ts b/src/app/shared/stores/regions/regions.state.ts index 177b873c7..8458c713d 100644 --- a/src/app/shared/stores/regions/regions.state.ts +++ b/src/app/shared/stores/regions/regions.state.ts @@ -5,8 +5,8 @@ import { catchError, tap } from 'rxjs'; import { inject, Injectable } from '@angular/core'; -import { handleSectionError } from '@core/handlers'; -import { RegionsService } from '@shared/services'; +import { handleSectionError } from '@osf/core/handlers'; +import { RegionsService } from '@osf/shared/services'; import { FetchRegions } from './regions.actions'; import { RegionsStateModel } from './regions.model'; diff --git a/src/app/shared/stores/view-only-links/view-only-link.model.ts b/src/app/shared/stores/view-only-links/view-only-link.model.ts index a016c5636..580998a8d 100644 --- a/src/app/shared/stores/view-only-links/view-only-link.model.ts +++ b/src/app/shared/stores/view-only-links/view-only-link.model.ts @@ -1,5 +1,4 @@ -import { NodeData, PaginatedViewOnlyLinksModel } from '@shared/models'; -import { AsyncStateModel } from '@shared/models/store'; +import { AsyncStateModel, NodeData, PaginatedViewOnlyLinksModel } from '@osf/shared/models'; export interface ViewOnlyLinkStateModel { viewOnlyLinks: AsyncStateModel; diff --git a/src/app/shared/stores/view-only-links/view-only-link.state.ts b/src/app/shared/stores/view-only-links/view-only-link.state.ts index 2e6735971..e9e3a4231 100644 --- a/src/app/shared/stores/view-only-links/view-only-link.state.ts +++ b/src/app/shared/stores/view-only-links/view-only-link.state.ts @@ -6,8 +6,8 @@ import { catchError, tap } from 'rxjs/operators'; import { inject, Injectable } from '@angular/core'; +import { NodeData, PaginatedViewOnlyLinksModel } from '@osf/shared/models'; import { ViewOnlyLinksService } from '@osf/shared/services'; -import { NodeData, PaginatedViewOnlyLinksModel } from '@shared/models'; import { CreateViewOnlyLink,