Skip to content

Commit

Permalink
Merge branch '10391-dynamo-migrations-kysely-aurora-rds-tokens' of gi…
Browse files Browse the repository at this point in the history
…thub.com:flexion/ef-cms into 10391-dynamo-migrations-kysely-aurora-rds-tokens
  • Loading branch information
codyseibert committed Sep 6, 2024
2 parents 7ba66a5 + bba1fe0 commit d5198b9
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions web-api/jest-unit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const config: Config = {
'!src/persistence/sqs/getMessages.ts',
'!src/persistence/messages/*.ts',
'!src/persistence/dynamo/**/*.ts',
'!src/persistence/postgres/**/*.ts',
'!src/lambdas/websockets/websockets.ts',
'!src/lambdas/websockets/switch-colors-cron.ts',
'!src/lambdas/cognitoAuthorizer/worker-handler.ts',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
CASE_STATUS_TYPES,
DOCKET_SECTION,
PETITIONS_SECTION,
ROLES,
} from '../../../../../shared/src/business/entities/EntityConstants';
import { UnauthorizedError } from '@web-api/errors/errors';
import { applicationContext } from '../../../../../shared/src/business/test/createTestApplicationContext';
Expand Down Expand Up @@ -55,10 +54,6 @@ describe('getCompletedMessagesForSectionInteractor', () => {
toSection: PETITIONS_SECTION,
toUserId: 'b427ca37-0df1-48ac-94bb-47aed073d6f7',
};
applicationContext.getCurrentUser.mockReturnValue({
role: ROLES.petitionsClerk,
userId: 'b9fcabc8-3c83-4cbf-9f4a-d2ecbdc591e1',
});

(getCompletedSectionInboxMessages as jest.Mock).mockReturnValue([
messageData,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import '@web-api/persistence/postgres/messages/mocks.jest';
import {
CASE_STATUS_TYPES,
PETITIONS_SECTION,
ROLES,
} from '../../../../../shared/src/business/entities/EntityConstants';
import { UnauthorizedError } from '@web-api/errors/errors';
import { applicationContext } from '../../../../../shared/src/business/test/createTestApplicationContext';
Expand Down Expand Up @@ -55,10 +54,6 @@ describe('getCompletedMessagesForUserInteractor', () => {
toSection: PETITIONS_SECTION,
toUserId: 'b427ca37-0df1-48ac-94bb-47aed073d6f7',
};
applicationContext.getCurrentUser.mockReturnValue({
role: ROLES.petitionsClerk,
userId: 'b9fcabc8-3c83-4cbf-9f4a-d2ecbdc591e1',
});

(getCompletedUserInboxMessages as jest.Mock).mockReturnValue([messageData]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import '@web-api/persistence/postgres/cases/mocks.jest';
import '@web-api/persistence/postgres/messages/mocks.jest';
import { applicationContext } from '../../../../../shared/src/business/test/createTestApplicationContext';
import { processCaseEntries } from './processCaseEntries';
import { upsertCase } from '@web-api/persistence/postgres/cases/upsertCase';
jest.mock('@web-api/persistence/postgres/cases/upsertCase');

describe('processCaseEntries', () => {
const mockCaseRecord = {
Expand Down Expand Up @@ -31,6 +33,8 @@ describe('processCaseEntries', () => {
applicationContext
.getPersistenceGateway()
.getCaseMetadataWithCounsel.mockReturnValue(mockCaseRecord);

(upsertCase as jest.Mock).mockResolvedValue(undefined);
});

it('should do nothing when no case records are found', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ import { applicationContext } from '../../../../../shared/src/business/test/crea
import { processMessageEntries } from './processMessageEntries';
import { upsertMessage } from '@web-api/persistence/postgres/messages/upsertMessage';

jest.mock('@web-api/persistence/postgres/messages/upsertMessage');

describe('processMessageEntries', () => {
beforeEach(() => {
(upsertMessage as jest.Mock).mockResolvedValue(undefined);
});

it('should attempt to store the messages using the upsert method', async () => {
const mockRepliedToMessageRecord = {
dynamodb: {
Expand Down

0 comments on commit d5198b9

Please sign in to comment.