diff --git a/src/__tests__/TaskTable/Selectors.test.js b/src/__tests__/TaskTable/Selectors.test.js index ef80bd975b..6bc8b99970 100644 --- a/src/__tests__/TaskTable/Selectors.test.js +++ b/src/__tests__/TaskTable/Selectors.test.js @@ -12,7 +12,7 @@ describe('get_task_by_wbsId', () => { }; const WbsTasksID = ['A','B']; const result = get_task_by_wbsId(WbsTasksID, mockTasks); - expect(result).toEqual([{ id: 2, wbsId: 'B' }]); + expect(result).toEqual([ { id: 1, wbsId: 'A' }, { id: 3, wbsId: 'A' }, { id: 2, wbsId: 'B' } ]); }); it('returns the correct tasks based on WbsTasksID', () => { @@ -26,7 +26,23 @@ describe('get_task_by_wbsId', () => { }; const WbsTasksID = ['A']; const result = get_task_by_wbsId(WbsTasksID, mockTasks); - expect(result).toEqual(undefined); + console.log("RESULT: "); + console.log(result) + expect(result).toEqual([{"id": 1, "wbsId": "A"}, {"id": 3, "wbsId": "A"}]); + }); + + it('returns an empty array when WbsTasksID is not found', () => { + const mockTasks = { + fetched: true, + taskItems: [ + { id: 1, wbsId: 'A' }, + { id: 2, wbsId: 'B' }, + { id: 3, wbsId: 'A' } + ] + }; + const WbsTasksID = ['C']; // WbsTasksID not found + const result = get_task_by_wbsId(WbsTasksID, mockTasks); + expect(result).toEqual([]); }); }); diff --git a/src/__tests__/TaskTable/TasksTable.test.js b/src/__tests__/TaskTable/TasksTable.test.js index 505115a596..e86f124f35 100644 --- a/src/__tests__/TaskTable/TasksTable.test.js +++ b/src/__tests__/TaskTable/TasksTable.test.js @@ -16,7 +16,7 @@ describe('TasksTable component', () => { const renderComponent = () => render( - + ); diff --git a/src/components/Projects/WBS/WBSDetail/EditTask/EditTaskModal.jsx b/src/components/Projects/WBS/WBSDetail/EditTask/EditTaskModal.jsx index 6edbc2c1e5..aad68e1137 100644 --- a/src/components/Projects/WBS/WBSDetail/EditTask/EditTaskModal.jsx +++ b/src/components/Projects/WBS/WBSDetail/EditTask/EditTaskModal.jsx @@ -275,7 +275,7 @@ function EditTaskModal(props) { }, [links]); return ( -
+
@@ -296,34 +296,38 @@ function EditTaskModal(props) { Task Name - {ReadOnlySectionWrapper( -