Skip to content

Commit

Permalink
10339: update type for mock user; revert test changes;
Browse files Browse the repository at this point in the history
  • Loading branch information
nechama-krigsman committed Aug 16, 2024
1 parent dc1415d commit ce9f4b1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 70 deletions.
2 changes: 1 addition & 1 deletion shared/src/business/entities/PrivatePractitioner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export class PrivatePractitioner extends User {
public entityName: string;
public barNumber: string;
public firmName: string;
public representing: string;
public representing: string[];
public serviceIndicator: string;

constructor(rawUser, options?) {
Expand Down
26 changes: 4 additions & 22 deletions shared/src/test/mockUsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
} from '../business/entities/EntityConstants';
import { RawIrsPractitioner } from '@shared/business/entities/IrsPractitioner';
import { RawPractitioner } from '@shared/business/entities/Practitioner';
import { RawPrivatePractitioner } from '@shared/business/entities/PrivatePractitioner';
import { RawUser } from '@shared/business/entities/User';
import {
getJudgesChambers,
Expand Down Expand Up @@ -146,32 +147,13 @@ export const petitionerUser: RawUser = {
userId: 'd7d90c05-f6cd-442c-a168-202db587f16f',
};

export const privatePractitionerUser: RawPractitioner = {
admissionsDate: '',
admissionsStatus: '',
export const privatePractitionerUser: RawPrivatePractitioner = {
barNumber: 'BN1234',
birthYear: '',
contact: {
address1: '234 Main St',
address2: 'Apartment 4',
address3: 'Under the stairs',
city: 'Chicago',
country: COUNTRY_TYPES.DOMESTIC,
countryType: COUNTRY_TYPES.DOMESTIC,
phone: '+1 (555) 555-5555',
postalCode: '61234',
state: 'IL',
},
email: '[email protected]',
entityName: 'User',
firstName: '',
lastName: '',
firmName: 'Law offices of Private Practitioner',
name: 'Private Practitioner',
originalBarState: '',
practiceType: 'Private',
practitionerType: '',
representing: [],
role: ROLES.privatePractitioner,
section: 'privatePractitioner',
serviceIndicator: SERVICE_INDICATOR_TYPES.SI_PAPER,
userId: '330d4b65-620a-489d-8414-6623653ebc4f',
};
Expand Down
51 changes: 4 additions & 47 deletions web-api/src/persistence/dynamo/users/createUserRecords.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
import {
COUNTRY_TYPES,
ROLES,
SERVICE_INDICATOR_TYPES,
} from '@shared/business/entities/EntityConstants';
import { applicationContext } from '../../../../../shared/src/business/test/createTestApplicationContext';
import {
caseServicesSupervisorUser,
Expand Down Expand Up @@ -34,28 +29,9 @@ describe('createUserRecords', () => {
applicationContext.getDocumentClient().put.mock.calls[0][0],
).toMatchObject({
Item: {
barNumber: 'pt1234',
contact: {
address1: '234 Main St',
address2: 'Apartment 4',
address3: 'Under the stairs',
city: 'Chicago',
country: COUNTRY_TYPES.DOMESTIC,
countryType: COUNTRY_TYPES.DOMESTIC,
phone: '+1 (555) 555-5555',
postalCode: '61234',
state: 'IL',
},
email: '[email protected]',
entityName: 'User',
name: 'Private Practitioner',
pk: `user|${privatePractitionerUser.userId}`,
practiceType: 'Private',
role: ROLES.privatePractitioner,
section: 'privatePractitioner',
serviceIndicator: SERVICE_INDICATOR_TYPES.SI_PAPER,
sk: `user|${privatePractitionerUser.userId}`,
userId: '330d4b65-620a-489d-8414-6623653ebc4f',
...mockPrivatePractitionerUser,
pk: `user|${mockPrivatePractitionerUser.userId}`,
sk: `user|${mockPrivatePractitionerUser.userId}`,
},
});
expect(
Expand Down Expand Up @@ -194,28 +170,9 @@ describe('createUserRecords', () => {
applicationContext.getDocumentClient().put.mock.calls[0][0],
).toMatchObject({
Item: {
barNumber: undefined,
contact: {
address1: '234 Main St',
address2: 'Apartment 4',
address3: 'Under the stairs',
city: 'Chicago',
country: COUNTRY_TYPES.DOMESTIC,
countryType: COUNTRY_TYPES.DOMESTIC,
phone: '+1 (555) 555-5555',
postalCode: '61234',
state: 'IL',
},
email: '[email protected]',
entityName: 'User',
name: 'Private Practitioner',
...privatePractitionerUserWithoutBarNumber,
pk: `user|${privatePractitionerUserWithoutBarNumber.userId}`,
practiceType: 'Private',
role: ROLES.privatePractitioner,
section: 'privatePractitioner',
serviceIndicator: SERVICE_INDICATOR_TYPES.SI_PAPER,
sk: `user|${privatePractitionerUserWithoutBarNumber.userId}`,
userId: '330d4b65-620a-489d-8414-6623653ebc4f',
},
});
});
Expand Down

0 comments on commit ce9f4b1

Please sign in to comment.