Skip to content

Commit

Permalink
chore: address comments V2
Browse files Browse the repository at this point in the history
  • Loading branch information
sergivalero20 committed Aug 16, 2024
1 parent 5ff3bf7 commit 28b14f9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe('Add instructor modal', () => {
expect(getByText('First name')).toBeInTheDocument();
expect(getByText('Last name')).toBeInTheDocument();
expect(getByText('Cancel')).toBeInTheDocument();
expect(getByText('Send invite')).toBeInTheDocument();
expect(getByText('Add instructor')).toBeInTheDocument();
});

test('Should handle input changes correctly', () => {
Expand Down Expand Up @@ -132,7 +132,7 @@ describe('Instructor modal - Request', () => {
);

const emailInput = getByPlaceholderText('Enter Email of the instructor');
const sendButton = getByText('Send invite');
const sendButton = getByText('Add instructor');

fireEvent.change(emailInput, { target: { value: '[email protected]' } });
fireEvent.click(sendButton);
Expand Down
2 changes: 1 addition & 1 deletion src/features/Instructors/AddInstructors/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ const AddInstructors = ({ isOpen, onClose }) => {
)}
<div className="d-flex justify-content-end">
<ModalCloseButton className="btntpz btn-text btn-tertiary mr-2" onClose={handleCloseModal}>Cancel</ModalCloseButton>
<Button type="submit" disabled={formState.instructor.email.length === 0} onClick={handleAddInstructor}>Send invite</Button>
<Button type="submit" disabled={formState.instructor.email.length === 0} onClick={handleAddInstructor}>Add instructor</Button>
</div>
</Form>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/features/Instructors/InstructorDetailTable/columns.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const columns = [
accessor: 'className',
Cell: ({ row }) => (
<LinkWithQuery
to={`/courses/${encodeURIComponent(row.original.masterCourseId)}/${encodeURIComponent(row.values.classId)}?previous=instructors`}
to={`/courses/${encodeURIComponent(row.original.masterCourseId)}/${encodeURIComponent(row.original.classId)}?previous=instructors`}
className="link"
>
{row.values.className}
Expand Down
4 changes: 2 additions & 2 deletions src/features/Instructors/ManageInstructors/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ const ManageInstructors = () => {
{ limit: false, class_id: classIdDecoded },
));
if (rowsSelected.length === 1) {
setToastMessage(`${rowsSelected[0]} has been successfully added to Class ${classInfo.className}`);
setToastMessage(`${rowsSelected[0]} has been successfully assigned to Class ${classInfo.className}`);
} else if (rowsSelected.length > 1) {
setToastMessage(`${rowsSelected.join()} have been successfully added to Class ${classInfo.className}`);
setToastMessage(`${rowsSelected.join()} have been successfully assigned to Class ${classInfo.className}`);
}
setShowToast(true);
} catch (error) {
Expand Down

0 comments on commit 28b14f9

Please sign in to comment.