Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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', () => {
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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', () => {
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/app/shared/stores/addons/addons.models.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import {
Addon,
AsyncStateModel,
AuthorizedAddon,
AuthorizedAddonResponseJsonApi,
ConfiguredAddon,
ConfiguredAddonResponseJsonApi,
OperationInvocation,
ResourceReferenceJsonApi,
UserReferenceJsonApi,
} from '@shared/models';
import { AsyncStateModel } from '@shared/models/store';
} from '@osf/shared/models';

export interface AddonsStateModel {
storageAddons: AsyncStateModel<Addon[]>;
Expand Down
3 changes: 1 addition & 2 deletions src/app/shared/stores/institutions/institutions.model.ts
Original file line number Diff line number Diff line change
@@ -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[];
Expand Down
6 changes: 4 additions & 2 deletions src/app/shared/stores/institutions/institutions.state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<InstitutionsStateModel>({
name: 'institutions',
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/stores/node-links/node-links.model.ts
Original file line number Diff line number Diff line change
@@ -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<NodeLink[]>;
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/stores/node-links/node-links.state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/app/shared/stores/projects/projects.model.ts
Original file line number Diff line number Diff line change
@@ -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<Project[]>;
Expand Down
10 changes: 3 additions & 7 deletions src/app/shared/stores/projects/projects.state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
4 changes: 2 additions & 2 deletions src/app/shared/stores/regions/regions.state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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<PaginatedViewOnlyLinksModel>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down