Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -58,8 +58,7 @@ describe('FilterModal', () => {

test('renders the modal with correct title and buttons when dev is true', () => {
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 @@ -171,8 +168,7 @@ describe('FilterModal', () => {

test('renders the modal with correct active tab when dev is true', () => {
render(
<FilterModal
dev={true}
<FilterDropdown
tabs={[Tab.UNASSIGNED, Tab.DONE]}
onSelect={mockOnSelect}
activeTab={Tab.DONE}
Expand All @@ -189,8 +185,7 @@ describe('FilterModal', () => {

test('render the filter model having BACKLOG tab with correct title and buttons when dev is true', () => {
render(
<FilterModal
dev={true}
<FilterDropdown
tabs={[Tab.UNASSIGNED, Tab.BACKLOG]}
onSelect={mockOnSelect}
activeTab={Tab.BACKLOG}
Expand All @@ -204,8 +199,7 @@ describe('FilterModal', () => {

test('onSelect Function Gets Called When the Backlog Status button is Clicked when dev is true', () => {
render(
<FilterModal
dev={true}
<FilterDropdown
tabs={[Tab.BACKLOG, Tab.IN_PROGRESS]}
onSelect={mockOnSelect}
activeTab={Tab.BACKLOG}
Expand All @@ -221,8 +215,7 @@ describe('FilterModal', () => {

test('Selection of the Backlog Button when dev is true', () => {
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
Loading