Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev to Main Sync #1247

Merged
merged 27 commits into from
Sep 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d13cdab
fix: assign text box alignment it would be be appearing where the nam…
Achintya-Chatterjee Jul 31, 2024
ac7845a
feat: Update TaskDetails component and fix test for assignee input
Achintya-Chatterjee Jul 31, 2024
1e5b22e
refactor: make the superuser to false on test files
Achintya-Chatterjee Jul 31, 2024
62f7c49
refactor: Reintroduce getExtensionRequestLink function to TaskDetails…
Achintya-Chatterjee Jul 31, 2024
58050a7
fix: Resolve duplicate input field and suggestion box issues in TaskD…
Achintya-Chatterjee Jul 31, 2024
38d966d
fix: classname to be more generic
Achintya-Chatterjee Jul 31, 2024
e229123
refactor: test cases to use those old values
Achintya-Chatterjee Jul 31, 2024
729d676
fix: Ensure consistent width for suggestion box and refactor styles
Achintya-Chatterjee Aug 2, 2024
937f872
Fix: Assignee text box alignment (#1225)
Achintya-Chatterjee Aug 5, 2024
df3401c
Merge branch 'main' into develop
iamitprakash Aug 6, 2024
578749f
Corrected loading issue and extra space in standup submit (#1230)
skv93-coder Aug 9, 2024
9471dc1
fix: prevent Status field from being displayed twice in TaskDetails c…
Achintya-Chatterjee Aug 10, 2024
8dfba33
Merge branch 'develop' into fix/assignee-text-box
Achintya-Chatterjee Aug 10, 2024
9a4c6ae
fix: prevent Status field from being displayed twice in TaskDetails c…
Achintya-Chatterjee Aug 10, 2024
7bceba4
Merge pull request #1231 from Real-Dev-Squad/fix/assignee-text-box
Achintya-Chatterjee Aug 10, 2024
31f3308
Fix: Assignee text box alignment (#1225) (#1228) (#1234)
Achintya-Chatterjee Aug 13, 2024
f83dfa1
Merge branch 'develop'
Achintya-Chatterjee Aug 13, 2024
4bad9e4
Merge pull request #1237 from Real-Dev-Squad/fix/merge-conflicts
iamitprakash Aug 13, 2024
b5cb851
Refactor else condition (#1240)
skv93-coder Aug 15, 2024
62c38d7
Fature flag removal of TaskSearch improvement (#1165)
pallabez Sep 3, 2024
075a72e
Refactor `TaskDetails` Component for Improved Maintainability and Per…
Achintya-Chatterjee Sep 3, 2024
933e06d
Add Unit Tests for Refactored `TaskDetails` Subcomponents (#1245)
Achintya-Chatterjee Sep 3, 2024
d68aa66
fix: Resolved merge conflict in src/components/taskDetails/index.tsx
Achintya-Chatterjee Sep 3, 2024
c0e1a94
Dev to Main Sync (#1233) (#1248)
Achintya-Chatterjee Sep 3, 2024
615b997
Revert "Dev to Main Sync (#1233) (#1248)" (#1249)
iamitprakash Sep 3, 2024
b2db7cc
Merge branch 'develop' into fix/merge-conflicts
Achintya-Chatterjee Sep 3, 2024
a110b65
Merge pull request #1251 from Real-Dev-Squad/fix/merge-conflicts
iamitprakash Sep 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React from 'react';
import { fireEvent, render, screen } from '@testing-library/react';
import { Tab } from '@/interfaces/task.type';
import FilterModal from '@/components/tasks/TaskSearch/FilterModal';
import FilterDropdown from '@/components/tasks/TaskSearch/FilterDropdown';

const mockOnSelect = jest.fn();
const mockOnClose = jest.fn();

describe('FilterModal', () => {
describe('FilterDropdown', () => {
test('renders the modal with correct title and buttons', () => {
render(
<FilterModal
<FilterDropdown
tabs={[Tab.ASSIGNED, Tab.IN_PROGRESS]}
onSelect={mockOnSelect}
activeTab={Tab.ASSIGNED}
Expand All @@ -32,7 +32,7 @@ describe('FilterModal', () => {

test('renders the modal having overdue tab with correct title and buttons', () => {
render(
<FilterModal
<FilterDropdown
tabs={[Tab.ASSIGNED, Tab.IN_PROGRESS, Tab.OVERDUE]}
onSelect={mockOnSelect}
activeTab={Tab.OVERDUE}
Expand All @@ -56,10 +56,9 @@ describe('FilterModal', () => {
expect(overdueButton).toBeInTheDocument();
});

test('renders the modal with correct title and buttons when dev is true', () => {
test('renders the modal with correct title and buttons', () => {
render(
<FilterModal
dev={true}
<FilterDropdown
tabs={[Tab.UNASSIGNED, Tab.DONE]}
onSelect={mockOnSelect}
activeTab={Tab.UNASSIGNED}
Expand All @@ -82,7 +81,7 @@ describe('FilterModal', () => {

test('calls onSelect and onClose when a status button is clicked', () => {
render(
<FilterModal
<FilterDropdown
tabs={[Tab.ASSIGNED, Tab.IN_PROGRESS]}
onSelect={mockOnSelect}
activeTab={Tab.ASSIGNED}
Expand All @@ -98,7 +97,7 @@ describe('FilterModal', () => {

test('calls onClose when the close button is clicked', () => {
render(
<FilterModal
<FilterDropdown
tabs={[Tab.ASSIGNED, Tab.IN_PROGRESS]}
onSelect={mockOnSelect}
activeTab={Tab.ASSIGNED}
Expand All @@ -113,12 +112,11 @@ describe('FilterModal', () => {
});
test('calls onClose when clicked on outside', () => {
render(
<FilterModal
<FilterDropdown
tabs={[Tab.ASSIGNED, Tab.IN_PROGRESS]}
onSelect={mockOnSelect}
activeTab={Tab.ASSIGNED}
onClose={mockOnClose}
dev={true}
/>
);

Expand All @@ -138,12 +136,11 @@ describe('FilterModal', () => {
});
test('calls onClose when escape button is clicked', () => {
render(
<FilterModal
<FilterDropdown
tabs={[Tab.ASSIGNED, Tab.IN_PROGRESS]}
onSelect={mockOnSelect}
activeTab={Tab.ASSIGNED}
onClose={mockOnClose}
dev={true}
/>
);

Expand All @@ -154,7 +151,7 @@ describe('FilterModal', () => {

test('renders the modal with correct active tab', () => {
render(
<FilterModal
<FilterDropdown
tabs={[Tab.ASSIGNED, Tab.IN_PROGRESS]}
onSelect={mockOnSelect}
activeTab={Tab.ASSIGNED}
Expand All @@ -169,10 +166,9 @@ describe('FilterModal', () => {
expect(inProgressButton).not.toHaveClass('status-button-active');
});

test('renders the modal with correct active tab when dev is true', () => {
test('renders the modal with correct active tab', () => {
render(
<FilterModal
dev={true}
<FilterDropdown
tabs={[Tab.UNASSIGNED, Tab.DONE]}
onSelect={mockOnSelect}
activeTab={Tab.DONE}
Expand All @@ -187,10 +183,9 @@ describe('FilterModal', () => {
expect(unassignedButton).not.toHaveClass('status-button-active');
});

test('render the filter model having BACKLOG tab with correct title and buttons when dev is true', () => {
test('render the filter model having BACKLOG tab with correct title and buttons', () => {
render(
<FilterModal
dev={true}
<FilterDropdown
tabs={[Tab.UNASSIGNED, Tab.BACKLOG]}
onSelect={mockOnSelect}
activeTab={Tab.BACKLOG}
Expand All @@ -202,10 +197,9 @@ describe('FilterModal', () => {
expect(backlogButton).toBeInTheDocument();
});

test('onSelect Function Gets Called When the Backlog Status button is Clicked when dev is true', () => {
test('onSelect Function Gets Called When the Backlog Status button is Clicked', () => {
render(
<FilterModal
dev={true}
<FilterDropdown
tabs={[Tab.BACKLOG, Tab.IN_PROGRESS]}
onSelect={mockOnSelect}
activeTab={Tab.BACKLOG}
Expand All @@ -219,10 +213,9 @@ describe('FilterModal', () => {
expect(mockOnSelect).toHaveBeenCalledWith(Tab.BACKLOG);
});

test('Selection of the Backlog Button when dev is true', () => {
test('Selection of the Backlog Button', () => {
render(
<FilterModal
dev={true}
<FilterDropdown
tabs={[Tab.BACKLOG, Tab.DONE]}
onSelect={mockOnSelect}
activeTab={Tab.BACKLOG}
Expand Down
2 changes: 1 addition & 1 deletion __tests__/Unit/Components/Tasks/Option.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { render, fireEvent } from '@testing-library/react';
import Option from '@/components/tasks/TaskSearchDev/Suggestion/Option';
import Option from '@/components/tasks/TaskSearch/Suggestion/Option';

describe('Option component', () => {
const mockOnClickHandler = jest.fn();
Expand Down
2 changes: 1 addition & 1 deletion __tests__/Unit/Components/Tasks/Options.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { render, fireEvent } from '@testing-library/react';
import Options from '@/components/tasks/TaskSearchDev/Suggestion/Options';
import Options from '@/components/tasks/TaskSearch/Suggestion/Options';
import { TaskSearchOption } from '@/interfaces/searchOptions.type';

describe('Option component', () => {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/Unit/Components/Tasks/Pill.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { fireEvent, render, screen } from '@testing-library/react';
import RenderPills, {
PillProps,
} from '@/components/tasks/TaskSearchDev/Suggestion/Pill';
} from '@/components/tasks/TaskSearch/Suggestion/Pill';

describe('RenderPills', () => {
const setNewPillValue = jest.fn();
Expand Down
28 changes: 28 additions & 0 deletions __tests__/Unit/Components/Tasks/TaskDates.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { render, screen, fireEvent } from '@testing-library/react';
import { TaskDates } from '@/components/taskDetails/TaskDates';

const mockSetNewEndOnDate = jest.fn();
const mockHandleBlurOfEndsOn = jest.fn();

describe('TaskDates Component', () => {
it('should render input field for End On date when in editing mode', () => {
render(
<TaskDates
isEditing={true}
isUserAuthorized={true}
startedOn="2024-03-30T11:20:00Z"
endsOn={1700000000}
newEndOnDate="2024-03-30"
setNewEndOnDate={mockSetNewEndOnDate}
handleBlurOfEndsOn={mockHandleBlurOfEndsOn}
isExtensionRequestPending={false}
taskId="1"
/>
);

const input = screen.getByTestId('endsOnTaskDetails');
expect(input).toBeInTheDocument();
fireEvent.blur(input);
expect(mockHandleBlurOfEndsOn).toHaveBeenCalled();
});
});
96 changes: 0 additions & 96 deletions __tests__/Unit/Components/Tasks/TaskDependency.test.tsx

This file was deleted.

55 changes: 55 additions & 0 deletions __tests__/Unit/Components/Tasks/TaskDescription.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { render, screen, fireEvent } from '@testing-library/react';
import { TaskDescription } from '@/components/taskDetails/TaskDescription';

const mockHandleChange = jest.fn();

describe('TaskDescription Component', () => {
it('should renders the task description when not editing', () => {
render(
<TaskDescription
isEditing={false}
purpose="Test Purpose"
handleChange={mockHandleChange}
/>
);
expect(screen.getByText('Test Purpose')).toBeInTheDocument();
});

it('should renders "No description available" when purpose is empty', () => {
render(
<TaskDescription
isEditing={false}
purpose=""
handleChange={mockHandleChange}
/>
);
expect(
screen.getByText('No description available')
).toBeInTheDocument();
});

it('should renders textarea when in editing mode', () => {
render(
<TaskDescription
isEditing={true}
purpose="Test Purpose"
handleChange={mockHandleChange}
/>
);
expect(screen.getByTestId('purpose-textarea')).toBeInTheDocument();
});

it('should calls handleChange when textarea value changes', () => {
render(
<TaskDescription
isEditing={true}
purpose="Test Purpose"
handleChange={mockHandleChange}
/>
);
fireEvent.change(screen.getByTestId('purpose-textarea'), {
target: { value: 'New Purpose' },
});
expect(mockHandleChange).toHaveBeenCalled();
});
});
Loading
Loading