Skip to content

Commit

Permalink
Update types, removes unneaded async in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
wjames111 committed Aug 22, 2024
1 parent ff44dff commit 26179f5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/components/Tool/FixPhoneNumbers/FixPhoneNumbers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ interface Props {
}

export interface FormValuesPerson extends PersonInvalidNumberFragment {
newPhoneNumber: PersonPhoneNumberFragment | string;
newPhoneNumber: string;
isNewPhoneNumber: boolean;
}

Expand Down
6 changes: 3 additions & 3 deletions src/components/Tool/FixPhoneNumbers/helper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const testData = [
];

describe('FixPhoneNumbers-helper', () => {
it('Should return a Contact with all phoneNumbers', async () => {
it('Should return a Contact with all phoneNumbers', () => {
const result = determineBulkDataToSend(testData[0], 'MPDX');
expect(result).toEqual([
{
Expand Down Expand Up @@ -102,7 +102,7 @@ describe('FixPhoneNumbers-helper', () => {
},
]);
});
it('Should still return a Contact with all phoneNumbers', async () => {
it('Should still return a Contact with all phoneNumbers', () => {
const result = determineBulkDataToSend(testData[1], 'MPDX');
expect(result).toEqual([
{
Expand Down Expand Up @@ -130,7 +130,7 @@ describe('FixPhoneNumbers-helper', () => {
},
]);
});
it('Should return an empty array', async () => {
it('Should return an empty array', () => {
const result = determineBulkDataToSend(testData[0], 'DataServer');
expect(result).toEqual([]);
});
Expand Down
20 changes: 7 additions & 13 deletions src/components/Tool/FixPhoneNumbers/helper.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import {
PersonPhoneNumberInput,
PersonUpdateInput,
} from 'src/graphql/types.generated';
import { PersonUpdateInput } from 'src/graphql/types.generated';
import { FormValuesPerson } from './FixPhoneNumbers';

export const determineBulkDataToSend = (
Expand All @@ -17,15 +14,12 @@ export const determineBulkDataToSend = (
if (primaryNumber) {
dataToSend.push({
id: value.id,
phoneNumbers: value.phoneNumbers.nodes.map(
(number) =>
({
id: number.id,
primary: number.id === primaryNumber.id,
number: number.number,
validValues: true,
} as PersonPhoneNumberInput),
),
phoneNumbers: value.phoneNumbers.nodes.map((number) => ({
id: number.id,
primary: number.id === primaryNumber.id,
number: number.number,
validValues: true,
})),
});
}
});
Expand Down

0 comments on commit 26179f5

Please sign in to comment.