Skip to content

Commit

Permalink
AG-1703: use existing agora-testing library rather than creating a ne…
Browse files Browse the repository at this point in the history
…w agora-mocks library, fix handlers in agora-testing
  • Loading branch information
hallieswan committed Mar 6, 2025
1 parent d994555 commit 6926ac2
Show file tree
Hide file tree
Showing 16 changed files with 65 additions and 166 deletions.
1 change: 1 addition & 0 deletions libs/agora/genes/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default {
},
],
},
testEnvironment: 'jest-fixed-jsdom',
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { synapseWikiMock } from '@sagebionetworks/agora/mocks';
import { SynapseApiService } from '@sagebionetworks/agora/services';
import { synapseWikiMock } from '@sagebionetworks/agora/testing';
import { render, screen, waitFor } from '@testing-library/angular';
import userEvent from '@testing-library/user-event';
import { ButtonModule } from 'primeng/button';
Expand Down
41 changes: 0 additions & 41 deletions libs/agora/mocks/.eslintrc.json

This file was deleted.

3 changes: 0 additions & 3 deletions libs/agora/mocks/README.md

This file was deleted.

20 changes: 0 additions & 20 deletions libs/agora/mocks/project.json

This file was deleted.

1 change: 0 additions & 1 deletion libs/agora/mocks/src/index.ts

This file was deleted.

8 changes: 0 additions & 8 deletions libs/agora/mocks/src/lib/synapse-mocks.ts

This file was deleted.

25 changes: 0 additions & 25 deletions libs/agora/mocks/tsconfig.json

This file was deleted.

18 changes: 0 additions & 18 deletions libs/agora/mocks/tsconfig.lib.json

This file was deleted.

1 change: 1 addition & 0 deletions libs/agora/services/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = {
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {},
coverageDirectory: '../../../coverage/libs/agora/services',
testEnvironment: 'jest-fixed-jsdom',
transform: {
'^.+\\.(ts|mjs|js|html)$': [
'jest-preset-angular',
Expand Down
6 changes: 3 additions & 3 deletions libs/agora/services/src/lib/synapse-api.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
// -------------------------------------------------------------------------- //
// External
// -------------------------------------------------------------------------- //
import { TestBed } from '@angular/core/testing';
import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing';
import { TestBed } from '@angular/core/testing';

// -------------------------------------------------------------------------- //
// Internal
// -------------------------------------------------------------------------- //
import { SynapseApiService } from './synapse-api.service';
import { synapseWikiMock } from '@sagebionetworks/agora/mocks';
import { provideHttpClient } from '@angular/common/http';
import { synapseWikiMock } from '@sagebionetworks/agora/testing';
import { SynapseApiService } from './synapse-api.service';

// -------------------------------------------------------------------------- //
// Tests
Expand Down
4 changes: 2 additions & 2 deletions libs/agora/testing/src/lib/mocks/team-mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

import {
Team,
TeamsList as TeamsResponse,
TeamMember,
TeamsList as TeamsResponse,
} from '@sagebionetworks/agora/api-client-angular';

export const mockTeamMember: TeamMember = {
isPrimaryInvestigator: true,
isprimaryinvestigator: true,
name: 'Philip De Jager',
url: 'http://www.cumc.columbia.edu/dept/taub/faculty-dejager.html',
};
Expand Down
6 changes: 3 additions & 3 deletions libs/agora/testing/src/lib/mocks/team-service-mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ export class MockTeamService extends TeamsService {
program: 'Test Program',
description: 'Test Description',
members: [
{ name: 'John Doe', isPrimaryInvestigator: true },
{ name: 'Jane Smith', isPrimaryInvestigator: false },
{ name: 'Alice Johnson', isPrimaryInvestigator: true },
{ name: 'John Doe', isprimaryinvestigator: true },
{ name: 'Jane Smith', isprimaryinvestigator: false },
{ name: 'Alice Johnson', isprimaryinvestigator: true },
],
});
}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"express": "~4.18.2",
"file-saver": "2.0.5",
"glob": "11.0.0",
"jest-fixed-jsdom": "0.0.9",
"json5": "2.2.3",
"lodash": "4.17.21",
"mariadb": "3.3.1",
Expand Down
Loading

0 comments on commit 6926ac2

Please sign in to comment.