Skip to content

Commit

Permalink
correct allotedHours to allottedHours
Browse files Browse the repository at this point in the history
  • Loading branch information
GlenDsza committed Nov 1, 2024
1 parent 87bb3c9 commit 8a1d68d
Show file tree
Hide file tree
Showing 20 changed files with 125 additions and 121 deletions.
2 changes: 1 addition & 1 deletion public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@
"successfulDeletion": "Action Item deleted successfully",
"title": "Action Items",
"category": "Category",
"allotedHours": "Alloted Hours",
"allottedHours": "Allotted Hours",
"latestDueDate": "Latest Due Date",
"earliestDueDate": "Earliest Due Date",
"updateActionItem": "Update Action Item",
Expand Down
2 changes: 1 addition & 1 deletion public/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@
"successfulDeletion": "Action supprimée avec succès",
"title": "Actions",
"category": "Catégorie",
"allotedHours": "Heures Attribuées",
"allottedHours": "Heures Attribuées",
"latestDueDate": "Date d'Échéance la Plus Récente",
"earliestDueDate": "Date d'Échéance la Plus Ancienne",
"updateActionItem": "Mettre à Jour l'Action",
Expand Down
2 changes: 1 addition & 1 deletion public/locales/hi/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@
"successfulDeletion": "क्रिया वस्तु सफलतापूर्वक हटाई गई",
"title": "क्रिया वस्तुएँ",
"category": "श्रेणी",
"allotedHours": "आवंटित घंटे",
"allottedHours": "आवंटित घंटे",
"latestDueDate": "नवीनतम समाप्ति तिथि",
"earliestDueDate": "प्रारंभिक समाप्ति तिथि",
"updateActionItem": "क्रिया वस्तु अपडेट करें",
Expand Down
2 changes: 1 addition & 1 deletion public/locales/sp/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@
"successfulDeletion": "Acción eliminada con éxito",
"title": "Acciones",
"category": "Categoría",
"allotedHours": "Horas Asignadas",
"allottedHours": "Horas Asignadas",
"latestDueDate": "Fecha de Vencimiento Más Reciente",
"earliestDueDate": "Fecha de Vencimiento Más Antigua",
"updateActionItem": "Actualizar Acción",
Expand Down
2 changes: 1 addition & 1 deletion public/locales/zh/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@
"successfulDeletion": "行动项删除成功",
"title": "行动项",
"category": "类别",
"allotedHours": "分配的小时",
"allottedHours": "分配的小时",
"latestDueDate": "最新截止日期",
"earliestDueDate": "最早截止日期",
"updateActionItem": "更新行动项",
Expand Down
10 changes: 5 additions & 5 deletions src/GraphQl/Mutations/ActionItemMutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import gql from 'graphql-tag';
* @param preCompletionNotes - Notes prior to completion.
* @param dueDate - Due date.
* @param eventId - Event to which the ActionItem is related.
* @param allotedHours - Hours alloted for the ActionItem.
* @param allottedHours - Hours allotted for the ActionItem.
*/

export const CREATE_ACTION_ITEM_MUTATION = gql`
Expand All @@ -19,7 +19,7 @@ export const CREATE_ACTION_ITEM_MUTATION = gql`
$preCompletionNotes: String
$dDate: Date
$eventId: ID
$allotedHours: Float
$allottedHours: Float
) {
createActionItem(
actionItemCategoryId: $actionItemCategoryId
Expand All @@ -29,7 +29,7 @@ export const CREATE_ACTION_ITEM_MUTATION = gql`
preCompletionNotes: $preCompletionNotes
dueDate: $dDate
eventId: $eventId
allotedHours: $allotedHours
allottedHours: $allottedHours
}
) {
_id
Expand Down Expand Up @@ -59,7 +59,7 @@ export const UPDATE_ACTION_ITEM_MUTATION = gql`
$dueDate: Date
$completionDate: Date
$isCompleted: Boolean
$allotedHours: Float
$allottedHours: Float
) {
updateActionItem(
id: $actionItemId
Expand All @@ -70,7 +70,7 @@ export const UPDATE_ACTION_ITEM_MUTATION = gql`
postCompletionNotes: $postCompletionNotes
dueDate: $dueDate
completionDate: $completionDate
allotedHours: $allotedHours
allottedHours: $allottedHours
isCompleted: $isCompleted
}
) {
Expand Down
4 changes: 2 additions & 2 deletions src/GraphQl/Queries/ActionItemQueries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const ACTION_ITEM_LIST = gql`
firstName
lastName
}
allotedHours
allottedHours
}
}
`;
Expand Down Expand Up @@ -170,7 +170,7 @@ export const ACTION_ITEMS_BY_USER = gql`
firstName
lastName
}
allotedHours
allottedHours
}
}
`;
2 changes: 1 addition & 1 deletion src/GraphQl/Queries/EventVolunteerQueries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const EVENT_VOLUNTEER_GROUP_LIST = gql`
_id
name
}
allotedHours
allottedHours
isCompleted
}
event {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const itemProps: InterfaceItemDeleteModalProps = {
completionDate: new Date('2044-09-03'),
isCompleted: true,
event: null,
allotedHours: 24,
allottedHours: 24,
assigner: {
_id: 'userId2',
firstName: 'Wilt',
Expand Down
106 changes: 53 additions & 53 deletions src/screens/OrganizationActionItems/ItemModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const itemProps: InterfaceItemModalProps[] = [
completionDate: new Date('2044-09-03'),
isCompleted: true,
event: null,
allotedHours: 24,
allottedHours: 24,
assigner: {
_id: 'userId2',
firstName: 'Wilt',
Expand Down Expand Up @@ -133,7 +133,7 @@ const itemProps: InterfaceItemModalProps[] = [
completionDate: new Date('2044-10-03'),
isCompleted: false,
event: null,
allotedHours: null,
allottedHours: null,
assigner: {
_id: 'userId2',
firstName: 'Wilt',
Expand Down Expand Up @@ -186,7 +186,7 @@ const itemProps: InterfaceItemModalProps[] = [
_id: 'eventId',
title: 'Event 1',
},
allotedHours: null,
allottedHours: null,
assigner: {
_id: 'userId2',
firstName: 'Wilt',
Expand Down Expand Up @@ -260,7 +260,7 @@ const itemProps: InterfaceItemModalProps[] = [
_id: 'eventId',
title: 'Event 1',
},
allotedHours: null,
allottedHours: null,
assigner: {
_id: 'userId2',
firstName: 'Wilt',
Expand Down Expand Up @@ -326,12 +326,12 @@ describe('Testing ItemModal', () => {
});

// Select Allotted Hours (try all options)
const allotedHours = screen.getByLabelText(t.allotedHours);
const allotedHoursOptions = ['', '-1', '9'];
const allottedHours = screen.getByLabelText(t.allottedHours);
const allottedHoursOptions = ['', '-1', '9'];

allotedHoursOptions.forEach((option) => {
fireEvent.change(allotedHours, { target: { value: option } });
expect(allotedHours).toHaveValue(parseInt(option) > 0 ? option : '');
allottedHoursOptions.forEach((option) => {
fireEvent.change(allottedHours, { target: { value: option } });
expect(allottedHours).toHaveValue(parseInt(option) > 0 ? option : '');
});

// Add Pre Completion Notes
Expand Down Expand Up @@ -388,12 +388,12 @@ describe('Testing ItemModal', () => {
});

// Select Allotted Hours (try all options)
const allotedHours = screen.getByLabelText(t.allotedHours);
const allotedHoursOptions = ['', '-1', '9'];
const allottedHours = screen.getByLabelText(t.allottedHours);
const allottedHoursOptions = ['', '-1', '9'];

allotedHoursOptions.forEach((option) => {
fireEvent.change(allotedHours, { target: { value: option } });
expect(allotedHours).toHaveValue(parseInt(option) > 0 ? option : '');
allottedHoursOptions.forEach((option) => {
fireEvent.change(allottedHours, { target: { value: option } });
expect(allottedHours).toHaveValue(parseInt(option) > 0 ? option : '');
});

// Add Pre Completion Notes
Expand Down Expand Up @@ -450,12 +450,12 @@ describe('Testing ItemModal', () => {
});

// Select Allotted Hours (try all options)
const allotedHours = screen.getByLabelText(t.allotedHours);
const allotedHoursOptions = ['', '-1', '9'];
const allottedHours = screen.getByLabelText(t.allottedHours);
const allottedHoursOptions = ['', '-1', '9'];

allotedHoursOptions.forEach((option) => {
fireEvent.change(allotedHours, { target: { value: option } });
expect(allotedHours).toHaveValue(parseInt(option) > 0 ? option : '');
allottedHoursOptions.forEach((option) => {
fireEvent.change(allottedHours, { target: { value: option } });
expect(allottedHours).toHaveValue(parseInt(option) > 0 ? option : '');
});

// Add Pre Completion Notes
Expand Down Expand Up @@ -490,12 +490,12 @@ describe('Testing ItemModal', () => {
fireEvent.click(categoryOption);

// Update Allotted Hours (try all options)
const allotedHours = screen.getByLabelText(t.allotedHours);
const allotedHoursOptions = ['', '-1', '19'];
const allottedHours = screen.getByLabelText(t.allottedHours);
const allottedHoursOptions = ['', '-1', '19'];

allotedHoursOptions.forEach((option) => {
fireEvent.change(allotedHours, { target: { value: option } });
expect(allotedHours).toHaveValue(parseInt(option) > 0 ? option : '');
allottedHoursOptions.forEach((option) => {
fireEvent.change(allottedHours, { target: { value: option } });
expect(allottedHours).toHaveValue(parseInt(option) > 0 ? option : '');
});

// Update Post Completion Notes
Expand Down Expand Up @@ -547,12 +547,12 @@ describe('Testing ItemModal', () => {
fireEvent.click(volunteerOption);

// Update Allotted Hours (try all options)
const allotedHours = screen.getByLabelText(t.allotedHours);
const allotedHoursOptions = ['', '-1', '19'];
const allottedHours = screen.getByLabelText(t.allottedHours);
const allottedHoursOptions = ['', '-1', '19'];

allotedHoursOptions.forEach((option) => {
fireEvent.change(allotedHours, { target: { value: option } });
expect(allotedHours).toHaveValue(parseInt(option) > 0 ? option : '');
allottedHoursOptions.forEach((option) => {
fireEvent.change(allottedHours, { target: { value: option } });
expect(allottedHours).toHaveValue(parseInt(option) > 0 ? option : '');
});

// Click Submit
Expand Down Expand Up @@ -599,12 +599,12 @@ describe('Testing ItemModal', () => {
fireEvent.click(groupOption);

// Update Allotted Hours (try all options)
const allotedHours = screen.getByLabelText(t.allotedHours);
const allotedHoursOptions = ['', '-1', '19'];
const allottedHours = screen.getByLabelText(t.allottedHours);
const allottedHoursOptions = ['', '-1', '19'];

allotedHoursOptions.forEach((option) => {
fireEvent.change(allotedHours, { target: { value: option } });
expect(allotedHours).toHaveValue(parseInt(option) > 0 ? option : '');
allottedHoursOptions.forEach((option) => {
fireEvent.change(allottedHours, { target: { value: option } });
expect(allottedHours).toHaveValue(parseInt(option) > 0 ? option : '');
});

// Click Submit
Expand Down Expand Up @@ -651,12 +651,12 @@ describe('Testing ItemModal', () => {
fireEvent.click(groupOption);

// Update Allotted Hours (try all options)
const allotedHours = screen.getByLabelText(t.allotedHours);
const allotedHoursOptions = ['', '-1', '19'];
const allottedHours = screen.getByLabelText(t.allottedHours);
const allottedHoursOptions = ['', '-1', '19'];

allotedHoursOptions.forEach((option) => {
fireEvent.change(allotedHours, { target: { value: option } });
expect(allotedHours).toHaveValue(parseInt(option) > 0 ? option : '');
allottedHoursOptions.forEach((option) => {
fireEvent.change(allottedHours, { target: { value: option } });
expect(allottedHours).toHaveValue(parseInt(option) > 0 ? option : '');
});

// Click Submit
Expand Down Expand Up @@ -696,12 +696,12 @@ describe('Testing ItemModal', () => {
fireEvent.click(memberOption);

// Update Allotted Hours (try all options)
const allotedHours = screen.getByLabelText(t.allotedHours);
const allotedHoursOptions = ['', '-1', '19'];
const allottedHours = screen.getByLabelText(t.allottedHours);
const allottedHoursOptions = ['', '-1', '19'];

allotedHoursOptions.forEach((option) => {
fireEvent.change(allotedHours, { target: { value: option } });
expect(allotedHours).toHaveValue(parseInt(option) > 0 ? option : '');
allottedHoursOptions.forEach((option) => {
fireEvent.change(allottedHours, { target: { value: option } });
expect(allottedHours).toHaveValue(parseInt(option) > 0 ? option : '');
});

// Update Due Date
Expand Down Expand Up @@ -729,27 +729,27 @@ describe('Testing ItemModal', () => {
it('Try adding negative Allotted Hours', async () => {
renderItemModal(link1, itemProps[0]);
expect(screen.getAllByText(t.createActionItem)).toHaveLength(2);
const allotedHours = screen.getByLabelText(t.allotedHours);
fireEvent.change(allotedHours, { target: { value: '-1' } });
const allottedHours = screen.getByLabelText(t.allottedHours);
fireEvent.change(allottedHours, { target: { value: '-1' } });

await waitFor(() => {
expect(allotedHours).toHaveValue('');
expect(allottedHours).toHaveValue('');
});

fireEvent.change(allotedHours, { target: { value: '' } });
fireEvent.change(allottedHours, { target: { value: '' } });

await waitFor(() => {
expect(allotedHours).toHaveValue('');
expect(allottedHours).toHaveValue('');
});

fireEvent.change(allotedHours, { target: { value: '0' } });
fireEvent.change(allottedHours, { target: { value: '0' } });
await waitFor(() => {
expect(allotedHours).toHaveValue('0');
expect(allottedHours).toHaveValue('0');
});

fireEvent.change(allotedHours, { target: { value: '19' } });
fireEvent.change(allottedHours, { target: { value: '19' } });
await waitFor(() => {
expect(allotedHours).toHaveValue('19');
expect(allottedHours).toHaveValue('19');
});
});

Expand Down
Loading

0 comments on commit 8a1d68d

Please sign in to comment.