Skip to content

Commit 42ac941

Browse files
author
fangedShadow
committed
Merge remote-tracking branch 'origin/development' into bhavpreet_carousel_fix
2 parents 701c6db + 969f998 commit 42ac941

169 files changed

Lines changed: 9790 additions & 3432 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintignore

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,33 @@
1-
*.png
2-
*.svg
3-
*.test.js
4-
*.test.jsx
5-
src/actions/**
6-
src/App.css
7-
src/config.json
8-
9-
src/__tests__/**
1+
# =======================================================================
2+
# ⚠️ DO NOT ADD NEW ENTRIES ⚠️
3+
# Only the files and folders listed below are allowed to be ignored.
4+
# This .gitignore is locked down to maintain consistency across the team.
5+
# To propose changes, please open a discussion or PR with justification.
6+
# =======================================================================
107

8+
# Ignore build folders
9+
/node_modules/
1110
/public/
1211
/build/
13-
/node_modules/
12+
13+
# Ignore test files inside /src/components
14+
src/__tests__/**
15+
/src/components/**/__test__/**/*
16+
/src/components/**/__tests__/**/*
17+
/src/reducers/**/__tests__/**/*
18+
19+
src/components/BMDashboard/_tests_/BMDashboard.test.jsx
20+
src/components/Login/ForgotPassword.test.jsx
21+
src/components/Login/LoginPage.test.js
22+
src/components/PermissionsManagement/PermissionsManagement.test.js
23+
24+
# Ignore folders in /src
1425
src/components/Badge/**
15-
src/components/common/**
26+
src/components/Dashboard/**
1627
src/components/Projects/**
1728
src/components/SummaryManagement/**
1829
src/components/TaskEditSuggestions/**
1930
src/components/TeamMemberTasks/**
20-
src/components/Timelog/**
31+
src/components/Teams/TeamMembersPopup.jsx
2132
src/components/UserManagement/**
22-
src/components/UserProfile/**
23-
src/components/EmailSubscribeForm/**
24-
src/components/Dashboard/**
25-
src/components/Teams/TeamMembersPopup.jsx
33+
src/components/UserProfile/**

src/actions/__tests__/allTeamsAction.js.test.js

Lines changed: 46 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,39 @@
11
// Import the necessary action creators and constants from the respective files
2-
import { teamMembersFectchACtion, userTeamsUpdateAction, addNewTeam, teamsDeleteAction, updateTeamAction, teamUsersFetchAction, teamUsersFetchCompleteAction, teamUsersFetchErrorAction, teamMemberDeleteAction, teamMemberAddAction, updateVisibilityAction, fetchAllTeamCodeSucess, fetchAllTeamCodeFailure, getAllUserTeams, postNewTeam, deleteTeam } from '../allTeamsAction';
3-
import { RECEIVE_ALL_USER_TEAMS, USER_TEAMS_UPDATE, ADD_NEW_TEAM, TEAMS_DELETE, UPDATE_TEAM, FETCH_TEAM_USERS_START, RECEIVE_TEAM_USERS, FETCH_TEAM_USERS_ERROR, TEAM_MEMBER_DELETE, TEAM_MEMBER_ADD, UPDATE_TEAM_MEMBER_VISIBILITY, FETCH_ALL_TEAM_CODE_SUCCESS, FETCH_ALL_TEAM_CODE_FAILURE } from '../../constants/allTeamsConstants';
42
import configureMockStore from 'redux-mock-store';
53
import thunk from 'redux-thunk';
64
import axios from 'axios';
75
import MockAdapter from 'axios-mock-adapter';
6+
import {
7+
RECEIVE_ALL_USER_TEAMS,
8+
USER_TEAMS_UPDATE,
9+
ADD_NEW_TEAM,
10+
TEAMS_DELETE,
11+
UPDATE_TEAM,
12+
FETCH_TEAM_USERS_START,
13+
RECEIVE_TEAM_USERS,
14+
FETCH_TEAM_USERS_ERROR,
15+
TEAM_MEMBER_DELETE,
16+
TEAM_MEMBER_ADD,
17+
UPDATE_TEAM_MEMBER_VISIBILITY,
18+
FETCH_ALL_TEAM_CODE_SUCCESS,
19+
} from '../../constants/allTeamsConstants';
20+
import {
21+
teamMembersFectchACtion,
22+
userTeamsUpdateAction,
23+
addNewTeam,
24+
teamsDeleteAction,
25+
updateTeamAction,
26+
teamUsersFetchAction,
27+
teamUsersFetchCompleteAction,
28+
teamUsersFetchErrorAction,
29+
teamMemberDeleteAction,
30+
teamMemberAddAction,
31+
updateVisibilityAction,
32+
fetchAllTeamCodeSucess,
33+
getAllUserTeams,
34+
postNewTeam,
35+
deleteTeam,
36+
} from '../allTeamsAction';
837
import { ENDPOINTS } from '../../utils/URL';
938

1039
const middlewares = [thunk];
@@ -16,7 +45,10 @@ describe('teamMembersFectchACtion', () => {
1645
// Test case for creating an action to set all user teams
1746
it('should create an action to set all user teams', () => {
1847
// Define the payload for the action
19-
const payload = [{ id: 1, name: 'Team 1' }, { id: 2, name: 'Team 2' }];
48+
const payload = [
49+
{ id: 1, name: 'Team 1' },
50+
{ id: 2, name: 'Team 2' },
51+
];
2052
// Define the expected action object
2153
const expectedAction = {
2254
type: RECEIVE_ALL_USER_TEAMS,
@@ -109,7 +141,10 @@ describe('teamUsersFetchAction', () => {
109141
// Describe block for the teamUsersFetchCompleteAction tests
110142
describe('teamUsersFetchCompleteAction', () => {
111143
it('should create an action to set team users', () => {
112-
const payload = [{ id: 1, name: 'User 1' }, { id: 2, name: 'User 2' }];
144+
const payload = [
145+
{ id: 1, name: 'User 1' },
146+
{ id: 2, name: 'User 2' },
147+
];
113148
const expectedAction = {
114149
type: RECEIVE_TEAM_USERS,
115150
payload,
@@ -198,18 +233,18 @@ describe('fetchAllTeamCodeSucess', () => {
198233
});
199234
});
200235

201-
202236
// Describe block for the getAllUserTeams tests
203237
describe('getAllUserTeams', () => {
204238
// Test case for fetching all user teams
205239
it('should fetch all user teams and dispatch RECEIVE_ALL_USER_TEAMS action', async () => {
206240
// Mock the API response
207-
const responseData = [{ id: 1, name: 'Team 1' }, { id: 2, name: 'Team 2' }];
241+
const responseData = [
242+
{ id: 1, name: 'Team 1' },
243+
{ id: 2, name: 'Team 2' },
244+
];
208245
mock.onGet(ENDPOINTS.TEAM).reply(200, responseData);
209246

210-
const expectedActions = [
211-
{ type: RECEIVE_ALL_USER_TEAMS, payload: responseData },
212-
];
247+
const expectedActions = [{ type: RECEIVE_ALL_USER_TEAMS, payload: responseData }];
213248

214249
const store = mockStore({});
215250
await store.dispatch(getAllUserTeams());
@@ -225,9 +260,7 @@ describe('postNewTeam', () => {
225260
const responseData = { id: 3, name: 'New Team' };
226261
mock.onPost(ENDPOINTS.TEAM).reply(200, responseData);
227262

228-
const expectedActions = [
229-
{ type: ADD_NEW_TEAM, payload: responseData, status: true },
230-
];
263+
const expectedActions = [{ type: ADD_NEW_TEAM, payload: responseData, status: true }];
231264

232265
const store = mockStore({});
233266
await store.dispatch(postNewTeam('New Team', true));
@@ -243,13 +276,10 @@ describe('deleteTeam', () => {
243276
const teamId = 1;
244277
mock.onDelete(ENDPOINTS.TEAM_DATA(teamId)).reply(200);
245278

246-
const expectedActions = [
247-
{ type: TEAMS_DELETE, team: teamId },
248-
];
279+
const expectedActions = [{ type: TEAMS_DELETE, team: teamId }];
249280

250281
const store = mockStore({});
251282
await store.dispatch(deleteTeam(teamId));
252283
expect(store.getActions()).toEqual(expectedActions);
253284
});
254285
});
255-

src/actions/__tests__/authActions.js.test.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
import configureMockStore from 'redux-mock-store'; // Import mock store configuration
22
import thunk from 'redux-thunk'; // Import thunk middleware
3+
import jwtDecode from 'jwt-decode'; // Import jwtDecode
4+
import axios from 'axios'; // Import axios
35
import httpService from '../../services/httpService'; // Import httpService
46
import {
57
loginUser, // Import loginUser action
68
loginBMUser, // Import loginBMUser action
7-
getHeaderData, // Import getHeaderData action
89
logoutUser, // Import logoutUser action
910
refreshToken as refreshUserToken, // Import refreshToken action and rename it to avoid conflict
1011
setCurrentUser, // Import setCurrentUser action
1112
setHeaderData, // Import setHeaderData action
1213
} from '../authActions'; // Import actions from authActions
13-
import { SET_CURRENT_USER, GET_ERRORS, SET_HEADER_DATA } from '../../constants/auth'; // Import constants
14-
import jwtDecode from 'jwt-decode'; // Import jwtDecode
15-
import axios from 'axios'; // Import axios
14+
import { SET_CURRENT_USER, SET_HEADER_DATA } from '../../constants/auth'; // Import constants
1615

1716
const middlewares = [thunk]; // Define middlewares
1817
const mockStore = configureMockStore(middlewares); // Create mock store with middlewares
@@ -106,5 +105,4 @@ describe('authActions', () => {
106105

107106
expect(setHeaderData(data)).toEqual(expectedAction); // Assert the action
108107
});
109-
110108
});

src/actions/__tests__/blueSquareEmailBCCAction.js.test.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ import axios from 'axios'; // Import axios for making HTTP requests
22
import configureMockStore from 'redux-mock-store'; // Import redux-mock-store for creating a mock store
33
import thunk from 'redux-thunk'; // Import redux-thunk for handling asynchronous actions
44
import * as types from '../../constants/BluequareEmailBccConstants'; // Import the action type constants
5-
import { setBlueSquareEmailAssignement, deleteBlueSquareEmailAssignement } from '../blueSquareEmailBCCAction'; // Import the action creator
5+
import {
6+
setBlueSquareEmailAssignement,
7+
deleteBlueSquareEmailAssignement,
8+
} from '../blueSquareEmailBCCAction'; // Import the action creator
69

710
// Mock axios to control its behavior in tests
811
jest.mock('axios');

src/actions/__tests__/dashboardActions.test.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import {
2-
incrementDashboardTaskCount,
3-
INCREMENT_DASHBOARD_TASK_COUNT,
4-
} from '../dashboardActions';
1+
import { toast } from 'react-toastify';
2+
import { incrementDashboardTaskCount, INCREMENT_DASHBOARD_TASK_COUNT } from '../dashboardActions';
53

64
describe('incrementDashboardTaskCount action creator', () => {
75
it('should create an action to increment the dashboard task count', () => {
@@ -12,12 +10,12 @@ describe('incrementDashboardTaskCount action creator', () => {
1210
};
1311

1412
// Spy on console.log
15-
console.log = jest.fn();
13+
toast.info = jest.fn();
1614

1715
const action = incrementDashboardTaskCount(taskId);
1816

1917
expect(action).toEqual(expectedAction);
20-
expect(console.log).toHaveBeenCalledWith(
18+
expect(toast.info).toHaveBeenCalledWith(
2119
`Dispatching incrementDashboardTaskCount for task ID: ${taskId}`,
2220
);
2321
});

src/actions/__tests__/followUpActions.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ describe('followUpActions', () => {
5757

5858
expect(axios.post).toHaveBeenCalledWith(
5959
ENDPOINTS.SET_USER_FOLLOWUP(userId, taskId),
60-
updateData
60+
updateData,
6161
);
6262
expect(dispatch).toHaveBeenCalledWith({
6363
type: types.SET_FOLLOWUP,

0 commit comments

Comments
 (0)