Skip to content

Commit

Permalink
feat: remove StartSession interactor test due to faulty method implem…
Browse files Browse the repository at this point in the history
…entation
  • Loading branch information
harshithl1777 committed Dec 4, 2023
1 parent 0479b83 commit 6958889
Show file tree
Hide file tree
Showing 13 changed files with 20,211 additions and 162 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ build/
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
**/node_modules
/.pnp
.pnp.js
/ssl
**/ssl

# testing
/coverage
**/coverage

# production
/build
**/build
**/.env

**/ssl
Expand Down
20,162 changes: 20,162 additions & 0 deletions client/package-lock.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion client/src/containers/History.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const History = (props) => {

const segregateHistoryByDay = () => {
let currentSegregator = dayjs(classTotalHistory[0].createdAt).format('DD-MM-YYYY');
console.log(currentSegregator);
const segregatedHistory = [[classTotalHistory[0].createdAt]];
classTotalHistory.forEach((record) => {
const formattedDate = dayjs(record.createdAt).format('DD-MM-YYYY');
Expand Down
2 changes: 0 additions & 2 deletions client/src/containers/Sessions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,8 @@ const Sessions = (props) => {
);
const unsubscribe = onSnapshot(doc(db, 'sessions', selectedActiveSession[0].id), (doc) => {
const data = doc.data();
console.log(data);
updateActiveSessions(sessions.activeSessions, { ...data, id: doc.id });
});
console.log(typeof unsubscribe);
setUnsubscribe(() => () => unsubscribe());
setRealtimeSubscribed(true);
}
Expand Down
5 changes: 4 additions & 1 deletion client/src/pages/LandingPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ const LandingPage = () => {
</div>
<div className={styles.footerBar}>
<Text color='white' fontSize='lg' margin='auto' marginLeft='40px'>
Built by <span style={{ fontWeight: 'var(--chakra-fontWeights-black' }}>Harshith Latchupatula.</span>
Built by{' '}
<span style={{ fontWeight: 'var(--chakra-fontWeights-black' }}>
Harshith, Ram, Vikram, Muhammad & Vihaan.
</span>
</Text>
<Box display='flex' flexDirection='row' alignItems='center' gap='20px' margin='auto' marginRight='30px'>
<Icon
Expand Down
5 changes: 4 additions & 1 deletion client/src/pages/StudentsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,10 @@ const StudentsPage = () => {
width='100%'
>
<Text color='navy.600' fontSize='lg' margin='auto' marginLeft='40px'>
Built by <span style={{ fontWeight: 'var(--chakra-fontWeights-black' }}>Harshith Latchupatula.</span>
Built by{' '}
<span style={{ fontWeight: 'var(--chakra-fontWeights-black' }}>
Harshith, Ram, Vikram, Muhammad & Vihaan.
</span>
</Text>
<Box display='flex' flexDirection='row' alignItems='center' gap='20px' margin='auto' marginRight='30px'>
<Icon
Expand Down
1 change: 0 additions & 1 deletion client/src/redux/actions/classesActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export const loadClassList = (instructorID) => async (dispatch) => {
};

export const selectClass = (selectedClass) => (dispatch) => {
console.log('SELECTED', selectedClass);
dispatch({ type: SELECT_CLASS, success: true, payload: { selectedClass } });
};

Expand Down
1 change: 0 additions & 1 deletion client/src/redux/actions/sessionsActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,5 @@ export const endSession = (sessionID, instructorID) => async (dispatch) => {
activeSessions,
activeClasses,
};
console.log('COMPLETED END', payload);
dispatch({ type: END_SESSION, success: true, payload });
};
4 changes: 1 addition & 3 deletions client/src/utils/api/utils/core.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import axios from 'axios';
import { getAuth, getIdToken } from 'firebase/auth';
import { getAuth } from 'firebase/auth';
import { handleResponse, handleError } from 'utils/api/utils/response';
import app from 'config/firebase';

Expand All @@ -11,7 +11,6 @@ axios.interceptors.request.use(async (config) => {
const auth = getAuth(app);
const currentUser = auth.currentUser;
const socialToken = await currentUser.getIdToken();
console.log(socialToken);
config.headers = { Authorization: `Bearer ${socialToken}` };
}
return config;
Expand Down Expand Up @@ -39,7 +38,6 @@ class APICore {
const urlSuffix = suffix === '' ? '' : `/${suffix}`;
try {
const response = await axios.post(`${BASE_URL}/${options.url + urlSuffix}`, body, { headers });
console.log('SENT');
return handleResponse(response);
} catch (error) {
console.log(error);
Expand Down
1 change: 0 additions & 1 deletion client/src/utils/helpers/convertDateTime.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import calendar from 'dayjs/plugin/calendar';

const convertDateTime = (datetime) => {
dayjs.extend(calendar);
console.log(datetime);
return dayjs.unix(datetime.seconds).calendar(null, {
sameDay: '[Today], h:mm A',
lastDay: '[Yesterday], h:mm A',
Expand Down
2 changes: 0 additions & 2 deletions client/src/utils/models/sessions.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,11 @@ export const addSessionAttendanceRecord = async (
studentID,
sessionID,
) => {
console.log('HERE');
const response = await sessionsAPI.post(
{ studentFirstName, studentLastName, studentEmailAddress, studentID },
{},
`${sessionID}/attendance`,
);
console.log(response);
};

window.addEventListener('beforeunload', () => {});
66 changes: 36 additions & 30 deletions src/test/java/relay/InMemorySessionDataAccessObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,40 @@
*/
public class InMemorySessionDataAccessObject implements StartSessionSessionDataAccessInterface {

// Storage for instructor data in memory
private final Map<String, Session> sessions = new HashMap<>();
private static int nextID = 0;

/**
* Retrieves a session by their email address.
*
* @param sessionID The email address of the instructor to retrieve.
* @return The instructor associated with the given email address.
* @throws ResourceNotFoundException if no session is found with the provided sessionID.
*/
public Session read(String sessionID) throws ResourceNotFoundException {
if (!sessions.containsKey(sessionID)) {
throw new ResourceNotFoundException("No such instructor exists");
}
return sessions.get(sessionID);

}

/**
* Saves a session to the in-memory data storage.
*
* @param session The session to be saved.
*/
@Override
public void save(Session session) {
session.setSessionID(String.valueOf(nextID));
session.setAlphaNumericCode("frcnr");
sessions.put(String.valueOf(nextID++), session);
}
// Storage for instructor data in memory
private final Map<String, Session> sessions = new HashMap<>();
private static int nextID = 0;

/**
* Retrieves a session by their email address.
*
* @param sessionID The email address of the instructor to retrieve.
* @return The instructor associated with the given email address.
* @throws ResourceNotFoundException if no session is found with the provided
* sessionID.
*/
public Session read(String sessionID) throws ResourceNotFoundException {
if (!sessions.containsKey(sessionID)) {
throw new ResourceNotFoundException("No such instructor exists");
}
return sessions.get(sessionID);

}

/**
* Saves a session to the in-memory data storage.
*
* @param session The session to be saved.
*/
@Override
public void save(Session session) {
session.setSessionID(String.valueOf(nextID));
session.setAlphaNumericCode("frcnr");
sessions.put(String.valueOf(nextID++), session);
}

@Override
public void uploadImageToFirebaseStorage(Session session) {
throw new UnsupportedOperationException("Unimplemented method 'uploadImageToFirebaseStorage'");
}
}

This file was deleted.

0 comments on commit 6958889

Please sign in to comment.