Skip to content

Commit

Permalink
Merge branch 'add-trip-functionality' into rename-add-trip-component
Browse files Browse the repository at this point in the history
  • Loading branch information
zghera committed Jul 17, 2020
2 parents 6e6bd2b + 32bf05b commit b6d9246
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions frontend/src/components/Utils/filter-input.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getUidFromUserEmail } from './temp-auth-utils';
import { getUserUidFromUserEmail } from './temp-auth-utils';
import { getCleanedTextInput, getCollaboratorUidArray } from './filter-input.js';

describe('getCleanedTextInput tests', () => {
Expand Down Expand Up @@ -27,11 +27,11 @@ const mockCurUserEmail = '[email protected]';
// TODO(Issue #55): Replace mock with real auth file once integrated.
jest.mock('./temp-auth-utils.js', () => ({
getCurUserEmail: () => mockCurUserEmail,
getUidFromUserEmail: (userEmail) => '_' + userEmail + '_',
getUserUidFromUserEmail: (userEmail) => '_' + userEmail + '_',
}));
describe('getCollaboratorUidArray tests', () => {
test('No collaborators entered', () => {
const expectedUidArr = [getUidFromUserEmail(mockCurUserEmail)];
const expectedUidArr = [getUserUidFromUserEmail(mockCurUserEmail)];
// This is the list that is created when there are no collaborators added
// (automatically one empty string from the constructor created ref).
const testEmailArr = [''];
Expand All @@ -44,8 +44,8 @@ describe('getCollaboratorUidArray tests', () => {
test('Some added collaborators', () => {
const person1Email = '[email protected]';
const person2Email = '[email protected]';
const expectedUidArr = [getUidFromUserEmail(mockCurUserEmail),
getUidFromUserEmail(person1Email), getUidFromUserEmail(person2Email)];
const expectedUidArr = [getUserUidFromUserEmail(mockCurUserEmail),
getUserUidFromUserEmail(person1Email), getUserUidFromUserEmail(person2Email)];
const testEmailArr = [person1Email, person2Email];

const testUidArr = getCollaboratorUidArray(testEmailArr);
Expand All @@ -56,8 +56,8 @@ describe('getCollaboratorUidArray tests', () => {
test('Some added collaborators and some blank entries', () => {
const person1Email = '[email protected]';
const person2Email = '[email protected]';
const expectedUidArr = [getUidFromUserEmail(mockCurUserEmail),
getUidFromUserEmail(person1Email), getUidFromUserEmail(person2Email)];
const expectedUidArr = [getUserUidFromUserEmail(mockCurUserEmail),
getUserUidFromUserEmail(person1Email), getUserUidFromUserEmail(person2Email)];
const testEmailArr = ['', person1Email, '', person2Email, ''];

const testUidArr = getCollaboratorUidArray(testEmailArr);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Utils/temp-auth-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function getCurUserEmail() {
/**
* Temporary hardcoded function that returns the current users uid.
*
* @return Hardcoded user email string.
* @return Hardcoded user uid string.
*/
export function getCurUserUid() {
return getUserUidFromUserEmail(getCurUserEmail());
Expand Down

0 comments on commit b6d9246

Please sign in to comment.