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
12 changes: 12 additions & 0 deletions __tests__/Unit/Components/Tabs/Tab.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,18 @@ describe('Tabs Component', () => {
expect(doneBtn).toHaveClass('active');
});

it('Check if correct button is selected', () => {
render(
<Tabs
tabs={TABS}
activeTab={Tab.COMPLETED}
onSelect={onSelectMock}
/>
);
const completedBtn = screen.getByRole('button', { name: /COMPLETED/i });
expect(completedBtn).toHaveClass('active');
});

it('Check if correct button is selected when dev is true', () => {
render(
<Tabs
Expand Down
1 change: 1 addition & 0 deletions __tests__/Unit/utils/getActiveTab.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe('Unit | Util | Get Active Tab', () => {
expect(getActiveTab('verified')).toEqual(Tab.VERIFIED);
expect(getActiveTab('merged')).toEqual(Tab.MERGED);
expect(getActiveTab('done')).toEqual(Tab.DONE);
expect(getActiveTab('completed')).toEqual(Tab.COMPLETED);
expect(getActiveTab('in-progress')).toEqual(Tab.IN_PROGRESS);
expect(getActiveTab('someRandomSection')).toEqual(Tab.ALL);
});
Expand Down
1 change: 1 addition & 0 deletions src/constants/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export const MAX_SEARCH_RESULTS = 1;
export const ERROR_MESSAGE = 'Something went wrong!';
export const STANDUP_SUBMISSION_SUCCESS = 'Standup submitted successfully';
export const COMPLETED = 'COMPLETED';
export const DONE = 'DONE';
export const AVAILABLE = 'AVAILABLE';
export const UNASSIGNED = 'UNASSIGNED';
Expand Down
1 change: 1 addition & 0 deletions src/constants/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const EMPTY_TASKS_DATA = {
MERGED: [],
OVERDUE: [],
DONE: [],
COMPLETED: [],
};

export const TASK_REQUEST_TYPES = {
Expand Down
2 changes: 2 additions & 0 deletions src/interfaces/task.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ enum Tab {
MERGED = 'MERGED',
OVERDUE = 'OVERDUE',
DONE = 'DONE',
COMPLETED = 'COMPLETED',
}

const TABS = Object.values(Tab);
Expand Down Expand Up @@ -137,6 +138,7 @@ export type TabTasksData = {
MERGED: task[];
OVERDUE: task[];
DONE: task[];
COMPLETED: task[];
};

export type CardTaskDetails = task & {
Expand Down
2 changes: 2 additions & 0 deletions src/utils/getActiveTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export const getActiveTab = (section?: string): Tab => {
return Tab.OVERDUE;
case 'done':
return Tab.DONE;
case 'completed':
return Tab.COMPLETED;
default:
return Tab.ALL;
}
Expand Down