Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
7b59ebd
Added test cases for monthlyDashboardDataReducer
sheetalmangate Nov 24, 2024
7ac56eb
Added test cases for teamsTeamMembersReducer
sheetalmangate Dec 21, 2024
a4d7edd
frontend for event participation analysis
nishitag5 Jan 18, 2025
274acaa
test cases for action weeklySummaries
sheetalmangate Jan 18, 2025
64beaf2
file name changes
sheetalmangate Jan 19, 2025
128baf6
Merge branch 'development' of github.com:OneCommunityGlobal/HighestGo…
sheetalmangate Jan 19, 2025
363a609
Added suggested review changes
sheetalmangate Jan 19, 2025
bbda4bd
spelling correction for return
sheetalmangate Jan 19, 2025
f7f8dd8
fixing the alignment issue in colimns of list view
nishitag5 Jan 25, 2025
45dc43a
Test cases for weeklySummariesReportAction
sheetalmangate Feb 2, 2025
8e678ea
Merge branch 'development' into nishita_design_the_landing_page_for_e…
nishitag5 Feb 10, 2025
9328e67
Merge branch 'development' into nishita_design_the_landing_page_for_e…
nishitag5 Feb 10, 2025
d6aba00
Add validation check for file upload before sending email
ShraddhaShahari Feb 11, 2025
64e53db
Add validation check for file upload before sending email [remove ext…
ShraddhaShahari Feb 11, 2025
a82359d
Added asterisk for the users to identify them as mandatory fields. Ad…
ziddigsm Mar 14, 2025
d0b1315
resolved merge conflicts
ziddigsm Mar 14, 2025
ef90049
Merge branch 'development' into Shraddha-fix-send-out-emails-from-sen…
ShraddhaShahari Mar 28, 2025
e3d577a
fixing dark mode
nishitag5 Apr 12, 2025
6957092
pdf share
SammanBaidya Apr 12, 2025
5a059b0
Dhrumil-added-test-cases-ToggleSwitch
ddshah878 Apr 18, 2025
547e573
Merge branch 'development' of github.com:OneCommunityGlobal/HighestGo…
sheetalmangate Apr 19, 2025
6787262
pdf share change
SammanBaidya Apr 24, 2025
8b6773e
implemented changes suggested in review comment by Nahiyan-16
sheetalmangate Apr 25, 2025
44c5296
pdf share
SammanBaidya May 3, 2025
80a16e2
fixed merge conflicts
ziddigsm May 4, 2025
d2d0de2
Barnaboss Fix Lint errors in TaskEditSuggestions
barnaboss305 May 4, 2025
a66da0f
Made additional changes to **/_tests__**
barnaboss305 May 4, 2025
8a0c759
fix: darkmode issue
SammanBaidya May 6, 2025
fd50962
Add x-ray label and change characters color in dark mode
May 9, 2025
1aa2cf7
Fix eslint error
May 9, 2025
4773107
Fix eslint error
May 9, 2025
eb374ef
fix
suaniii Dec 8, 2024
fa2f185
sundar_fix_unit_test_ForcePasswordUpdate.jsx
sundarmachani May 10, 2025
1814079
sundar_fix_CI_heap_out_of_memory
sundarmachani May 10, 2025
5ce13ad
sundar_fix_CI_heap_out_of_memory_v2
sundarmachani May 10, 2025
f0b9a1f
Merge pull request #3148 from OneCommunityGlobal/Shraddha-fix-send-ou…
one-community May 10, 2025
7ae9639
Merge pull request #3477 from OneCommunityGlobal/Barnaboss-Fix-Lint-T…
EvianTan May 10, 2025
d308ba6
Merge pull request #2893 from OneCommunityGlobal/sheetal-unit-test-mo…
one-community May 12, 2025
a27b9f9
Merge pull request #3119 from OneCommunityGlobal/sheetal-unit-test-we…
one-community May 12, 2025
bcc2a48
Merge pull request #3057 from OneCommunityGlobal/sheetal-unit-tests-w…
one-community May 12, 2025
ac07973
Merge pull request #2973 from OneCommunityGlobal/sheetal-unit-test-te…
one-community May 12, 2025
d315a09
Merge pull request #3508 from OneCommunityGlobal/sundar_fix_CI_tests
one-community May 12, 2025
7085b33
Merge pull request #2933 from OneCommunityGlobal/yili_fix_team_code_p…
one-community May 12, 2025
01b9536
Fix label color in dark mode
May 12, 2025
cde33c3
fixed merge conflicts
ziddigsm May 13, 2025
3115104
Merge pull request #3407 from OneCommunityGlobal/Samman-sharepdf
one-community May 14, 2025
5e485ad
Merge pull request #3421 from OneCommunityGlobal/Dhrumil---Added-test…
one-community May 14, 2025
1316551
Revert "Shraddha Shahari - Fix the inability to send out emails from …
one-community May 14, 2025
d3192e1
Merge pull request #3524 from OneCommunityGlobal/revert-3148-Shraddha…
one-community May 14, 2025
fa85689
Merge pull request #3498 from OneCommunityGlobal/guirong-team-stats-c…
one-community May 15, 2025
64ea776
Merge branch 'development' into Ziddi-asterisk-addition-to-forms
ziddigsm May 15, 2025
4a5a612
pipeline fail fix
ziddigsm May 15, 2025
439b422
pipeline fail fix
ziddigsm May 15, 2025
cab99c6
pipeline fail fix
ziddigsm May 15, 2025
4d4a779
Merge pull request #3274 from OneCommunityGlobal/Ziddi-asterisk-addit…
one-community May 15, 2025
229da66
refactor(tasks): cleanup and rewrote tasks component
Ankuriboh May 15, 2025
01ab01a
fix(tests): fix now deprecated tests
Ankuriboh May 15, 2025
592bca4
fix(lint): fix lint issues
Ankuriboh May 15, 2025
1664ae8
Merge pull request #3531 from OneCommunityGlobal/newell-refactor-tasks
one-community May 15, 2025
54d0f6c
Merge pull request #3052 from OneCommunityGlobal/nishita_design_the_l…
one-community May 15, 2025
8faf23a
Fixed displaying data in the Name column of the table, and ensured na…
AnthonyWeathers May 16, 2025
0e09775
Updated explanation comment for changed lines regarding the change fr…
AnthonyWeathers May 16, 2025
59ec2b2
Merge pull request #3533 from OneCommunityGlobal/Anthony/Fix-Permissi…
one-community May 16, 2025
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
4 changes: 2 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ src/components/Badge/**
src/components/Dashboard/**
src/components/Projects/**
src/components/SummaryManagement/**
src/components/TaskEditSuggestions/**
src/components/TeamMemberTasks/**
src/components/Teams/TeamMembersPopup.jsx
src/components/UserManagement/**
src/components/UserProfile/**
src/components/UserProfile/**
src/components/Announcements/index.jsx
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ src/components/Memberships/**
src/components/Projects/**
src/components/Reports/**
src/components/SummaryManagement/**
src/components/TaskEditSuggestions/**
src/components/TeamMemberTasks/**
src/components/Timelog/**
src/components/UserManagement/**
Expand Down
17,365 changes: 7,195 additions & 10,170 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
"history": "^4.10.1",
"html-react-parser": "^1.4.14",
"html-to-pdfmake": "^2.0.6",
"html2canvas": "^1.4.1",
"joi": "^14.0.6",
"jspdf": "^3.0.1",
"jwt-decode": "^2.2.0",
"leaflet": "1.7.1",
"leaflet.heat": "^0.2.0",
Expand Down Expand Up @@ -84,7 +86,7 @@
"prestart": "npm run test",
"postinstall": "node ./postinstall.js",
"start": "react-scripts start",
"build": "npm run postinstall && set CI=false && react-scripts build",
"build": "npm run postinstall && cross-env GENERATE_SOURCEMAP=false CI=false react-scripts build",
"test": "cross-env CI=true react-scripts test --env=jest-environment-jsdom-sixteen",
"test:watch": " react-scripts test --env=jest-environment-jsdom-sixteen",
"test:coverage": "cross-env CI=true react-scripts test --env=jest-environment-jsdom-sixteen --coverage",
Expand Down
207 changes: 207 additions & 0 deletions src/actions/__tests__/weeklySummariesAction.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
import axios from 'axios';
import * as actions from '../../constants/weeklySummaries';
import { ENDPOINTS } from '../../utils/URL';
import { fetchWeeklySummariesBegin, fetchWeeklySummariesSuccess, fetchWeeklySummariesError, getWeeklySummaries, updateWeeklySummaries } from '../weeklySummaries'
import { getUserProfileActionCreator } from "../userProfile";


jest.mock('axios');


describe('Weekly Summaries Action',() => {

it('Should return action FETCH_WEEKLY_SUMMARIES_BEGIN', () => {

const data = fetchWeeklySummariesBegin();

expect(data).toEqual( {type: actions.FETCH_WEEKLY_SUMMARIES_BEGIN });

});

it('Should fetch weekly summaries success', () => {

const weeklySummariesData = {
id: 1,
dueDate: "2024-12-29",
summary: "Weekly Summary"
};

const result = fetchWeeklySummariesSuccess(weeklySummariesData);

const expecteResult = {
type: actions.FETCH_WEEKLY_SUMMARIES_SUCCESS,
payload : {weeklySummariesData}
}

expect(result).toEqual(expecteResult);

});

it('Should return action FETCH_WEEKLY_SUMMARIES_ERROR ', () => {

const error = {};
const result = fetchWeeklySummariesError(error);

expect(result).toEqual({
type: actions.FETCH_WEEKLY_SUMMARIES_ERROR,
payload: {error}
});
})

});

describe('Weekly Summaries', () => {

jest.mock('axios');
const dispatch = jest.fn();

beforeEach(() => {
jest.clearAllMocks();
});

describe('Get Weekly Summaries', () => {

it('Should dispatch actions and return status 200 on successful API call', async() => {

const mockData = {
weeklySummariesCount : 1,
weeklySummaries: [
{
id: "1",
dueDate: "2024-12-29",
summary: "Weekly Summary"
}
],
mediaUrl: 'http://media.com',
adminLinks: [{ Name: 'Media Folder', Link: 'http://newmedia.com' }]
}

axios.get.mockResolvedValue({ data: mockData, status:200 });

const result = await getWeeklySummaries(1)(dispatch);

expect(dispatch).toHaveBeenCalledWith(fetchWeeklySummariesBegin());
expect(dispatch).toHaveBeenCalledWith(fetchWeeklySummariesSuccess({
weeklySummariesCount:1,
weeklySummaries:[
{
id: "1",
dueDate: "2024-12-29",
summary: "Weekly Summary"
}
],
mediaUrl: 'http://newmedia.com'
}));

expect(dispatch).toHaveBeenCalledWith(getUserProfileActionCreator(mockData));
expect(result).toBe(200);

});

it('Should dispatch an error action when GET request fails', async() => {

const mockError = { response : { status: 500 } };
axios.get.mockRejectedValueOnce(mockError);

const result = await getWeeklySummaries(1)(dispatch);

expect(dispatch).toHaveBeenCalledWith(fetchWeeklySummariesBegin());
expect(dispatch).toHaveBeenCalledWith(fetchWeeklySummariesError(mockError));
expect(result).toBe(500);
})

});

describe('Update Weekly Summaries', () => {

it('Should successfully update weekly summaries and return status 200', async() => {

const mockUserProfile = {
firstName: 'User First Name',
lastName: 'User Last Name',
weeklySummariesCount : 0,
weeklySummaries:[]
}

const weeklySummariesData = {
weeklySummariesCount : 1,
weeklySummaries: [
{
id: "1",
dueDate: "2025-01-05",
summary: "Weekly Summary Week1"
},
],
mediaUrl: 'http://media.com'
}

axios.get.mockResolvedValue({ data: mockUserProfile });
axios.put.mockResolvedValue({ status: 200 });

const result = await updateWeeklySummaries(1, weeklySummariesData )(dispatch);
expect(result).toBe(200);
expect(axios.get).toHaveBeenCalledWith(ENDPOINTS.USER_PROFILE(1));
expect(axios.put).toHaveBeenCalled();
expect(dispatch).toHaveBeenCalledWith(getUserProfileActionCreator({
...mockUserProfile,
'adminLinks' : [{ Name: 'Media Folder', Link: 'http://media.com' }] ,
...weeklySummariesData
}));

});

it('Ensure that if the "Media Folder" link already exists, it should be updated correctly.', async() => {

const mockUserProfile = {
firstName: 'User First Name',
lastName: 'User Last Name',
weeklySummariesCount : 0,
weeklySummaries:[],
'adminLinks' : [{ Name: 'Media Folder', Link: 'http://media.com' }]
}

const weeklySummariesData = {
weeklySummariesCount : 1,
weeklySummaries: [
{
id: "1",
dueDate: "2025-01-05",
summary: "Weekly Summary Week1"
},
],
mediaUrl: 'http://newmedia.com'
}

axios.get.mockResolvedValue({ data: mockUserProfile });
axios.put.mockResolvedValue({ status: 200 });

const result = await updateWeeklySummaries(1, weeklySummariesData )(dispatch);
expect(result).toBe(200);
expect(axios.get).toHaveBeenCalledWith(ENDPOINTS.USER_PROFILE(1));
expect(axios.put).toHaveBeenCalled();
expect(dispatch).toHaveBeenCalledWith(getUserProfileActionCreator({
...mockUserProfile,
'adminLinks' : [{ Name: 'Media Folder', Link: 'http://newmedia.com' }] ,
...weeklySummariesData
}));

});

it('Should throw error when API request fails', async() => {

const mockError = { response : { status: 500 } };
axios.get.mockRejectedValueOnce(mockError);

const result = await updateWeeklySummaries(1, {
mediaUrl: 'http://newmedia.com',
weeklySummaries: [],
weeklySummariesCount: 2 })(dispatch);

expect(dispatch).not.toHaveBeenCalled();
expect(result).toBe(500);

});

});

});
Loading