Skip to content

Commit

Permalink
fix more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KjartanE committed Dec 20, 2023
1 parent d7629de commit a3424c7
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 32 deletions.
121 changes: 93 additions & 28 deletions api/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions api/src/repositories/submission-repository.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import {
ISpatialComponentCount,
PatchSubmissionRecord,
SubmissionRecord,
SubmissionRecordWithSecurity,
SubmissionRepository,
SubmissionWithSecurityRecord,
SUBMISSION_MESSAGE_TYPE,
SUBMISSION_STATUS_TYPE
} from './submission-repository';
Expand Down Expand Up @@ -914,6 +914,7 @@ describe('SubmissionRepository', () => {
source_system: 'SIMS',
name: 'name',
description: 'description',
publish_timestamp: '2023-12-12',
create_date: '2023-12-12',
create_user: 1,
update_date: null,
Expand All @@ -928,6 +929,7 @@ describe('SubmissionRepository', () => {
source_system: 'SIMS',
name: 'name',
description: 'description',
publish_timestamp: '2023-12-12',
create_date: '2023-12-12',
create_user: 1,
update_date: '2023-12-12',
Expand Down Expand Up @@ -963,6 +965,7 @@ describe('SubmissionRepository', () => {
source_system: 'SIMS',
name: 'name',
description: 'description',
publish_timestamp: '2023-12-12',
create_date: '2023-12-12',
create_user: 1,
update_date: null,
Expand All @@ -977,6 +980,7 @@ describe('SubmissionRepository', () => {
source_system: 'SIMS',
name: 'name',
description: 'description',
publish_timestamp: '2023-12-12',
create_date: '2023-12-12',
create_user: 1,
update_date: '2023-12-12',
Expand All @@ -1003,7 +1007,7 @@ describe('SubmissionRepository', () => {
});

it('should succeed with valid data', async () => {
const mockSubmissionRecords: SubmissionWithSecurityRecord[] = [
const mockSubmissionRecords: SubmissionRecordWithSecurity[] = [
{
submission_id: 1,
uuid: '123-456-789',
Expand All @@ -1013,6 +1017,7 @@ describe('SubmissionRepository', () => {
source_system: 'SIMS',
name: 'name',
description: 'description',
publish_timestamp: '2023-12-12',
create_date: '2023-12-12',
create_user: 1,
update_date: null,
Expand All @@ -1029,6 +1034,8 @@ describe('SubmissionRepository', () => {
name: 'name',
description: 'description',
create_date: '2023-12-12',
publish_timestamp: '2023-12-12',

create_user: 1,
update_date: '2023-12-12',
update_user: 1,
Expand All @@ -1044,6 +1051,7 @@ describe('SubmissionRepository', () => {
name: 'name',
description: 'description',
create_date: '2023-12-12',
publish_timestamp: '2023-12-12',
create_user: 1,
update_date: '2023-12-12',
update_user: 1,
Expand Down Expand Up @@ -1171,6 +1179,7 @@ describe('SubmissionRepository', () => {
source_system: 'SIMS',
name: 'name',
description: 'description',
publish_timestamp: '2023-12-12',
create_date: '2023-12-12',
create_user: 1,
update_date: null,
Expand Down Expand Up @@ -1205,6 +1214,7 @@ describe('SubmissionRepository', () => {
source_system: 'SIMS',
name: 'name',
description: 'description',
publish_timestamp: '2023-12-12',
create_date: '2023-12-12',
create_user: 1,
update_date: null,
Expand Down
13 changes: 11 additions & 2 deletions api/src/services/submission-service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import {
ISubmissionObservationRecord,
PatchSubmissionRecord,
SubmissionRecord,
SubmissionRecordWithSecurity,
SubmissionRepository,
SubmissionWithSecurityRecord,
SUBMISSION_MESSAGE_TYPE,
SUBMISSION_STATUS_TYPE
} from '../repositories/submission-repository';
Expand Down Expand Up @@ -772,6 +772,7 @@ describe('SubmissionService', () => {
source_system: 'SIMS',
name: 'name',
description: 'description',
publish_timestamp: '2023-12-12',
create_date: '2023-12-12',
create_user: 1,
update_date: null,
Expand All @@ -788,6 +789,7 @@ describe('SubmissionService', () => {
source_system: 'SIMS',
name: 'name',
description: 'description',
publish_timestamp: '2023-12-12',
create_date: '2023-12-12',
create_user: 1,
update_date: '2023-12-12',
Expand Down Expand Up @@ -824,6 +826,7 @@ describe('SubmissionService', () => {
source_system: 'SIMS',
name: 'name',
description: 'description',
publish_timestamp: '2023-12-12',
create_date: '2023-12-12',
create_user: 1,
update_date: null,
Expand All @@ -840,6 +843,7 @@ describe('SubmissionService', () => {
source_system: 'SIMS',
name: 'name',
description: 'description',
publish_timestamp: '2023-12-12',
create_date: '2023-12-12',
create_user: 1,
update_date: '2023-12-12',
Expand Down Expand Up @@ -878,6 +882,7 @@ describe('SubmissionService', () => {
source_system: 'string',
name: 'string',
description: null,
publish_timestamp: '2023-12-12',
create_date: 'string',
create_user: 1,
update_date: null,
Expand All @@ -899,7 +904,7 @@ describe('SubmissionService', () => {

describe('getReviewedSubmissionsWithSecurity', () => {
it('should return an array of submission records with security property', async () => {
const mockSubmissionRecords: SubmissionWithSecurityRecord[] = [
const mockSubmissionRecords: SubmissionRecordWithSecurity[] = [
{
submission_id: 1,
uuid: '123-456-789',
Expand All @@ -909,6 +914,7 @@ describe('SubmissionService', () => {
source_system: 'SIMS',
name: 'name',
description: 'description',
publish_timestamp: '2023-12-12',
create_date: '2023-12-12',
create_user: 1,
update_date: null,
Expand All @@ -924,6 +930,7 @@ describe('SubmissionService', () => {
source_system: 'SIMS',
name: 'name',
description: 'description',
publish_timestamp: '2023-12-12',
create_date: '2023-12-12',
create_user: 1,
update_date: '2023-12-12',
Expand All @@ -939,6 +946,7 @@ describe('SubmissionService', () => {
source_system: 'SIMS',
name: 'name',
description: 'description',
publish_timestamp: '2023-12-12',
create_date: '2023-12-12',
create_user: 1,
update_date: '2023-12-12',
Expand Down Expand Up @@ -1031,6 +1039,7 @@ describe('SubmissionService', () => {
source_system: 'SIMS',
name: 'name',
description: 'description',
publish_timestamp: '2023-12-12',
create_date: '2023-12-12',
create_user: 1,
update_date: null,
Expand Down

0 comments on commit a3424c7

Please sign in to comment.