diff --git a/__tests__/FooterLoading.js b/__tests__/FooterLoading.js
deleted file mode 100644
index d37ee56b55..0000000000
--- a/__tests__/FooterLoading.js
+++ /dev/null
@@ -1,10 +0,0 @@
-import 'react-native';
-import React from 'react';
-
-// Note: test renderer must be required after react-native.
-import FooterLoading from '../src/components/FooterLoading';
-import { testSnapshot } from '../testUtils';
-
-it('renders correctly', () => {
- testSnapshot();
-});
diff --git a/__tests__/Separator.js b/__tests__/Separator.js
deleted file mode 100644
index b44ad0fb24..0000000000
--- a/__tests__/Separator.js
+++ /dev/null
@@ -1,10 +0,0 @@
-import 'react-native';
-import React from 'react';
-
-// Note: test renderer must be required after react-native.
-import { Separator } from '../src/components/common';
-import { testSnapshot } from '../testUtils';
-
-it('renders correctly', () => {
- testSnapshot();
-});
diff --git a/__tests__/components/LoadingWheel.js b/__tests__/components/LoadingWheel.js
deleted file mode 100644
index 18bf3cf535..0000000000
--- a/__tests__/components/LoadingWheel.js
+++ /dev/null
@@ -1,8 +0,0 @@
-import React from 'react';
-
-import { testSnapshotShallow } from '../../testUtils';
-import LoadingWheel from '../../src/components/LoadingWheel';
-
-it('renders correctly', () => {
- testSnapshotShallow();
-});
diff --git a/package.json b/package.json
index 9299466541..0162c98a7e 100644
--- a/package.json
+++ b/package.json
@@ -52,7 +52,7 @@
"react-native-default-preference": "^1.3.1",
"react-native-device-info": "^0.21.5",
"react-native-fabric": "^0.5.1",
- "react-native-fbsdk": "^0.7.0",
+ "react-native-fbsdk": "^0.8.0",
"react-native-omniture": "https://github.com/CruGlobal/react-native-omniture",
"react-native-parallax-scroll-view": "^0.21.0",
"react-native-push-notification": "https://github.com/CruGlobal/react-native-push-notification",
diff --git a/__tests__/App.js b/src/__tests__/App.js
similarity index 94%
rename from __tests__/App.js
rename to src/__tests__/App.js
index 1aa63c093f..15f2d671b7 100644
--- a/__tests__/App.js
+++ b/src/__tests__/App.js
@@ -6,19 +6,19 @@ import Enzyme from 'enzyme/build/index';
import { Crashlytics } from 'react-native-fabric';
import StackTrace from 'stacktrace-js';
-import App from '../src/App';
+import App from '../App';
import {
EXPIRED_ACCESS_TOKEN,
INVALID_ACCESS_TOKEN,
INVALID_GRANT,
NETWORK_REQUEST_FAILED,
-} from '../src/constants';
-import * as auth from '../src/actions/auth';
-import locale from '../src/i18n/locales/en-US';
+} from '../constants';
+import * as auth from '../actions/auth';
+import locale from '../i18n/locales/en-US';
Enzyme.configure({ adapter: new Adapter() });
-jest.mock('../src/AppNavigator', () => ({ AppNavigator: 'mockAppNavigator' }));
+jest.mock('../AppNavigator', () => ({ AppNavigator: 'mockAppNavigator' }));
jest.mock('react-native-default-preference', () => ({
get: jest.fn().mockReturnValue(Promise.reject()),
@@ -35,8 +35,8 @@ jest.mock('react-navigation-redux-helpers', () => ({
jest.mock('stacktrace-js');
-jest.mock('../src/store', () => ({
- store: require('../testUtils').createMockStore(),
+jest.mock('../store', () => ({
+ store: require('../../testUtils').createMockStore(),
persistor: {},
}));
diff --git a/__tests__/__snapshots__/storeMigrations.js.snap b/src/__tests__/__snapshots__/storeMigrations.js.snap
similarity index 100%
rename from __tests__/__snapshots__/storeMigrations.js.snap
rename to src/__tests__/__snapshots__/storeMigrations.js.snap
diff --git a/__tests__/storeMigrations.js b/src/__tests__/storeMigrations.js
similarity index 87%
rename from __tests__/storeMigrations.js
rename to src/__tests__/storeMigrations.js
index 9017a52a9c..6ac3962ea6 100644
--- a/__tests__/storeMigrations.js
+++ b/src/__tests__/storeMigrations.js
@@ -1,4 +1,4 @@
-import { migrations } from '../src/storeMigrations';
+import { migrations } from '../storeMigrations';
it('should migrate impact reducer to use summary key', () => {
expect(
diff --git a/__tests__/actions/__snapshots__/auth.js.snap b/src/actions/__tests__/__snapshots__/auth.js.snap
similarity index 100%
rename from __tests__/actions/__snapshots__/auth.js.snap
rename to src/actions/__tests__/__snapshots__/auth.js.snap
diff --git a/__tests__/actions/__snapshots__/impact.js.snap b/src/actions/__tests__/__snapshots__/impact.js.snap
similarity index 100%
rename from __tests__/actions/__snapshots__/impact.js.snap
rename to src/actions/__tests__/__snapshots__/impact.js.snap
diff --git a/__tests__/actions/__snapshots__/journey.js.snap b/src/actions/__tests__/__snapshots__/journey.js.snap
similarity index 100%
rename from __tests__/actions/__snapshots__/journey.js.snap
rename to src/actions/__tests__/__snapshots__/journey.js.snap
diff --git a/__tests__/actions/__snapshots__/notifications.js.snap b/src/actions/__tests__/__snapshots__/notifications.js.snap
similarity index 100%
rename from __tests__/actions/__snapshots__/notifications.js.snap
rename to src/actions/__tests__/__snapshots__/notifications.js.snap
diff --git a/__tests__/actions/__snapshots__/people.js.snap b/src/actions/__tests__/__snapshots__/people.js.snap
similarity index 100%
rename from __tests__/actions/__snapshots__/people.js.snap
rename to src/actions/__tests__/__snapshots__/people.js.snap
diff --git a/__tests__/actions/analytics.js b/src/actions/__tests__/analytics.js
similarity index 99%
rename from __tests__/actions/analytics.js
rename to src/actions/__tests__/analytics.js
index 9221ac20d3..11f70f0b29 100644
--- a/__tests__/actions/analytics.js
+++ b/src/actions/__tests__/analytics.js
@@ -12,14 +12,14 @@ import {
trackActionWithoutData,
trackSearchFilter,
emitterCallback,
-} from '../../src/actions/analytics';
+} from '../analytics';
import {
ACTIONS,
ANALYTICS,
ANALYTICS_CONTEXT_CHANGED,
CUSTOM_STEP_TYPE,
LOGGED_IN,
-} from '../../src/constants';
+} from '../../constants';
const mockTracker = {
trackScreenView: jest.fn(),
diff --git a/__tests__/actions/api.js b/src/actions/__tests__/api.js
similarity index 94%
rename from __tests__/actions/api.js
rename to src/actions/__tests__/api.js
index 1ee9a5fdf0..4391293bc4 100644
--- a/__tests__/actions/api.js
+++ b/src/actions/__tests__/api.js
@@ -1,17 +1,17 @@
import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
-import callApi, { REQUESTS } from '../../src/actions/api';
-import API_CALLS from '../../src/api';
+import callApi, { REQUESTS } from '../api';
+import API_CALLS from '../../api';
import {
EXPIRED_ACCESS_TOKEN,
INVALID_ACCESS_TOKEN,
INVALID_GRANT,
UPDATE_TOKEN,
-} from '../../src/constants';
-import { mockFnWithParams } from '../../testUtils';
-import * as auth from '../../src/actions/auth';
-import * as facebook from '../../src/actions/facebook';
+} from '../../constants';
+import { mockFnWithParams } from '../../../testUtils';
+import * as auth from '../auth';
+import * as facebook from '../facebook';
const token = 'alsnjfjwqfpuqfeownposfnjnsaobjfaslkklnsfd';
const refreshToken = 'refresh';
diff --git a/__tests__/actions/auth.js b/src/actions/__tests__/auth.js
similarity index 89%
rename from __tests__/actions/auth.js
rename to src/actions/__tests__/auth.js
index 5b0f43b213..72f1f64625 100644
--- a/__tests__/actions/auth.js
+++ b/src/actions/__tests__/auth.js
@@ -4,17 +4,17 @@ import i18next from 'i18next';
import MockDate from 'mockdate';
import { Linking } from 'react-native';
-import * as callApi from '../../src/actions/api';
-import * as constants from '../../src/constants';
-import { REQUESTS } from '../../src/actions/api';
-import * as navigation from '../../src/actions/navigation';
-import * as login from '../../src/actions/login';
-import * as auth from '../../src/actions/auth';
-import * as person from '../../src/actions/person';
-import * as organizations from '../../src/actions/organizations';
-import * as stages from '../../src/actions/stages';
-import * as steps from '../../src/actions/steps';
-import * as notifications from '../../src/actions/notifications';
+import * as callApi from '../api';
+import { REQUESTS } from '../api';
+import * as constants from '../../constants';
+import * as navigation from '../navigation';
+import * as login from '../login';
+import * as auth from '../auth';
+import * as person from '../person';
+import * as organizations from '../organizations';
+import * as stages from '../stages';
+import * as steps from '../steps';
+import * as notifications from '../notifications';
import {
keyLogin,
refreshAccessToken,
@@ -23,16 +23,16 @@ import {
logout,
upgradeAccount,
openKeyURL,
-} from '../../src/actions/auth';
-import { mockFnWithParams } from '../../testUtils';
-import { LOGIN_OPTIONS_SCREEN } from '../../src/containers/LoginOptionsScreen';
-import { OPEN_URL } from '../../src/constants';
-import { getTimezoneString } from '../../src/actions/auth';
-import { refreshAnonymousLogin } from '../../src/actions/auth';
-import { deletePushToken } from '../../src/actions/notifications';
-import * as onboardingProfile from '../../src/actions/onboardingProfile';
-
-jest.mock('../../src/actions/notifications');
+} from '../auth';
+import { mockFnWithParams } from '../../../testUtils';
+import { LOGIN_OPTIONS_SCREEN } from '../../containers/LoginOptionsScreen';
+import { OPEN_URL } from '../../constants';
+import { getTimezoneString } from '../auth';
+import { refreshAnonymousLogin } from '../auth';
+import { deletePushToken } from '../notifications';
+import * as onboardingProfile from '../onboardingProfile';
+
+jest.mock('../../actions/notifications');
const email = 'klas&jflk@lkjasdf.com';
const password = 'this&is=unsafe';
diff --git a/__tests__/actions/celebration.js b/src/actions/__tests__/celebration.js
similarity index 91%
rename from __tests__/actions/celebration.js
rename to src/actions/__tests__/celebration.js
index f4663d4599..c8648e1eb7 100644
--- a/__tests__/actions/celebration.js
+++ b/src/actions/__tests__/celebration.js
@@ -1,17 +1,14 @@
import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
-import {
- getGroupCelebrateFeed,
- toggleLike,
-} from '../../src/actions/celebration';
-import callApi, { REQUESTS } from '../../src/actions/api';
+import { getGroupCelebrateFeed, toggleLike } from '../celebration';
+import callApi, { REQUESTS } from '../api';
import {
DEFAULT_PAGE_LIMIT,
RESET_CELEBRATION_PAGINATION,
-} from '../../src/constants';
+} from '../../constants';
-jest.mock('../../src/actions/api');
+jest.mock('../api');
const orgId = '123';
diff --git a/__tests__/actions/challenges.js b/src/actions/__tests__/challenges.js
similarity index 92%
rename from __tests__/actions/challenges.js
rename to src/actions/__tests__/challenges.js
index dbd4e81977..de6182ae47 100644
--- a/__tests__/actions/challenges.js
+++ b/src/actions/__tests__/challenges.js
@@ -8,20 +8,20 @@ import {
joinChallenge,
createChallenge,
updateChallenge,
-} from '../../src/actions/challenges';
-import { reloadGroupCelebrateFeed } from '../../src/actions/celebration';
-import callApi, { REQUESTS } from '../../src/actions/api';
+} from '../challenges';
+import { reloadGroupCelebrateFeed } from '../celebration';
+import callApi, { REQUESTS } from '../api';
import {
DEFAULT_PAGE_LIMIT,
RESET_CHALLENGE_PAGINATION,
-} from '../../src/constants';
-import { CELEBRATION_SCREEN } from '../../src/containers/CelebrationScreen';
-import * as common from '../../src/utils/common';
-import { navigatePush } from '../../src/actions/navigation';
+} from '../../constants';
+import { CELEBRATION_SCREEN } from '../../containers/CelebrationScreen';
+import * as common from '../../utils/common';
+import { navigatePush } from '../navigation';
-jest.mock('../../src/actions/api');
-jest.mock('../../src/actions/navigation');
-jest.mock('../../src/actions/celebration');
+jest.mock('../api');
+jest.mock('../navigation');
+jest.mock('../celebration');
const fakeDate = '2018-09-06T14:13:21Z';
common.formatApiDate = jest.fn(() => fakeDate);
diff --git a/__tests__/actions/facebook.js b/src/actions/__tests__/facebook.js
similarity index 92%
rename from __tests__/actions/facebook.js
rename to src/actions/__tests__/facebook.js
index 4674137300..8d8c5740f7 100644
--- a/__tests__/actions/facebook.js
+++ b/src/actions/__tests__/facebook.js
@@ -2,16 +2,16 @@ import { AccessToken, LoginManager } from 'react-native-fbsdk';
import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
-import { mockFnWithParams } from '../../testUtils';
-import { REQUESTS } from '../../src/actions/api';
-import * as callApi from '../../src/actions/api';
-import { ANALYTICS } from '../../src/constants';
-import * as analytics from '../../src/actions/analytics';
+import { mockFnWithParams } from '../../../testUtils';
+import { REQUESTS } from '../api';
+import * as callApi from '../api';
+import { ANALYTICS } from '../../constants';
+import * as analytics from '../analytics';
import {
facebookLoginAction,
facebookLoginWithUsernamePassword,
refreshMissionHubFacebookAccess,
-} from '../../src/actions/facebook';
+} from '../facebook';
const mockStore = configureStore([thunk]);
diff --git a/__tests__/actions/impact.js b/src/actions/__tests__/impact.js
similarity index 96%
rename from __tests__/actions/impact.js
rename to src/actions/__tests__/impact.js
index 8e469d1b26..1f896e853c 100644
--- a/__tests__/actions/impact.js
+++ b/src/actions/__tests__/impact.js
@@ -5,10 +5,10 @@ import {
getImpactSummary,
getPeopleInteractionsReport,
refreshImpact,
-} from '../../src/actions/impact';
-import callApi, { REQUESTS } from '../../src/actions/api';
+} from '../impact';
+import callApi, { REQUESTS } from '../api';
-jest.mock('../../src/actions/api');
+jest.mock('../api');
const store = configureStore([thunk])();
diff --git a/__tests__/actions/interactions.js b/src/actions/__tests__/interactions.js
similarity index 89%
rename from __tests__/actions/interactions.js
rename to src/actions/__tests__/interactions.js
index 4c03004fdb..6b5e8f0989 100644
--- a/__tests__/actions/interactions.js
+++ b/src/actions/__tests__/interactions.js
@@ -1,20 +1,20 @@
import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
-import { addNewInteraction, editComment } from '../../src/actions/interactions';
-import * as api from '../../src/actions/api';
-import { REQUESTS } from '../../src/actions/api';
-import * as analytics from '../../src/actions/analytics';
-import * as impact from '../../src/actions/impact';
-import { mockFnWithParams } from '../../testUtils';
-import { ACTIONS, INTERACTION_TYPES } from '../../src/constants';
-import { reloadGroupCelebrateFeed } from '../../src/actions/celebration';
-import { reloadJourney } from '../../src/actions/journey';
+import { addNewInteraction, editComment } from '../interactions';
+import * as api from '../api';
+import { REQUESTS } from '../api';
+import * as analytics from '../analytics';
+import * as impact from '../impact';
+import { mockFnWithParams } from '../../../testUtils';
+import { ACTIONS, INTERACTION_TYPES } from '../../constants';
+import { reloadGroupCelebrateFeed } from '../celebration';
+import { reloadJourney } from '../journey';
let store;
-jest.mock('../../src/actions/celebration');
-jest.mock('../../src/actions/journey');
+jest.mock('../celebration');
+jest.mock('../journey');
const mockApi = (result, ...expectedParams) =>
mockFnWithParams(api, 'default', result, ...expectedParams);
diff --git a/__tests__/actions/journey.js b/src/actions/__tests__/journey.js
similarity index 95%
rename from __tests__/actions/journey.js
rename to src/actions/__tests__/journey.js
index 6cb2e68d6b..b824af2c8c 100644
--- a/__tests__/actions/journey.js
+++ b/src/actions/__tests__/journey.js
@@ -1,16 +1,12 @@
import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
-import callApi, { REQUESTS } from '../../src/actions/api';
-import {
- getJourney,
- reloadJourney,
- getGroupJourney,
-} from '../../src/actions/journey';
-import { isAdminForOrg } from '../../src/utils/common';
-
-jest.mock('../../src/actions/api');
-jest.mock('../../src/utils/common');
+import callApi, { REQUESTS } from '../api';
+import { getJourney, reloadJourney, getGroupJourney } from '../journey';
+import { isAdminForOrg } from '../../utils/common';
+
+jest.mock('../api');
+jest.mock('../../utils/common');
Date = jest.fn(() => ({
toISOString: () => '2018-04-17T00:00:00Z',
diff --git a/__tests__/actions/login.js b/src/actions/__tests__/login.js
similarity index 82%
rename from __tests__/actions/login.js
rename to src/actions/__tests__/login.js
index 01accb327f..15329253a8 100644
--- a/__tests__/actions/login.js
+++ b/src/actions/__tests__/login.js
@@ -3,15 +3,15 @@ import thunk from 'redux-thunk';
import { Crashlytics } from 'react-native-fabric';
import * as RNOmniture from 'react-native-omniture';
-import * as person from '../../src/actions/person';
-import * as navigation from '../../src/actions/navigation';
-import { onSuccessfulLogin } from '../../src/actions/login';
-import { mockFnWithParams } from '../../testUtils';
-import * as analytics from '../../src/actions/analytics';
-import { ADD_SOMEONE_SCREEN } from '../../src/containers/AddSomeoneScreen';
-import { GET_STARTED_SCREEN } from '../../src/containers/GetStartedScreen';
-import { MAIN_TABS, ACTIONS } from '../../src/constants';
-import * as onboardingProfile from '../../src/actions/onboardingProfile';
+import * as person from '../person';
+import * as navigation from '../navigation';
+import { onSuccessfulLogin } from '../login';
+import { mockFnWithParams } from '../../../testUtils';
+import * as analytics from '../analytics';
+import { ADD_SOMEONE_SCREEN } from '../../containers/AddSomeoneScreen';
+import { GET_STARTED_SCREEN } from '../../containers/GetStartedScreen';
+import { MAIN_TABS, ACTIONS } from '../../constants';
+import * as onboardingProfile from '../onboardingProfile';
const mockStore = configureStore([thunk]);
const personId = '593348';
diff --git a/__tests__/actions/misc.js b/src/actions/__tests__/misc.js
similarity index 87%
rename from __tests__/actions/misc.js
rename to src/actions/__tests__/misc.js
index 84314f1884..b8e0e7caf5 100644
--- a/__tests__/actions/misc.js
+++ b/src/actions/__tests__/misc.js
@@ -2,37 +2,37 @@ import ReactNative from 'react-native';
import thunk from 'redux-thunk';
import configureStore from 'redux-mock-store';
-import { trackActionWithoutData } from '../../src/actions/analytics';
+import { trackActionWithoutData } from '../analytics';
import {
openCommunicationLink,
loadStepsAndJourney,
navigateToStageScreen,
assignContactAndPickStage,
-} from '../../src/actions/misc';
+} from '../misc';
import {
createContactAssignment,
updatePersonAttributes,
getPersonScreenRoute,
-} from '../../src/actions/person';
-import { getContactSteps } from '../../src/actions/steps';
-import { reloadJourney } from '../../src/actions/journey';
-import { navigatePush, navigateReplace } from '../../src/actions/navigation';
-import { PERSON_STAGE_SCREEN } from '../../src/containers/PersonStageScreen';
-import { STAGE_SCREEN } from '../../src/containers/StageScreen';
-import { CONTACT_PERSON_SCREEN } from '../../src/containers/Groups/AssignedPersonScreen';
+} from '../person';
+import { getContactSteps } from '../steps';
+import { reloadJourney } from '../journey';
+import { navigatePush, navigateReplace } from '../navigation';
+import { PERSON_STAGE_SCREEN } from '../../containers/PersonStageScreen';
+import { STAGE_SCREEN } from '../../containers/StageScreen';
+import { CONTACT_PERSON_SCREEN } from '../../containers/Groups/AssignedPersonScreen';
import {
contactAssignmentSelector,
orgPermissionSelector,
-} from '../../src/selectors/people';
-import { isMemberForOrg } from '../../src/utils/common';
-
-jest.mock('../../src/actions/analytics');
-jest.mock('../../src/actions/steps');
-jest.mock('../../src/actions/journey');
-jest.mock('../../src/actions/navigation');
-jest.mock('../../src/actions/person');
-jest.mock('../../src/selectors/people');
-jest.mock('../../src/utils/common');
+} from '../../selectors/people';
+import { isMemberForOrg } from '../../utils/common';
+
+jest.mock('../analytics');
+jest.mock('../steps');
+jest.mock('../journey');
+jest.mock('../navigation');
+jest.mock('../person');
+jest.mock('../../selectors/people');
+jest.mock('../../utils/common');
const mockStore = state => configureStore([thunk])(state);
let store;
diff --git a/__tests__/actions/navigation.js b/src/actions/__tests__/navigation.js
similarity index 98%
rename from __tests__/actions/navigation.js
rename to src/actions/__tests__/navigation.js
index 408375706d..4e5709fd9a 100644
--- a/__tests__/actions/navigation.js
+++ b/src/actions/__tests__/navigation.js
@@ -16,7 +16,7 @@ import {
navigateBack,
navigateReset,
navigateReplace,
-} from '../../src/actions/navigation';
+} from '../navigation';
const routeName = 'screenName';
const params = { prop1: 'value1' };
diff --git a/__tests__/actions/navigationInit.js b/src/actions/__tests__/navigationInit.js
similarity index 93%
rename from __tests__/actions/navigationInit.js
rename to src/actions/__tests__/navigationInit.js
index 23c0b24dad..6f8dd90374 100644
--- a/__tests__/actions/navigationInit.js
+++ b/src/actions/__tests__/navigationInit.js
@@ -1,8 +1,8 @@
-import { MAIN_TABS } from '../../src/constants';
-import { ADD_SOMEONE_SCREEN } from '../../src/containers/AddSomeoneScreen';
-import { GET_STARTED_SCREEN } from '../../src/containers/GetStartedScreen';
-import { initialRoute } from '../../src/actions/navigationInit';
-import { LOGIN_SCREEN } from '../../src/containers/LoginScreen';
+import { MAIN_TABS } from '../../constants';
+import { ADD_SOMEONE_SCREEN } from '../../containers/AddSomeoneScreen';
+import { GET_STARTED_SCREEN } from '../../containers/GetStartedScreen';
+import { initialRoute } from '../navigationInit';
+import { LOGIN_SCREEN } from '../../containers/LoginScreen';
const token =
'sfhaspofuasdnfpwqnfoiqwofiwqioefpqwnofuoweqfniuqweouiowqefonpqnowfpowqfneqowfenopnqwnfeo';
diff --git a/__tests__/actions/notifications.js b/src/actions/__tests__/notifications.js
similarity index 96%
rename from __tests__/actions/notifications.js
rename to src/actions/__tests__/notifications.js
index 4911de6545..2edd428096 100644
--- a/__tests__/actions/notifications.js
+++ b/src/actions/__tests__/notifications.js
@@ -12,7 +12,7 @@ import {
configureNotificationHandler,
requestNativePermissions,
showReminderOnLoad,
-} from '../../src/actions/notifications';
+} from '../notifications';
import {
GCM_SENDER_ID,
LOAD_PERSON_DETAILS,
@@ -20,14 +20,14 @@ import {
NAVIGATE_FORWARD,
LOAD_HOME_NOTIFICATION_REMINDER,
REQUEST_NOTIFICATIONS,
-} from '../../src/constants';
-import * as common from '../../src/utils/common';
-import callApi, { REQUESTS } from '../../src/actions/api';
-import { getPersonDetails, navToPersonScreen } from '../../src/actions/person';
-import { NOTIFICATION_PRIMER_SCREEN } from '../../src/containers/NotificationPrimerScreen';
-
-jest.mock('../../src/actions/person');
-jest.mock('../../src/actions/api');
+} from '../../constants';
+import * as common from '../../utils/common';
+import callApi, { REQUESTS } from '../api';
+import { getPersonDetails, navToPersonScreen } from '../person';
+import { NOTIFICATION_PRIMER_SCREEN } from '../../containers/NotificationPrimerScreen';
+
+jest.mock('../person');
+jest.mock('../api');
jest.mock('react-native-push-notification');
jest.mock('react-native-config', () => ({
GCM_SENDER_ID: 'Test GCM Sender ID',
diff --git a/__tests__/actions/onboardingProfile.js b/src/actions/__tests__/onboardingProfile.js
similarity index 94%
rename from __tests__/actions/onboardingProfile.js
rename to src/actions/__tests__/onboardingProfile.js
index 6f0bee2791..5e5b14df83 100644
--- a/__tests__/actions/onboardingProfile.js
+++ b/src/actions/__tests__/onboardingProfile.js
@@ -9,7 +9,7 @@ import {
createPerson,
resetPerson,
completeOnboarding,
-} from '../../src/actions/onboardingProfile';
+} from '../onboardingProfile';
import {
COMPLETE_ONBOARDING,
FIRST_NAME_CHANGED,
@@ -17,10 +17,10 @@ import {
PERSON_FIRST_NAME_CHANGED,
PERSON_LAST_NAME_CHANGED,
RESET_ONBOARDING_PERSON,
-} from '../../src/constants';
-import callApi, { REQUESTS } from '../../src/actions/api';
+} from '../../constants';
+import callApi, { REQUESTS } from '../api';
-jest.mock('../../src/actions/api');
+jest.mock('../api');
const dispatch = jest.fn(response => Promise.resolve(response));
diff --git a/__tests__/actions/organizations.js b/src/actions/__tests__/organizations.js
similarity index 98%
rename from __tests__/actions/organizations.js
rename to src/actions/__tests__/organizations.js
index 1ab1e8db98..dbad0375d8 100644
--- a/__tests__/actions/organizations.js
+++ b/src/actions/__tests__/organizations.js
@@ -8,8 +8,8 @@ import {
GET_ORGANIZATION_PEOPLE,
LOAD_ORGANIZATIONS,
DEFAULT_PAGE_LIMIT,
-} from '../../src/constants';
-import callApi, { REQUESTS } from '../../src/actions/api';
+} from '../../constants';
+import callApi, { REQUESTS } from '../api';
import {
getMyOrganizations,
getOrganizationsContactReports,
@@ -18,10 +18,10 @@ import {
getOrganizationMembersNextPage,
addNewPerson,
getMyCommunities,
-} from '../../src/actions/organizations';
+} from '../organizations';
-jest.mock('../../src/selectors/organizations');
-jest.mock('../../src/actions/api');
+jest.mock('../../selectors/organizations');
+jest.mock('../api');
const myId = '1';
diff --git a/__tests__/actions/people.js b/src/actions/__tests__/people.js
similarity index 96%
rename from __tests__/actions/people.js
rename to src/actions/__tests__/people.js
index 09f17eb422..dfd86bd1d9 100644
--- a/__tests__/actions/people.js
+++ b/src/actions/__tests__/people.js
@@ -1,10 +1,10 @@
import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
-import { searchPeople, getMyPeople } from '../../src/actions/people';
-import callApi, { REQUESTS } from '../../src/actions/api';
+import { searchPeople, getMyPeople } from '../people';
+import callApi, { REQUESTS } from '../api';
-jest.mock('../../src/actions/api');
+jest.mock('../api');
const mockStore = configureStore([thunk]);
let store;
diff --git a/__tests__/actions/person.js b/src/actions/__tests__/person.js
similarity index 96%
rename from __tests__/actions/person.js
rename to src/actions/__tests__/person.js
index 27339e9931..f0ffa7600f 100644
--- a/__tests__/actions/person.js
+++ b/src/actions/__tests__/person.js
@@ -6,7 +6,7 @@ import {
LOAD_PERSON_DETAILS,
DELETE_PERSON,
ORG_PERMISSIONS,
-} from '../../src/constants';
+} from '../../constants';
import {
getMe,
getPersonDetails,
@@ -18,10 +18,10 @@ import {
savePersonNote,
getPersonNote,
navToPersonScreen,
-} from '../../src/actions/person';
-import callApi, { REQUESTS } from '../../src/actions/api';
-import * as analytics from '../../src/actions/analytics';
-import { navigatePush } from '../../src/actions/navigation';
+} from '../person';
+import callApi, { REQUESTS } from '../api';
+import * as analytics from '../analytics';
+import { navigatePush } from '../navigation';
import {
CONTACT_PERSON_SCREEN,
IS_USER_CREATED_MEMBER_PERSON_SCREEN,
@@ -30,19 +30,19 @@ import {
ME_PERSONAL_PERSON_SCREEN,
IS_GROUPS_ME_COMMUNITY_PERSON_SCREEN,
ME_COMMUNITY_PERSON_SCREEN,
-} from '../../src/containers/Groups/AssignedPersonScreen/';
-import { UNASSIGNED_PERSON_SCREEN } from '../../src/containers/Groups/UnassignedPersonScreen';
+} from '../../containers/Groups/AssignedPersonScreen';
+import { UNASSIGNED_PERSON_SCREEN } from '../../containers/Groups/UnassignedPersonScreen';
import {
personSelector,
orgPermissionSelector,
contactAssignmentSelector,
-} from '../../src/selectors/people';
-import { organizationSelector } from '../../src/selectors/organizations';
+} from '../../selectors/people';
+import { organizationSelector } from '../../selectors/organizations';
-jest.mock('../../src/actions/api');
-jest.mock('../../src/actions/navigation');
-jest.mock('../../src/selectors/people');
-jest.mock('../../src/selectors/organizations');
+jest.mock('../api');
+jest.mock('../navigation');
+jest.mock('../../selectors/people');
+jest.mock('../../selectors/organizations');
const myId = '1';
diff --git a/__tests__/actions/selectStage.js b/src/actions/__tests__/selectStage.js
similarity index 84%
rename from __tests__/actions/selectStage.js
rename to src/actions/__tests__/selectStage.js
index d15fc07fd9..c68070238e 100644
--- a/__tests__/actions/selectStage.js
+++ b/src/actions/__tests__/selectStage.js
@@ -1,17 +1,14 @@
import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
-import {
- updateUserStage,
- selectPersonStage,
-} from '../../src/actions/selectStage';
-import callApi, { REQUESTS } from '../../src/actions/api';
-import { refreshImpact } from '../../src/actions/impact';
-import { getPersonDetails } from '../../src/actions/person';
+import { updateUserStage, selectPersonStage } from '../selectStage';
+import callApi, { REQUESTS } from '../api';
+import { refreshImpact } from '../impact';
+import { getPersonDetails } from '../person';
-jest.mock('../../src/actions/api');
-jest.mock('../../src/actions/impact');
-jest.mock('../../src/actions/person');
+jest.mock('../api');
+jest.mock('../impact');
+jest.mock('../person');
const mockStore = configureStore([thunk]);
let store;
diff --git a/__tests__/actions/steps.js b/src/actions/__tests__/steps.js
similarity index 94%
rename from __tests__/actions/steps.js
rename to src/actions/__tests__/steps.js
index eac1836492..80089cab6e 100644
--- a/__tests__/actions/steps.js
+++ b/src/actions/__tests__/steps.js
@@ -2,7 +2,7 @@ import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
import i18next from 'i18next';
-import callApi, { REQUESTS } from '../../src/actions/api';
+import callApi, { REQUESTS } from '../api';
import {
completeStep,
getStepSuggestions,
@@ -12,13 +12,13 @@ import {
addSteps,
completeStepReminder,
deleteStepWithTracking,
-} from '../../src/actions/steps';
-import { reloadGroupCelebrateFeed } from '../../src/actions/celebration';
-import { refreshImpact } from '../../src/actions/impact';
-import * as analytics from '../../src/actions/analytics';
-import { mockFnWithParams } from '../../testUtils';
-import * as common from '../../src/utils/common';
-import { buildTrackingObj } from '../../src/utils/common';
+} from '../steps';
+import { reloadGroupCelebrateFeed } from '../celebration';
+import { refreshImpact } from '../impact';
+import * as analytics from '../analytics';
+import { mockFnWithParams } from '../../../testUtils';
+import * as common from '../../utils/common';
+import { buildTrackingObj } from '../../utils/common';
import {
ACTIONS,
COMPLETED_STEP_COUNT,
@@ -26,8 +26,8 @@ import {
STEP_NOTE,
TOGGLE_STEP_FOCUS,
CUSTOM_STEP_TYPE,
-} from '../../src/constants';
-import { ADD_STEP_SCREEN } from '../../src/containers/AddStepScreen';
+} from '../../constants';
+import { ADD_STEP_SCREEN } from '../../containers/AddStepScreen';
const mockStore = configureStore([thunk]);
let store;
@@ -38,9 +38,9 @@ const orgId = '123';
const mockDate = '2018-02-14 11:30:00 UTC';
common.formatApiDate = jest.fn().mockReturnValue(mockDate);
-jest.mock('../../src/actions/api');
-jest.mock('../../src/actions/impact');
-jest.mock('../../src/actions/celebration');
+jest.mock('../api');
+jest.mock('../impact');
+jest.mock('../celebration');
beforeEach(() => {
jest.clearAllMocks();
diff --git a/__tests__/actions/surveys.js b/src/actions/__tests__/surveys.js
similarity index 91%
rename from __tests__/actions/surveys.js
rename to src/actions/__tests__/surveys.js
index 89f1a468d3..4039d7b188 100644
--- a/__tests__/actions/surveys.js
+++ b/src/actions/__tests__/surveys.js
@@ -1,17 +1,13 @@
import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
-import callApi, { REQUESTS } from '../../src/actions/api';
-import {
- getMySurveys,
- getOrgSurveys,
- getOrgSurveysNextPage,
-} from '../../src/actions/surveys';
-import { GET_ORGANIZATION_SURVEYS } from '../../src/constants';
+import callApi, { REQUESTS } from '../api';
+import { getMySurveys, getOrgSurveys, getOrgSurveysNextPage } from '../surveys';
+import { GET_ORGANIZATION_SURVEYS } from '../../constants';
const apiResponse = { type: 'successful' };
-jest.mock('../../src/actions/api');
+jest.mock('../api');
let store;
diff --git a/__tests__/api/api.js b/src/api/__tests__/api.js
similarity index 90%
rename from __tests__/api/api.js
rename to src/api/__tests__/api.js
index dba46e5bf1..1f92877215 100644
--- a/__tests__/api/api.js
+++ b/src/api/__tests__/api.js
@@ -1,6 +1,7 @@
-import API_CALLS from '../../src/api/index';
-import * as utils from '../../src/api/utils';
-import { REQUESTS } from '../../src/actions/api';
+import API_CALLS from '..';
+
+import * as utils from '../utils';
+import { REQUESTS } from '../../actions/api';
beforeEach(() => {
global.APILOG = jest.fn();
diff --git a/__tests__/api/utils.js b/src/api/__tests__/utils.js
similarity index 99%
rename from __tests__/api/utils.js
rename to src/api/__tests__/utils.js
index 7b2e3c91a3..d1e72717cb 100644
--- a/__tests__/api/utils.js
+++ b/src/api/__tests__/utils.js
@@ -1,4 +1,4 @@
-import request from '../../src/api/utils';
+import request from '../utils';
const sessionKey = 'X-MH-Session';
diff --git a/__tests__/components/AssignToMeButton.js b/src/components/AssignToMeButton/__tests__/AssignToMeButton.js
similarity index 80%
rename from __tests__/components/AssignToMeButton.js
rename to src/components/AssignToMeButton/__tests__/AssignToMeButton.js
index 797ae5f372..db0423d067 100644
--- a/__tests__/components/AssignToMeButton.js
+++ b/src/components/AssignToMeButton/__tests__/AssignToMeButton.js
@@ -2,14 +2,16 @@ import React from 'react';
import thunk from 'redux-thunk';
import configureStore from 'redux-mock-store';
-import { testSnapshotShallow, renderShallow } from '../../testUtils';
-import AssignToMeButton from '../../src/components/AssignToMeButton';
-import { assignContactAndPickStage } from '../../src/actions/misc';
-
-jest.mock('../../src/actions/misc');
-jest.mock('../../src/actions/person');
-jest.mock('../../src/selectors/people');
-jest.mock('../../src/actions/navigation');
+import { testSnapshotShallow, renderShallow } from '../../../../testUtils';
+
+import AssignToMeButton from '..';
+
+import { assignContactAndPickStage } from '../../../actions/misc';
+
+jest.mock('../../../actions/misc');
+jest.mock('../../../actions/person');
+jest.mock('../../../selectors/people');
+jest.mock('../../../actions/navigation');
const myId = '25';
const state = { auth: { person: { id: myId } } };
diff --git a/__tests__/components/__snapshots__/AssignToMeButton.js.snap b/src/components/AssignToMeButton/__tests__/__snapshots__/AssignToMeButton.js.snap
similarity index 100%
rename from __tests__/components/__snapshots__/AssignToMeButton.js.snap
rename to src/components/AssignToMeButton/__tests__/__snapshots__/AssignToMeButton.js.snap
diff --git a/__tests__/Button.js b/src/components/Button/__tests__/Button.js
similarity index 88%
rename from __tests__/Button.js
rename to src/components/Button/__tests__/Button.js
index e19fb529a5..c933e27ae0 100644
--- a/__tests__/Button.js
+++ b/src/components/Button/__tests__/Button.js
@@ -2,9 +2,9 @@ import 'react-native';
import React from 'react';
import { shallow } from 'enzyme';
-// Note: test renderer must be required after react-native.
-import { Button } from '../src/components/common';
-import { testSnapshot } from '../testUtils';
+import Button from '..';
+
+import { testSnapshot } from '../../../../testUtils';
it('renders correctly', () => {
testSnapshot();
diff --git a/__tests__/__snapshots__/Button.js.snap b/src/components/Button/__tests__/__snapshots__/Button.js.snap
similarity index 100%
rename from __tests__/__snapshots__/Button.js.snap
rename to src/components/Button/__tests__/__snapshots__/Button.js.snap
diff --git a/__tests__/components/Card.js b/src/components/Card/__tests__/Card.js
similarity index 87%
rename from __tests__/components/Card.js
rename to src/components/Card/__tests__/Card.js
index 5a8e78eef6..f77f74a7af 100644
--- a/__tests__/components/Card.js
+++ b/src/components/Card/__tests__/Card.js
@@ -2,9 +2,11 @@ import React from 'react';
import { View } from 'react-native';
import { shallow } from 'enzyme';
-import { testSnapshotShallow, renderShallow } from '../../testUtils';
-import Card from '../../src/components/Card';
-import Text from '../../src/components/Text';
+import { testSnapshotShallow, renderShallow } from '../../../../testUtils';
+
+import Card from '..';
+
+import Text from '../../Text';
const children = (
diff --git a/__tests__/components/__snapshots__/Card.js.snap b/src/components/Card/__tests__/__snapshots__/Card.js.snap
similarity index 100%
rename from __tests__/components/__snapshots__/Card.js.snap
rename to src/components/Card/__tests__/__snapshots__/Card.js.snap
diff --git a/__tests__/components/CelebrateFeed.js b/src/components/CelebrateFeed/__tests__/CelebrateFeed.js
similarity index 92%
rename from __tests__/components/CelebrateFeed.js
rename to src/components/CelebrateFeed/__tests__/CelebrateFeed.js
index 66e24ce0a0..36cff9e424 100644
--- a/__tests__/components/CelebrateFeed.js
+++ b/src/components/CelebrateFeed/__tests__/CelebrateFeed.js
@@ -3,11 +3,12 @@ import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
import MockDate from 'mockdate';
-import CelebrateFeed from '../../src/components/CelebrateFeed';
-import { renderShallow } from '../../testUtils';
-import { toggleLike } from '../../src/actions/celebration';
+import CelebrateFeed from '..';
-jest.mock('../../src/actions/celebration');
+import { renderShallow } from '../../../../testUtils';
+import { toggleLike } from '../../../actions/celebration';
+
+jest.mock('../../../actions/celebration');
const myId = '123';
const organization = { id: '456' };
diff --git a/__tests__/components/__snapshots__/CelebrateFeed.js.snap b/src/components/CelebrateFeed/__tests__/__snapshots__/CelebrateFeed.js.snap
similarity index 100%
rename from __tests__/components/__snapshots__/CelebrateFeed.js.snap
rename to src/components/CelebrateFeed/__tests__/__snapshots__/CelebrateFeed.js.snap
diff --git a/__tests__/components/CelebrateItem.js b/src/components/CelebrateItem/__tests__/CelebrateItem.js
similarity index 95%
rename from __tests__/components/CelebrateItem.js
rename to src/components/CelebrateItem/__tests__/CelebrateItem.js
index 25904fd645..dc1543975f 100644
--- a/__tests__/components/CelebrateItem.js
+++ b/src/components/CelebrateItem/__tests__/CelebrateItem.js
@@ -5,12 +5,14 @@ import {
ACTIONS,
CELEBRATEABLE_TYPES,
INTERACTION_TYPES,
-} from '../../src/constants';
-import CelebrateItem from '../../src/components/CelebrateItem';
-import { trackActionWithoutData } from '../../src/actions/analytics';
-import { testSnapshotShallow, renderShallow } from '../../testUtils';
+} from '../../../constants';
-jest.mock('../../src/actions/analytics');
+import CelebrateItem from '..';
+
+import { trackActionWithoutData } from '../../../actions/analytics';
+import { testSnapshotShallow, renderShallow } from '../../../../testUtils';
+
+jest.mock('../../../actions/analytics');
const mockStore = configureStore();
let store;
diff --git a/__tests__/components/__snapshots__/CelebrateItem.js.snap b/src/components/CelebrateItem/__tests__/__snapshots__/CelebrateItem.js.snap
similarity index 100%
rename from __tests__/components/__snapshots__/CelebrateItem.js.snap
rename to src/components/CelebrateItem/__tests__/__snapshots__/CelebrateItem.js.snap
diff --git a/__tests__/components/CenteredIconButtonWithText.js b/src/components/CenteredIconButtonWithText/__tests__/CenteredIconButtonWithText.js
similarity index 79%
rename from __tests__/components/CenteredIconButtonWithText.js
rename to src/components/CenteredIconButtonWithText/__tests__/CenteredIconButtonWithText.js
index 2f646d1b25..f3849c1f77 100644
--- a/__tests__/components/CenteredIconButtonWithText.js
+++ b/src/components/CenteredIconButtonWithText/__tests__/CenteredIconButtonWithText.js
@@ -1,7 +1,8 @@
import React from 'react';
-import { testSnapshotShallow } from '../../testUtils';
-import CenteredIconButtonWithText from '../../src/components/CenteredIconButtonWithText';
+import { testSnapshotShallow } from '../../../../testUtils';
+
+import CenteredIconButtonWithText from '..';
it('renders correctly with non-null onClick', () => {
testSnapshotShallow(
diff --git a/__tests__/components/__snapshots__/CenteredIconButtonWithText.js.snap b/src/components/CenteredIconButtonWithText/__tests__/__snapshots__/CenteredIconButtonWithText.js.snap
similarity index 100%
rename from __tests__/components/__snapshots__/CenteredIconButtonWithText.js.snap
rename to src/components/CenteredIconButtonWithText/__tests__/__snapshots__/CenteredIconButtonWithText.js.snap
diff --git a/__tests__/components/ChallengeItem.js b/src/components/ChallengeItem/__tests__/ChallengeItem.js
similarity index 94%
rename from __tests__/components/ChallengeItem.js
rename to src/components/ChallengeItem/__tests__/ChallengeItem.js
index c4815daf1a..e68de65d00 100644
--- a/__tests__/components/ChallengeItem.js
+++ b/src/components/ChallengeItem/__tests__/ChallengeItem.js
@@ -2,10 +2,11 @@ import React from 'react';
import MockDate from 'mockdate';
import moment from 'moment';
-import ChallengeItem from '../../src/components/ChallengeItem';
-import { testSnapshotShallow, renderShallow } from '../../testUtils';
+import ChallengeItem from '..';
-jest.mock('../../src/actions/celebration');
+import { testSnapshotShallow, renderShallow } from '../../../../testUtils';
+
+jest.mock('../../../actions/celebration');
MockDate.set(
moment('2018-09-15')
diff --git a/__tests__/components/__snapshots__/ChallengeItem.js.snap b/src/components/ChallengeItem/__tests__/__snapshots__/ChallengeItem.js.snap
similarity index 100%
rename from __tests__/components/__snapshots__/ChallengeItem.js.snap
rename to src/components/ChallengeItem/__tests__/__snapshots__/ChallengeItem.js.snap
diff --git a/__tests__/components/CommentBox.js b/src/components/CommentBox/__tests__/CommentBox.js
similarity index 93%
rename from __tests__/components/CommentBox.js
rename to src/components/CommentBox/__tests__/CommentBox.js
index c4fe42c4ce..8536893d0e 100644
--- a/__tests__/components/CommentBox.js
+++ b/src/components/CommentBox/__tests__/CommentBox.js
@@ -3,12 +3,14 @@ import MockDate from 'mockdate';
import thunk from 'redux-thunk';
import configureStore from 'redux-mock-store';
-import { renderShallow, testSnapshotShallow } from '../../testUtils';
-import CommentBox from '../../src/components/CommentBox';
-import { addNewInteraction } from '../../src/actions/interactions';
-import { INTERACTION_TYPES } from '../../src/constants';
+import { renderShallow, testSnapshotShallow } from '../../../../testUtils';
-jest.mock('../../src/actions/interactions');
+import CommentBox from '..';
+
+import { addNewInteraction } from '../../../actions/interactions';
+import { INTERACTION_TYPES } from '../../../constants';
+
+jest.mock('../../../actions/interactions');
MockDate.set('2017-06-18');
diff --git a/__tests__/components/__snapshots__/CommentBox.js.snap b/src/components/CommentBox/__tests__/__snapshots__/CommentBox.js.snap
similarity index 100%
rename from __tests__/components/__snapshots__/CommentBox.js.snap
rename to src/components/CommentBox/__tests__/__snapshots__/CommentBox.js.snap
diff --git a/__tests__/components/ContactItem.js b/src/components/ContactItem/__tests__/ContactItem.js
similarity index 87%
rename from __tests__/components/ContactItem.js
rename to src/components/ContactItem/__tests__/ContactItem.js
index c40a444060..a3de8a0659 100644
--- a/__tests__/components/ContactItem.js
+++ b/src/components/ContactItem/__tests__/ContactItem.js
@@ -1,7 +1,8 @@
import React from 'react';
-import { renderShallow, testSnapshotShallow } from '../../testUtils';
-import ContactItem from '../../src/components/ContactItem';
+import { renderShallow, testSnapshotShallow } from '../../../../testUtils';
+
+import ContactItem from '..';
const organization = { id: '1', name: 'Test Org' };
const contact = {
diff --git a/__tests__/components/__snapshots__/ContactItem.js.snap b/src/components/ContactItem/__tests__/__snapshots__/ContactItem.js.snap
similarity index 100%
rename from __tests__/components/__snapshots__/ContactItem.js.snap
rename to src/components/ContactItem/__tests__/__snapshots__/ContactItem.js.snap
diff --git a/__tests__/components/DateComponent.js b/src/components/DateComponent/__tests__/DateComponent.js
similarity index 90%
rename from __tests__/components/DateComponent.js
rename to src/components/DateComponent/__tests__/DateComponent.js
index 8584a7cc78..e64a9babd3 100644
--- a/__tests__/components/DateComponent.js
+++ b/src/components/DateComponent/__tests__/DateComponent.js
@@ -1,8 +1,9 @@
import React from 'react';
import 'react-native';
-import { DateComponent } from '../../src/components/common';
-import { testSnapshotShallow, renderShallow } from '../../testUtils';
+import DateComponent from '..';
+
+import { testSnapshotShallow, renderShallow } from '../../../../testUtils';
Date.now = jest.fn(() => new Date(Date.UTC(2018, 5, 11, 12, 0, 0)).valueOf());
diff --git a/__tests__/components/__snapshots__/DateComponent.js.snap b/src/components/DateComponent/__tests__/__snapshots__/DateComponent.js.snap
similarity index 100%
rename from __tests__/components/__snapshots__/DateComponent.js.snap
rename to src/components/DateComponent/__tests__/__snapshots__/DateComponent.js.snap
diff --git a/__tests__/components/DatePicker.js b/src/components/DatePicker/__tests__/DatePicker.js
similarity index 98%
rename from __tests__/components/DatePicker.js
rename to src/components/DatePicker/__tests__/DatePicker.js
index 41fb105b7f..da67b87c8c 100644
--- a/__tests__/components/DatePicker.js
+++ b/src/components/DatePicker/__tests__/DatePicker.js
@@ -2,9 +2,10 @@ import React from 'react';
import { Animated, TimePickerAndroid, DatePickerAndroid } from 'react-native';
import MockDate from 'mockdate';
-import DatePicker from '../../src/components/DatePicker';
-import { testSnapshotShallow, renderShallow } from '../../testUtils';
-import * as common from '../../src/utils/common';
+import DatePicker from '..';
+
+import { testSnapshotShallow, renderShallow } from '../../../../testUtils';
+import * as common from '../../../utils/common';
const mockDate = '2018-09-12 12:00:00 PM GMT+0';
MockDate.set(mockDate);
diff --git a/__tests__/components/__snapshots__/DatePicker.js.snap b/src/components/DatePicker/__tests__/__snapshots__/DatePicker.js.snap
similarity index 100%
rename from __tests__/components/__snapshots__/DatePicker.js.snap
rename to src/components/DatePicker/__tests__/__snapshots__/DatePicker.js.snap
diff --git a/__tests__/components/Dot.js b/src/components/Dot/__tests__/Dot.js
similarity index 65%
rename from __tests__/components/Dot.js
rename to src/components/Dot/__tests__/Dot.js
index 212e1e0a41..206dd362bb 100644
--- a/__tests__/components/Dot.js
+++ b/src/components/Dot/__tests__/Dot.js
@@ -1,7 +1,8 @@
import React from 'react';
-import { testSnapshotShallow } from '../../testUtils';
-import Dot from '../../src/components/Dot';
+import { testSnapshotShallow } from '../../../../testUtils';
+
+import Dot from '..';
it('render dot', () => {
testSnapshotShallow();
diff --git a/__tests__/components/__snapshots__/Dot.js.snap b/src/components/Dot/__tests__/__snapshots__/Dot.js.snap
similarity index 100%
rename from __tests__/components/__snapshots__/Dot.js.snap
rename to src/components/Dot/__tests__/__snapshots__/Dot.js.snap
diff --git a/__tests__/components/EmptyCelebrateFeed.js b/src/components/EmptyCelebrateFeed/__tests__/EmptyCelebrateFeed.js
similarity index 83%
rename from __tests__/components/EmptyCelebrateFeed.js
rename to src/components/EmptyCelebrateFeed/__tests__/EmptyCelebrateFeed.js
index 5039fb2dfd..3d75312f8a 100644
--- a/__tests__/components/EmptyCelebrateFeed.js
+++ b/src/components/EmptyCelebrateFeed/__tests__/EmptyCelebrateFeed.js
@@ -1,7 +1,8 @@
import React from 'react';
-import EmptyCelebrateFeed from '../../src/components/EmptyCelebrateFeed';
-import { testSnapshotShallow } from '../../testUtils';
+import EmptyCelebrateFeed from '..';
+
+import { testSnapshotShallow } from '../../../../testUtils';
const person = {
first_name: 'Roge',
diff --git a/__tests__/components/__snapshots__/EmptyCelebrateFeed.js.snap b/src/components/EmptyCelebrateFeed/__tests__/__snapshots__/EmptyCelebrateFeed.js.snap
similarity index 100%
rename from __tests__/components/__snapshots__/EmptyCelebrateFeed.js.snap
rename to src/components/EmptyCelebrateFeed/__tests__/__snapshots__/EmptyCelebrateFeed.js.snap
diff --git a/__tests__/components/EmptyChallengeFeed.js b/src/components/EmptyChallengeFeed/__tests__/EmptyChallengeFeed.js
similarity index 67%
rename from __tests__/components/EmptyChallengeFeed.js
rename to src/components/EmptyChallengeFeed/__tests__/EmptyChallengeFeed.js
index 14cbceb759..2ed7131985 100644
--- a/__tests__/components/EmptyChallengeFeed.js
+++ b/src/components/EmptyChallengeFeed/__tests__/EmptyChallengeFeed.js
@@ -1,7 +1,8 @@
import React from 'react';
-import EmptyChallengeFeed from '../../src/components/EmptyChallengeFeed';
-import { testSnapshotShallow } from '../../testUtils';
+import EmptyChallengeFeed from '..';
+
+import { testSnapshotShallow } from '../../../../testUtils';
const props = {
refreshing: false,
diff --git a/__tests__/components/__snapshots__/EmptyChallengeFeed.js.snap b/src/components/EmptyChallengeFeed/__tests__/__snapshots__/EmptyChallengeFeed.js.snap
similarity index 100%
rename from __tests__/components/__snapshots__/EmptyChallengeFeed.js.snap
rename to src/components/EmptyChallengeFeed/__tests__/__snapshots__/EmptyChallengeFeed.js.snap
diff --git a/__tests__/FilterItem.js b/src/components/FilterItem/__tests__/FilterItem.js
similarity index 83%
rename from __tests__/FilterItem.js
rename to src/components/FilterItem/__tests__/FilterItem.js
index 01046a0119..854f9734e3 100644
--- a/__tests__/FilterItem.js
+++ b/src/components/FilterItem/__tests__/FilterItem.js
@@ -1,9 +1,9 @@
import 'react-native';
import React from 'react';
-// Note: test renderer must be required after react-native.
-import FilterItem from '../src/components/FilterItem';
-import { testSnapshot } from '../testUtils';
+import FilterItem from '..';
+
+import { testSnapshot } from '../../../../testUtils';
const mockItem = {
id: '123',
diff --git a/__tests__/__snapshots__/FilterItem.js.snap b/src/components/FilterItem/__tests__/__snapshots__/FilterItem.js.snap
similarity index 100%
rename from __tests__/__snapshots__/FilterItem.js.snap
rename to src/components/FilterItem/__tests__/__snapshots__/FilterItem.js.snap
diff --git a/__tests__/components/FilterList.js b/src/components/FilterList/__tests__/FilterList.js
similarity index 90%
rename from __tests__/components/FilterList.js
rename to src/components/FilterList/__tests__/FilterList.js
index ae5ac7b344..ef93d3f8fd 100644
--- a/__tests__/components/FilterList.js
+++ b/src/components/FilterList/__tests__/FilterList.js
@@ -1,7 +1,8 @@
import React from 'react';
-import FilterList from '../../src/components/FilterList';
-import { renderShallow } from '../../testUtils';
+import FilterList from '..';
+
+import { renderShallow } from '../../../../testUtils';
const options = [{ id: '1', text: 'option1' }, { id: '2', text: 'option 2' }];
const toggleOptions = [
diff --git a/__tests__/components/__snapshots__/FilterList.js.snap b/src/components/FilterList/__tests__/__snapshots__/FilterList.js.snap
similarity index 100%
rename from __tests__/components/__snapshots__/FilterList.js.snap
rename to src/components/FilterList/__tests__/__snapshots__/FilterList.js.snap
diff --git a/__tests__/Flex.js b/src/components/Flex/__tests__/Flex.js
similarity index 80%
rename from __tests__/Flex.js
rename to src/components/Flex/__tests__/Flex.js
index 7ce065a71b..ac3774924f 100644
--- a/__tests__/Flex.js
+++ b/src/components/Flex/__tests__/Flex.js
@@ -1,9 +1,9 @@
import 'react-native';
import React from 'react';
-// Note: test renderer must be required after react-native.
-import { Flex } from '../src/components/common';
-import { testSnapshot } from '../testUtils';
+import Flex from '..';
+
+import { testSnapshot } from '../../../../testUtils';
it('renders correctly', () => {
testSnapshot();
diff --git a/__tests__/__snapshots__/Flex.js.snap b/src/components/Flex/__tests__/__snapshots__/Flex.js.snap
similarity index 100%
rename from __tests__/__snapshots__/Flex.js.snap
rename to src/components/Flex/__tests__/__snapshots__/Flex.js.snap
diff --git a/src/components/FooterLoading/__tests__/FooterLoading.js b/src/components/FooterLoading/__tests__/FooterLoading.js
new file mode 100644
index 0000000000..bbf0c95977
--- /dev/null
+++ b/src/components/FooterLoading/__tests__/FooterLoading.js
@@ -0,0 +1,10 @@
+import 'react-native';
+import React from 'react';
+
+import FooterLoading from '..';
+
+import { testSnapshot } from '../../../../testUtils';
+
+it('renders correctly', () => {
+ testSnapshot();
+});
diff --git a/__tests__/__snapshots__/FooterLoading.js.snap b/src/components/FooterLoading/__tests__/__snapshots__/FooterLoading.js.snap
similarity index 100%
rename from __tests__/__snapshots__/FooterLoading.js.snap
rename to src/components/FooterLoading/__tests__/__snapshots__/FooterLoading.js.snap
diff --git a/__tests__/components/GroupCardItem.js b/src/components/GroupCardItem/__tests__/GroupCardItem.js
similarity index 93%
rename from __tests__/components/GroupCardItem.js
rename to src/components/GroupCardItem/__tests__/GroupCardItem.js
index 60a7a85a60..14e9c32564 100644
--- a/__tests__/components/GroupCardItem.js
+++ b/src/components/GroupCardItem/__tests__/GroupCardItem.js
@@ -1,7 +1,8 @@
import React from 'react';
-import GroupCardItem from '../../src/components/GroupCardItem';
-import { testSnapshotShallow, renderShallow } from '../../testUtils';
+import GroupCardItem from '..';
+
+import { testSnapshotShallow, renderShallow } from '../../../../testUtils';
const contactsCount = 768;
const unassignedCount = 13;
diff --git a/__tests__/components/__snapshots__/GroupCardItem.js.snap b/src/components/GroupCardItem/__tests__/__snapshots__/GroupCardItem.js.snap
similarity index 100%
rename from __tests__/components/__snapshots__/GroupCardItem.js.snap
rename to src/components/GroupCardItem/__tests__/__snapshots__/GroupCardItem.js.snap
diff --git a/__tests__/components/GroupMemberItem.js b/src/components/GroupMemberItem/__tests__/GroupMemberItem.js
similarity index 90%
rename from __tests__/components/GroupMemberItem.js
rename to src/components/GroupMemberItem/__tests__/GroupMemberItem.js
index 38aec2dabc..b37a9c581a 100644
--- a/__tests__/components/GroupMemberItem.js
+++ b/src/components/GroupMemberItem/__tests__/GroupMemberItem.js
@@ -1,7 +1,8 @@
import React from 'react';
-import { renderShallow, testSnapshotShallow } from '../../testUtils';
-import GroupMemberItem from '../../src/components/GroupMemberItem';
+import { renderShallow, testSnapshotShallow } from '../../../../testUtils';
+
+import GroupMemberItem from '..';
const member = {
id: '123',
diff --git a/__tests__/components/__snapshots__/GroupMemberItem.js.snap b/src/components/GroupMemberItem/__tests__/__snapshots__/GroupMemberItem.js.snap
similarity index 100%
rename from __tests__/components/__snapshots__/GroupMemberItem.js.snap
rename to src/components/GroupMemberItem/__tests__/__snapshots__/GroupMemberItem.js.snap
diff --git a/__tests__/components/GroupSurveyItem.js b/src/components/GroupSurveyItem/__tests__/GroupSurveyItem.js
similarity index 90%
rename from __tests__/components/GroupSurveyItem.js
rename to src/components/GroupSurveyItem/__tests__/GroupSurveyItem.js
index a66238009b..af76ec93a8 100644
--- a/__tests__/components/GroupSurveyItem.js
+++ b/src/components/GroupSurveyItem/__tests__/GroupSurveyItem.js
@@ -1,7 +1,8 @@
import React from 'react';
-import { renderShallow, testSnapshotShallow } from '../../testUtils';
-import GroupSurveyItem from '../../src/components/GroupSurveyItem';
+import { renderShallow, testSnapshotShallow } from '../../../../testUtils';
+
+import GroupSurveyItem from '..';
const survey = {
id: '1',
diff --git a/__tests__/components/__snapshots__/GroupSurveyItem.js.snap b/src/components/GroupSurveyItem/__tests__/__snapshots__/GroupSurveyItem.js.snap
similarity index 100%
rename from __tests__/components/__snapshots__/GroupSurveyItem.js.snap
rename to src/components/GroupSurveyItem/__tests__/__snapshots__/GroupSurveyItem.js.snap
diff --git a/__tests__/components/GroupsContactItem.js b/src/components/GroupsContactItem/__tests__/GroupsContactItem.js
similarity index 94%
rename from __tests__/components/GroupsContactItem.js
rename to src/components/GroupsContactItem/__tests__/GroupsContactItem.js
index 456feff1b9..a2559f76eb 100644
--- a/__tests__/components/GroupsContactItem.js
+++ b/src/components/GroupsContactItem/__tests__/GroupsContactItem.js
@@ -1,8 +1,10 @@
import React from 'react';
-import { testSnapshotShallow } from '../../testUtils';
-import GroupsContactItem from '../../src/components/GroupsContactItem';
-import { INTERACTION_TYPES } from '../../src/constants';
+import { testSnapshotShallow } from '../../../../testUtils';
+
+import GroupsContactItem from '..';
+
+import { INTERACTION_TYPES } from '../../../constants';
const created_at = '2018-05-29T17:02:02Z';
const item = {
diff --git a/__tests__/components/__snapshots__/GroupsContactItem.js.snap b/src/components/GroupsContactItem/__tests__/__snapshots__/GroupsContactItem.js.snap
similarity index 100%
rename from __tests__/components/__snapshots__/GroupsContactItem.js.snap
rename to src/components/GroupsContactItem/__tests__/__snapshots__/GroupsContactItem.js.snap
diff --git a/__tests__/components/GroupsContactList.js b/src/components/GroupsContactList/__tests__/GroupsContactList.js
similarity index 93%
rename from __tests__/components/GroupsContactList.js
rename to src/components/GroupsContactList/__tests__/GroupsContactList.js
index 23252cc650..414a97471b 100644
--- a/__tests__/components/GroupsContactList.js
+++ b/src/components/GroupsContactList/__tests__/GroupsContactList.js
@@ -1,7 +1,8 @@
import React from 'react';
-import { testSnapshotShallow, renderShallow } from '../../testUtils';
-import GroupsContactList from '../../src/components/GroupsContactList';
+import { testSnapshotShallow, renderShallow } from '../../../../testUtils';
+
+import GroupsContactList from '..';
const person = {
id: '123',
diff --git a/__tests__/components/__snapshots__/GroupsContactList.js.snap b/src/components/GroupsContactList/__tests__/__snapshots__/GroupsContactList.js.snap
similarity index 100%
rename from __tests__/components/__snapshots__/GroupsContactList.js.snap
rename to src/components/GroupsContactList/__tests__/__snapshots__/GroupsContactList.js.snap
diff --git a/__tests__/components/GroupsPersonHeader.js b/src/components/GroupsPersonHeader/__tests__/GroupsPersonHeader.js
similarity index 89%
rename from __tests__/components/GroupsPersonHeader.js
rename to src/components/GroupsPersonHeader/__tests__/GroupsPersonHeader.js
index a6bc43a7a5..6a53610b0b 100644
--- a/__tests__/components/GroupsPersonHeader.js
+++ b/src/components/GroupsPersonHeader/__tests__/GroupsPersonHeader.js
@@ -3,26 +3,28 @@ import uuidv4 from 'uuid/v4';
import thunk from 'redux-thunk';
import configureStore from 'redux-mock-store';
-import { ACTIONS } from '../../src/constants';
-import { createContactAssignment } from '../../src/actions/person';
-import GroupsPersonHeader from '../../src/components/GroupsPersonHeader';
-import { testSnapshotShallow, renderShallow } from '../../testUtils';
+import { ACTIONS } from '../../../constants';
+import { createContactAssignment } from '../../../actions/person';
+
+import GroupsPersonHeader from '..';
+
+import { testSnapshotShallow, renderShallow } from '../../../../testUtils';
import {
getPersonEmailAddress,
getPersonPhoneNumber,
getStageIndex,
-} from '../../src/utils/common';
-import { navigatePush } from '../../src/actions/navigation';
-import { STATUS_SELECT_SCREEN } from '../../src/containers/StatusSelectScreen';
-import { PERSON_STAGE_SCREEN } from '../../src/containers/PersonStageScreen';
-import { STAGE_SCREEN } from '../../src/containers/StageScreen';
-import { openCommunicationLink } from '../../src/actions/misc';
+} from '../../../utils/common';
+import { navigatePush } from '../../../actions/navigation';
+import { STATUS_SELECT_SCREEN } from '../../../containers/StatusSelectScreen';
+import { PERSON_STAGE_SCREEN } from '../../../containers/PersonStageScreen';
+import { STAGE_SCREEN } from '../../../containers/StageScreen';
+import { openCommunicationLink } from '../../../actions/misc';
jest.mock('uuid/v4');
-jest.mock('../../src/utils/common');
-jest.mock('../../src/actions/person');
-jest.mock('../../src/actions/misc');
-jest.mock('../../src/actions/navigation');
+jest.mock('../../../utils/common');
+jest.mock('../../../actions/person');
+jest.mock('../../../actions/misc');
+jest.mock('../../../actions/navigation');
const store = configureStore([thunk])();
@@ -246,7 +248,7 @@ describe('isContact', () => {
);
});
- it('renders no contact buttons for User-Created Org', () => {
+ it('renders no contact buttons if not Cru Org', () => {
testSnapshotShallow(
,
);
diff --git a/__tests__/components/__snapshots__/GroupsPersonHeader.js.snap b/src/components/GroupsPersonHeader/__tests__/__snapshots__/GroupsPersonHeader.js.snap
similarity index 99%
rename from __tests__/components/__snapshots__/GroupsPersonHeader.js.snap
rename to src/components/GroupsPersonHeader/__tests__/__snapshots__/GroupsPersonHeader.js.snap
index 3535590708..976b59fb48 100644
--- a/__tests__/components/__snapshots__/GroupsPersonHeader.js.snap
+++ b/src/components/GroupsPersonHeader/__tests__/__snapshots__/GroupsPersonHeader.js.snap
@@ -64,7 +64,7 @@ exports[`isContact with contact assignment does not render status button if cont
`;
-exports[`isContact with contact assignment renders no contact buttons for User-Created Org 1`] = `
+exports[`isContact with contact assignment renders no contact buttons if not Cru Org 1`] = `
{
testSnapshotShallow();
diff --git a/__tests__/components/__snapshots__/LoadMore.js.snap b/src/components/LoadMore/__tests__/__snapshots__/LoadMore.js.snap
similarity index 100%
rename from __tests__/components/__snapshots__/LoadMore.js.snap
rename to src/components/LoadMore/__tests__/__snapshots__/LoadMore.js.snap
diff --git a/src/components/LoadingWheel/__tests__/LoadingWheel.js b/src/components/LoadingWheel/__tests__/LoadingWheel.js
new file mode 100644
index 0000000000..beee7dbdd3
--- /dev/null
+++ b/src/components/LoadingWheel/__tests__/LoadingWheel.js
@@ -0,0 +1,9 @@
+import React from 'react';
+
+import { testSnapshotShallow } from '../../../../testUtils';
+
+import LoadingWheel from '..';
+
+it('renders correctly', () => {
+ testSnapshotShallow();
+});
diff --git a/__tests__/components/__snapshots__/LoadingWheel.js.snap b/src/components/LoadingWheel/__tests__/__snapshots__/LoadingWheel.js.snap
similarity index 100%
rename from __tests__/components/__snapshots__/LoadingWheel.js.snap
rename to src/components/LoadingWheel/__tests__/__snapshots__/LoadingWheel.js.snap
diff --git a/__tests__/components/MFACodeComponent.js b/src/components/MFACodeComponent/__tests__/MFACodeComponent.js
similarity index 91%
rename from __tests__/components/MFACodeComponent.js
rename to src/components/MFACodeComponent/__tests__/MFACodeComponent.js
index fac07ed8d3..fea20dadd3 100644
--- a/__tests__/components/MFACodeComponent.js
+++ b/src/components/MFACodeComponent/__tests__/MFACodeComponent.js
@@ -1,7 +1,8 @@
import React from 'react';
-import { renderShallow, testSnapshotShallow } from '../../testUtils';
-import MFACodeComponent from '../../src/components/MFACodeComponent';
+import { renderShallow, testSnapshotShallow } from '../../../../testUtils';
+
+import MFACodeComponent from '..';
it('renders loading', () => {
testSnapshotShallow(
diff --git a/__tests__/components/__snapshots__/MFACodeComponent.js.snap b/src/components/MFACodeComponent/__tests__/__snapshots__/MFACodeComponent.js.snap
similarity index 100%
rename from __tests__/components/__snapshots__/MFACodeComponent.js.snap
rename to src/components/MFACodeComponent/__tests__/__snapshots__/MFACodeComponent.js.snap
diff --git a/__tests__/components/NullStateComponent.js b/src/components/NullStateComponent/__tests__/NullStateComponent.js
similarity index 64%
rename from __tests__/components/NullStateComponent.js
rename to src/components/NullStateComponent/__tests__/NullStateComponent.js
index cb06944275..3d48b048e1 100644
--- a/__tests__/components/NullStateComponent.js
+++ b/src/components/NullStateComponent/__tests__/NullStateComponent.js
@@ -1,7 +1,8 @@
import React from 'react';
-import { testSnapshotShallow } from '../../testUtils';
-import NullStateComponent from '../../src/components/NullStateComponent';
+import { testSnapshotShallow } from '../../../../testUtils';
+
+import NullStateComponent from '..';
it('render assigned contact', () => {
testSnapshotShallow(
diff --git a/__tests__/components/__snapshots__/NullStateComponent.js.snap b/src/components/NullStateComponent/__tests__/__snapshots__/NullStateComponent.js.snap
similarity index 100%
rename from __tests__/components/__snapshots__/NullStateComponent.js.snap
rename to src/components/NullStateComponent/__tests__/__snapshots__/NullStateComponent.js.snap
diff --git a/__tests__/PeopleList.js b/src/components/PeopleList/__tests__/PeopleList.js
similarity index 93%
rename from __tests__/PeopleList.js
rename to src/components/PeopleList/__tests__/PeopleList.js
index 7abaf74acf..e247f50d33 100644
--- a/__tests__/PeopleList.js
+++ b/src/components/PeopleList/__tests__/PeopleList.js
@@ -1,9 +1,9 @@
import { LayoutAnimation } from 'react-native';
import React from 'react';
-// Note: test renderer must be required after react-native.
-import { renderShallow, testSnapshotShallow } from '../testUtils';
-import PeopleList from '../src/components/PeopleList';
+import { renderShallow, testSnapshotShallow } from '../../../../testUtils';
+
+import PeopleList from '..';
LayoutAnimation.configureNext = jest.fn();
diff --git a/__tests__/__snapshots__/PeopleList.js.snap b/src/components/PeopleList/__tests__/__snapshots__/PeopleList.js.snap
similarity index 100%
rename from __tests__/__snapshots__/PeopleList.js.snap
rename to src/components/PeopleList/__tests__/__snapshots__/PeopleList.js.snap
diff --git a/__tests__/components/PersonSideMenu.js b/src/components/PersonSideMenu/__tests__/PersonSideMenu.js
similarity index 88%
rename from __tests__/components/PersonSideMenu.js
rename to src/components/PersonSideMenu/__tests__/PersonSideMenu.js
index 2a75fa3cc3..3bd160b77e 100644
--- a/__tests__/components/PersonSideMenu.js
+++ b/src/components/PersonSideMenu/__tests__/PersonSideMenu.js
@@ -2,29 +2,30 @@ import React from 'react';
import { Alert } from 'react-native';
import { DrawerActions } from 'react-navigation';
-import PersonSideMenu from '../../src/components/PersonSideMenu';
+import PersonSideMenu from '..';
+
import {
renderShallow,
createMockStore,
createMockNavState,
testSnapshotShallow,
-} from '../../testUtils';
-import { ADD_CONTACT_SCREEN } from '../../src/containers/AddContactScreen';
-import { STATUS_REASON_SCREEN } from '../../src/containers/StatusReasonScreen';
-import { navigatePush, navigateBack } from '../../src/actions/navigation';
+} from '../../../../testUtils';
+import { ADD_CONTACT_SCREEN } from '../../../containers/AddContactScreen';
+import { STATUS_REASON_SCREEN } from '../../../containers/StatusReasonScreen';
+import { navigatePush, navigateBack } from '../../../actions/navigation';
import {
personSelector,
orgPermissionSelector,
contactAssignmentSelector,
-} from '../../src/selectors/people';
-import { deleteContactAssignment } from '../../src/actions/person';
-import { assignContactAndPickStage } from '../../src/actions/misc';
-
-jest.mock('../../src/actions/navigation');
-jest.mock('../../src/actions/person');
-jest.mock('../../src/actions/steps');
-jest.mock('../../src/selectors/people');
-jest.mock('../../src/actions/misc');
+} from '../../../selectors/people';
+import { deleteContactAssignment } from '../../../actions/person';
+import { assignContactAndPickStage } from '../../../actions/misc';
+
+jest.mock('../../../actions/navigation');
+jest.mock('../../../actions/person');
+jest.mock('../../../actions/steps');
+jest.mock('../../../selectors/people');
+jest.mock('../../../actions/misc');
jest.mock('react-navigation', () => ({
DrawerActions: {
closeDrawer: jest.fn(),
diff --git a/__tests__/components/__snapshots__/PersonSideMenu.js.snap b/src/components/PersonSideMenu/__tests__/__snapshots__/PersonSideMenu.js.snap
similarity index 100%
rename from __tests__/components/__snapshots__/PersonSideMenu.js.snap
rename to src/components/PersonSideMenu/__tests__/__snapshots__/PersonSideMenu.js.snap
diff --git a/__tests__/components/PopupMenu.android.js b/src/components/PopupMenu/__tests__/PopupMenu.android.js
similarity index 87%
rename from __tests__/components/PopupMenu.android.js
rename to src/components/PopupMenu/__tests__/PopupMenu.android.js
index a52f66332c..435fdf7ba0 100644
--- a/__tests__/components/PopupMenu.android.js
+++ b/src/components/PopupMenu/__tests__/PopupMenu.android.js
@@ -2,8 +2,8 @@ import React from 'react';
import { UIManager } from 'react-native';
import { shallow } from 'enzyme';
-import PopupMenu from '../../src/components/PopupMenu/index.android.js';
-import { testSnapshotShallow } from '../../testUtils';
+import PopupMenu from '../index.android.js';
+import { testSnapshotShallow } from '../../../../testUtils';
const onPress = jest.fn();
const props = {
diff --git a/__tests__/components/PopupMenu.ios.js b/src/components/PopupMenu/__tests__/PopupMenu.ios.js
similarity index 83%
rename from __tests__/components/PopupMenu.ios.js
rename to src/components/PopupMenu/__tests__/PopupMenu.ios.js
index dca6f9a835..b773bbabbc 100644
--- a/__tests__/components/PopupMenu.ios.js
+++ b/src/components/PopupMenu/__tests__/PopupMenu.ios.js
@@ -1,8 +1,8 @@
import React from 'react';
import { ActionSheetIOS } from 'react-native';
-import PopupMenu from '../../src/components/PopupMenu/index.ios.js';
-import { testSnapshotShallow, renderShallow } from '../../testUtils';
+import PopupMenu from '../index.ios.js';
+import { testSnapshotShallow, renderShallow } from '../../../../testUtils';
const onPress = jest.fn();
const props = {
diff --git a/__tests__/components/__snapshots__/PopupMenu.android.js.snap b/src/components/PopupMenu/__tests__/__snapshots__/PopupMenu.android.js.snap
similarity index 100%
rename from __tests__/components/__snapshots__/PopupMenu.android.js.snap
rename to src/components/PopupMenu/__tests__/__snapshots__/PopupMenu.android.js.snap
diff --git a/__tests__/components/__snapshots__/PopupMenu.ios.js.snap b/src/components/PopupMenu/__tests__/__snapshots__/PopupMenu.ios.js.snap
similarity index 100%
rename from __tests__/components/__snapshots__/PopupMenu.ios.js.snap
rename to src/components/PopupMenu/__tests__/__snapshots__/PopupMenu.ios.js.snap
diff --git a/__tests__/RadioButton.js b/src/components/RadioButton/__tests__/RadioButton.js
similarity index 66%
rename from __tests__/RadioButton.js
rename to src/components/RadioButton/__tests__/RadioButton.js
index e3813befbe..d67140e334 100644
--- a/__tests__/RadioButton.js
+++ b/src/components/RadioButton/__tests__/RadioButton.js
@@ -1,9 +1,9 @@
import 'react-native';
import React from 'react';
-// Note: test renderer must be required after react-native.
-import { RadioButton } from '../src/components/common';
-import { testSnapshot } from '../testUtils';
+import RadioButton from '..';
+
+import { testSnapshot } from '../../../../testUtils';
const props = {
onSelect: jest.fn(),
diff --git a/__tests__/__snapshots__/RadioButton.js.snap b/src/components/RadioButton/__tests__/__snapshots__/RadioButton.js.snap
similarity index 100%
rename from __tests__/__snapshots__/RadioButton.js.snap
rename to src/components/RadioButton/__tests__/__snapshots__/RadioButton.js.snap
diff --git a/__tests__/RowSwipeable.js b/src/components/RowSwipeable/__tests__/RowSwipeable.js
similarity index 95%
rename from __tests__/RowSwipeable.js
rename to src/components/RowSwipeable/__tests__/RowSwipeable.js
index f334fb68d0..d806ef2588 100644
--- a/__tests__/RowSwipeable.js
+++ b/src/components/RowSwipeable/__tests__/RowSwipeable.js
@@ -4,9 +4,9 @@ import { View } from 'react-native';
import Enzyme, { shallow } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
-// Note: test renderer must be required after react-native.
-import RowSwipeable from '../src/components/RowSwipeable';
-import { testSnapshot } from '../testUtils';
+import RowSwipeable from '..';
+
+import { testSnapshot } from '../../../../testUtils';
const mockStart = jest.fn();
beforeEach(() => {
diff --git a/__tests__/__snapshots__/RowSwipeable.js.snap b/src/components/RowSwipeable/__tests__/__snapshots__/RowSwipeable.js.snap
similarity index 100%
rename from __tests__/__snapshots__/RowSwipeable.js.snap
rename to src/components/RowSwipeable/__tests__/__snapshots__/RowSwipeable.js.snap
diff --git a/__tests__/components/SearchList.js b/src/components/SearchList/__tests__/SearchList.js
similarity index 96%
rename from __tests__/components/SearchList.js
rename to src/components/SearchList/__tests__/SearchList.js
index 87ac5e4bc5..fdfaf31ff4 100644
--- a/__tests__/components/SearchList.js
+++ b/src/components/SearchList/__tests__/SearchList.js
@@ -1,8 +1,10 @@
import React from 'react';
-import { renderShallow, testSnapshotShallow } from '../../testUtils';
-import SearchList from '../../src/components/SearchList';
-import { Text } from '../../src/components/common';
+import { renderShallow, testSnapshotShallow } from '../../../../testUtils';
+
+import SearchList from '..';
+
+import Text from '../../Text';
it('renders search list', () => {
testSnapshotShallow(
diff --git a/__tests__/components/__snapshots__/SearchList.js.snap b/src/components/SearchList/__tests__/__snapshots__/SearchList.js.snap
similarity index 100%
rename from __tests__/components/__snapshots__/SearchList.js.snap
rename to src/components/SearchList/__tests__/__snapshots__/SearchList.js.snap
diff --git a/__tests__/SearchPeopleItem.js b/src/components/SearchPeopleItem/__tests__/SearchPeopleItem.js
similarity index 88%
rename from __tests__/SearchPeopleItem.js
rename to src/components/SearchPeopleItem/__tests__/SearchPeopleItem.js
index 1d72399db9..a5f585cb4a 100644
--- a/__tests__/SearchPeopleItem.js
+++ b/src/components/SearchPeopleItem/__tests__/SearchPeopleItem.js
@@ -3,9 +3,9 @@ import React from 'react';
import Enzyme, { shallow } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
-// Note: test renderer must be required after react-native.
-import SearchPeopleItem from '../src/components/SearchPeopleItem';
-import { testSnapshot, testSnapshotShallow } from '../testUtils';
+import SearchPeopleItem from '..';
+
+import { testSnapshot, testSnapshotShallow } from '../../../../testUtils';
const mockPerson = {
id: '123',
diff --git a/__tests__/__snapshots__/SearchPeopleItem.js.snap b/src/components/SearchPeopleItem/__tests__/__snapshots__/SearchPeopleItem.js.snap
similarity index 100%
rename from __tests__/__snapshots__/SearchPeopleItem.js.snap
rename to src/components/SearchPeopleItem/__tests__/__snapshots__/SearchPeopleItem.js.snap
diff --git a/src/components/Separator/__tests__/Separator.js b/src/components/Separator/__tests__/Separator.js
new file mode 100644
index 0000000000..9d0e0e5b75
--- /dev/null
+++ b/src/components/Separator/__tests__/Separator.js
@@ -0,0 +1,10 @@
+import 'react-native';
+import React from 'react';
+
+import Separator from '..';
+
+import { testSnapshot } from '../../../../testUtils';
+
+it('renders correctly', () => {
+ testSnapshot();
+});
diff --git a/__tests__/__snapshots__/Separator.js.snap b/src/components/Separator/__tests__/__snapshots__/Separator.js.snap
similarity index 100%
rename from __tests__/__snapshots__/Separator.js.snap
rename to src/components/Separator/__tests__/__snapshots__/Separator.js.snap
diff --git a/__tests__/SettingsMenu.js b/src/components/SettingsMenu/__tests__/SettingsMenu.js
similarity index 50%
rename from __tests__/SettingsMenu.js
rename to src/components/SettingsMenu/__tests__/SettingsMenu.js
index a9ec8c853e..cefde15613 100644
--- a/__tests__/SettingsMenu.js
+++ b/src/components/SettingsMenu/__tests__/SettingsMenu.js
@@ -1,10 +1,9 @@
import 'react-native';
import React from 'react';
-// Note: test renderer must be required after react-native.
-import { createMockStore } from '../testUtils/index';
-import SettingsMenu from '../src/components/SettingsMenu';
-import { testSnapshotShallow } from '../testUtils';
+import { createMockStore, testSnapshotShallow } from '../../../../testUtils';
+
+import SettingsMenu from '..';
const mockState = {
auth: { isFirstTime: false },
diff --git a/__tests__/__snapshots__/SettingsMenu.js.snap b/src/components/SettingsMenu/__tests__/__snapshots__/SettingsMenu.js.snap
similarity index 100%
rename from __tests__/__snapshots__/SettingsMenu.js.snap
rename to src/components/SettingsMenu/__tests__/__snapshots__/SettingsMenu.js.snap
diff --git a/__tests__/components/ShareSurveyMenu.js b/src/components/ShareSurveyMenu/__tests__/ShareSurveyMenu.js
similarity index 86%
rename from __tests__/components/ShareSurveyMenu.js
rename to src/components/ShareSurveyMenu/__tests__/ShareSurveyMenu.js
index cd1581cc30..6c3cf3982d 100644
--- a/__tests__/components/ShareSurveyMenu.js
+++ b/src/components/ShareSurveyMenu/__tests__/ShareSurveyMenu.js
@@ -1,8 +1,9 @@
import React from 'react';
import { Share, Linking } from 'react-native';
-import ShareSurveyMenu from '../../src/components/ShareSurveyMenu';
-import { testSnapshotShallow, renderShallow } from '../../testUtils';
+import ShareSurveyMenu from '..';
+
+import { testSnapshotShallow, renderShallow } from '../../../../testUtils';
const props = {
survey: { id: '1', title: 'test' },
diff --git a/__tests__/components/__snapshots__/ShareSurveyMenu.js.snap b/src/components/ShareSurveyMenu/__tests__/__snapshots__/ShareSurveyMenu.js.snap
similarity index 100%
rename from __tests__/components/__snapshots__/ShareSurveyMenu.js.snap
rename to src/components/ShareSurveyMenu/__tests__/__snapshots__/ShareSurveyMenu.js.snap
diff --git a/__tests__/containers/StepItem.js b/src/components/StepItem/__tests__/StepItem.js
similarity index 96%
rename from __tests__/containers/StepItem.js
rename to src/components/StepItem/__tests__/StepItem.js
index b0dc732efe..89c9c2dc44 100644
--- a/__tests__/containers/StepItem.js
+++ b/src/components/StepItem/__tests__/StepItem.js
@@ -7,8 +7,9 @@ import {
createMockStore,
renderShallow,
testSnapshotShallow,
-} from '../../testUtils';
-import StepItem from '../../src/components/StepItem';
+} from '../../../../testUtils';
+
+import StepItem from '..';
const date = '2017-12-06T14:24:52Z';
const mockStep = {
diff --git a/__tests__/containers/__snapshots__/StepItem.js.snap b/src/components/StepItem/__tests__/__snapshots__/StepItem.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/StepItem.js.snap
rename to src/components/StepItem/__tests__/__snapshots__/StepItem.js.snap
diff --git a/__tests__/components/StepsList.js b/src/components/StepsList/__tests__/StepsList.js
similarity index 82%
rename from __tests__/components/StepsList.js
rename to src/components/StepsList/__tests__/StepsList.js
index 2a38f204ab..3903e557ea 100644
--- a/__tests__/components/StepsList.js
+++ b/src/components/StepsList/__tests__/StepsList.js
@@ -2,9 +2,9 @@ import 'react-native';
import React from 'react';
import { shallow } from 'enzyme';
-// Note: test renderer must be required after react-native.
-import StepsList from '../../src/components/StepsList';
-import { testSnapshot } from '../../testUtils';
+import StepsList from '..';
+
+import { testSnapshot } from '../../../../testUtils';
const items = [
{ id: '1', body: 'I feel great', selected: true },
diff --git a/__tests__/components/__snapshots__/StepsList.js.snap b/src/components/StepsList/__tests__/__snapshots__/StepsList.js.snap
similarity index 100%
rename from __tests__/components/__snapshots__/StepsList.js.snap
rename to src/components/StepsList/__tests__/__snapshots__/StepsList.js.snap
diff --git a/src/components/SwipeTabMenu/__tests__/SwipeTabMenu.js b/src/components/SwipeTabMenu/__tests__/SwipeTabMenu.js
index 0fd08e0b09..52f10c0a97 100644
--- a/src/components/SwipeTabMenu/__tests__/SwipeTabMenu.js
+++ b/src/components/SwipeTabMenu/__tests__/SwipeTabMenu.js
@@ -2,7 +2,8 @@ import React from 'react';
import { Text, ScrollView } from 'react-native';
import { createMaterialTopTabNavigator } from 'react-navigation';
-import { SwipeTabMenu, generateSwipeTabMenuNavigator } from '../';
+import { SwipeTabMenu, generateSwipeTabMenuNavigator } from '..';
+
import { Touchable } from '../../../../src/components/common';
import { renderShallow, testSnapshotShallow } from '../../../../testUtils';
import * as common from '../../../utils/common';
diff --git a/__tests__/Text.js b/src/components/Text/__tests__/Text.js
similarity index 73%
rename from __tests__/Text.js
rename to src/components/Text/__tests__/Text.js
index fce0d90b53..d63decded1 100644
--- a/__tests__/Text.js
+++ b/src/components/Text/__tests__/Text.js
@@ -1,9 +1,9 @@
import 'react-native';
import React from 'react';
-// Note: test renderer must be required after react-native.
-import { Text } from '../src/components/common';
-import { testSnapshot } from '../testUtils';
+import Text from '..';
+
+import { testSnapshot } from '../../../../testUtils';
it('renders correctly', () => {
testSnapshot(Hello);
diff --git a/__tests__/__snapshots__/Text.js.snap b/src/components/Text/__tests__/__snapshots__/Text.js.snap
similarity index 100%
rename from __tests__/__snapshots__/Text.js.snap
rename to src/components/Text/__tests__/__snapshots__/Text.js.snap
diff --git a/__tests__/containers/AddChallengeScreen.js b/src/containers/AddChallengeScreen/__tests__/AddChallengeScreen.js
similarity index 97%
rename from __tests__/containers/AddChallengeScreen.js
rename to src/containers/AddChallengeScreen/__tests__/AddChallengeScreen.js
index a7390fb332..e804ee0138 100644
--- a/__tests__/containers/AddChallengeScreen.js
+++ b/src/containers/AddChallengeScreen/__tests__/AddChallengeScreen.js
@@ -3,13 +3,14 @@ import { Provider } from 'react-redux';
import MockDate from 'mockdate';
import moment from 'moment';
-import AddChallengeScreen from '../../src/containers/AddChallengeScreen';
+import AddChallengeScreen from '..';
+
import {
createMockNavState,
testSnapshot,
createMockStore,
renderShallow,
-} from '../../testUtils';
+} from '../../../../testUtils';
const mockDate = '2018-09-01';
MockDate.set(mockDate);
diff --git a/__tests__/containers/__snapshots__/AddChallengeScreen.js.snap b/src/containers/AddChallengeScreen/__tests__/__snapshots__/AddChallengeScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/AddChallengeScreen.js.snap
rename to src/containers/AddChallengeScreen/__tests__/__snapshots__/AddChallengeScreen.js.snap
diff --git a/__tests__/containers/AddContactFields.js b/src/containers/AddContactFields/__tests__/AddContactFields.js
similarity index 96%
rename from __tests__/containers/AddContactFields.js
rename to src/containers/AddContactFields/__tests__/AddContactFields.js
index 14c8b806b4..8a74878e9e 100644
--- a/__tests__/containers/AddContactFields.js
+++ b/src/containers/AddContactFields/__tests__/AddContactFields.js
@@ -2,16 +2,18 @@ import React from 'react';
import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
-import { ORG_PERMISSIONS } from '../../src/constants';
-import AddContactFields from '../../src/containers/AddContactFields';
+import { ORG_PERMISSIONS } from '../../../constants';
+
+import AddContactFields from '..';
+
import {
testSnapshotShallow,
renderShallow,
createMockStore,
-} from '../../testUtils';
-import { orgPermissionSelector } from '../../src/selectors/people';
+} from '../../../../testUtils';
+import { orgPermissionSelector } from '../../../selectors/people';
-jest.mock('../../src/selectors/people');
+jest.mock('../../../selectors/people');
const mockStore = configureStore([thunk]);
const orgPermission = { permission_id: ORG_PERMISSIONS.CONTACT };
diff --git a/__tests__/containers/__snapshots__/AddContactFields.js.snap b/src/containers/AddContactFields/__tests__/__snapshots__/AddContactFields.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/AddContactFields.js.snap
rename to src/containers/AddContactFields/__tests__/__snapshots__/AddContactFields.js.snap
diff --git a/__tests__/containers/AddContactScreen.js b/src/containers/AddContactScreen/__tests__/AddContactScreen.js
similarity index 93%
rename from __tests__/containers/AddContactScreen.js
rename to src/containers/AddContactScreen/__tests__/AddContactScreen.js
index 8da8b49fa9..f9073ff25f 100644
--- a/__tests__/containers/AddContactScreen.js
+++ b/src/containers/AddContactScreen/__tests__/AddContactScreen.js
@@ -6,15 +6,17 @@ import {
createMockNavState,
renderShallow,
testSnapshotShallow,
-} from '../../testUtils';
-import AddContactScreen from '../../src/containers/AddContactScreen';
-import { addNewPerson } from '../../src/actions/organizations';
-import { updatePerson } from '../../src/actions/person';
-import * as organizations from '../../src/actions/organizations';
-import * as person from '../../src/actions/person';
-import { navigateBack, navigatePush } from '../../src/actions/navigation';
-import { PERSON_STAGE_SCREEN } from '../../src/containers/PersonStageScreen';
-import { ORG_PERMISSIONS, CANNOT_EDIT_FIRST_NAME } from '../../src/constants';
+} from '../../../../testUtils';
+
+import AddContactScreen from '..';
+
+import { addNewPerson } from '../../../actions/organizations';
+import { updatePerson } from '../../../actions/person';
+import * as organizations from '../../../actions/organizations';
+import * as person from '../../../actions/person';
+import { navigateBack, navigatePush } from '../../../actions/navigation';
+import { PERSON_STAGE_SCREEN } from '../../PersonStageScreen';
+import { ORG_PERMISSIONS, CANNOT_EDIT_FIRST_NAME } from '../../../constants';
const me = { id: 99 };
const contactId = 23;
@@ -32,7 +34,7 @@ const mockAddNewPerson = {
reverse_contact_assignments: [mockContactAssignment],
},
};
-jest.mock('../../src/actions/organizations', () => ({
+jest.mock('../../../actions/organizations', () => ({
addNewPerson: jest.fn(() => mockAddNewPerson),
}));
const mockUpdatePerson = {
@@ -44,11 +46,11 @@ const mockUpdatePerson = {
reverse_contact_assignments: [mockContactAssignment],
},
};
-jest.mock('../../src/actions/person', () => ({
+jest.mock('../../../actions/person', () => ({
updatePerson: jest.fn(() => mockUpdatePerson),
}));
-jest.mock('../../src/actions/navigation');
+jest.mock('../../../actions/navigation');
jest.mock('react-native-device-info');
diff --git a/__tests__/containers/__snapshots__/AddContactScreen.js.snap b/src/containers/AddContactScreen/__tests__/__snapshots__/AddContactScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/AddContactScreen.js.snap
rename to src/containers/AddContactScreen/__tests__/__snapshots__/AddContactScreen.js.snap
diff --git a/__tests__/containers/AddStepScreen.js b/src/containers/AddStepScreen/__tests__/AddStepScreen.js
similarity index 94%
rename from __tests__/containers/AddStepScreen.js
rename to src/containers/AddStepScreen/__tests__/AddStepScreen.js
index cfa1811da7..fb0f8b897f 100644
--- a/__tests__/containers/AddStepScreen.js
+++ b/src/containers/AddStepScreen/__tests__/AddStepScreen.js
@@ -4,16 +4,16 @@ import Enzyme, { shallow } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import { Provider } from 'react-redux';
-// Note: test renderer must be required after react-native.
-import AddStepScreen from '../../src/containers/AddStepScreen/index';
+import AddStepScreen from '..';
+
import {
createMockNavState,
testSnapshot,
createMockStore,
-} from '../../testUtils';
-import { CREATE_STEP, STEP_NOTE } from '../../src/constants';
-import * as common from '../../src/utils/common';
-import locale from '../../src/i18n/locales/en-US';
+} from '../../../../testUtils';
+import { CREATE_STEP, STEP_NOTE } from '../../../constants';
+import * as common from '../../../utils/common';
+import locale from '../../../i18n/locales/en-US';
const store = createMockStore();
diff --git a/__tests__/containers/__snapshots__/AddStepScreen.js.snap b/src/containers/AddStepScreen/__tests__/__snapshots__/AddStepScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/AddStepScreen.js.snap
rename to src/containers/AddStepScreen/__tests__/__snapshots__/AddStepScreen.js.snap
diff --git a/__tests__/containers/BackButton.js b/src/containers/BackButton/__tests__/BackButton.js
similarity index 88%
rename from __tests__/containers/BackButton.js
rename to src/containers/BackButton/__tests__/BackButton.js
index 53fa3de712..bf3a99ecbb 100644
--- a/__tests__/containers/BackButton.js
+++ b/src/containers/BackButton/__tests__/BackButton.js
@@ -3,10 +3,11 @@ import Adapter from 'enzyme-adapter-react-16/build/index';
import { shallow } from 'enzyme/build/index';
import Enzyme from 'enzyme/build/index';
-import { BackButton } from '../../src/containers/BackButton';
-import { createMockStore } from '../../testUtils/index';
-import * as navigation from '../../src/actions/navigation';
-import IconButton from '../../src/components/IconButton';
+import { BackButton } from '..';
+
+import { createMockStore } from '../../../../testUtils';
+import * as navigation from '../../../actions/navigation';
+import IconButton from '../../../components/IconButton';
const store = createMockStore();
let shallowScreen;
diff --git a/__tests__/containers/__snapshots__/BackButton.js.snap b/src/containers/BackButton/__tests__/__snapshots__/BackButton.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/BackButton.js.snap
rename to src/containers/BackButton/__tests__/__snapshots__/BackButton.js.snap
diff --git a/__tests__/containers/CelebrationScreen.js b/src/containers/CelebrationScreen/__tests__/CelebrationScreen.js
similarity index 87%
rename from __tests__/containers/CelebrationScreen.js
rename to src/containers/CelebrationScreen/__tests__/CelebrationScreen.js
index 7ef6d5daf5..7e0f91400f 100644
--- a/__tests__/containers/CelebrationScreen.js
+++ b/src/containers/CelebrationScreen/__tests__/CelebrationScreen.js
@@ -4,15 +4,16 @@ import Enzyme, { shallow } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import { Provider } from 'react-redux';
-// Note: test renderer must be required after react-native.
import {
createMockStore,
createMockNavState,
testSnapshot,
-} from '../../testUtils';
-import CelebrationScreen from '../../src/containers/CelebrationScreen';
-import * as navigation from '../../src/actions/navigation';
-import * as common from '../../src/utils/common';
+} from '../../../../testUtils';
+
+import CelebrationScreen from '..';
+
+import * as navigation from '../../../actions/navigation';
+import * as common from '../../../utils/common';
const store = createMockStore();
diff --git a/__tests__/containers/__snapshots__/CelebrationScreen.js.snap b/src/containers/CelebrationScreen/__tests__/__snapshots__/CelebrationScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/CelebrationScreen.js.snap
rename to src/containers/CelebrationScreen/__tests__/__snapshots__/CelebrationScreen.js.snap
diff --git a/__tests__/containers/ChallengeFeed.js b/src/containers/ChallengeFeed/__tests__/ChallengeFeed.js
similarity index 91%
rename from __tests__/containers/ChallengeFeed.js
rename to src/containers/ChallengeFeed/__tests__/ChallengeFeed.js
index c4350d9086..4630e36cfb 100644
--- a/__tests__/containers/ChallengeFeed.js
+++ b/src/containers/ChallengeFeed/__tests__/ChallengeFeed.js
@@ -2,20 +2,21 @@ import React from 'react';
import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
-import ChallengeFeed from '../../src/containers/ChallengeFeed';
-import { renderShallow } from '../../testUtils';
-import { ORG_PERMISSIONS } from '../../src/constants';
-import * as navigation from '../../src/actions/navigation';
-import * as challenges from '../../src/actions/challenges';
-import { ADD_CHALLENGE_SCREEN } from '../../src/containers/AddChallengeScreen';
-
-jest.mock('../../src/actions/challenges', () => ({
+import ChallengeFeed from '..';
+
+import { renderShallow } from '../../../../testUtils';
+import { ORG_PERMISSIONS } from '../../../constants';
+import * as navigation from '../../../actions/navigation';
+import * as challenges from '../../../actions/challenges';
+import { ADD_CHALLENGE_SCREEN } from '../../AddChallengeScreen';
+
+jest.mock('../../../actions/challenges', () => ({
completeChallenge: jest.fn(() => ({ type: 'complete' })),
joinChallenge: jest.fn(() => ({ type: 'join' })),
updateChallenge: jest.fn(() => ({ type: 'update' })),
}));
-jest.mock('../../src/actions/navigation', () => ({
+jest.mock('../../../actions/navigation', () => ({
navigatePush: jest.fn(() => ({ type: 'push' })),
}));
diff --git a/__tests__/containers/__snapshots__/ChallengeFeed.js.snap b/src/containers/ChallengeFeed/__tests__/__snapshots__/ChallengeFeed.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/ChallengeFeed.js.snap
rename to src/containers/ChallengeFeed/__tests__/__snapshots__/ChallengeFeed.js.snap
diff --git a/__tests__/containers/ContactActions.js b/src/containers/ContactActions/__tests__/ContactActions.js
similarity index 87%
rename from __tests__/containers/ContactActions.js
rename to src/containers/ContactActions/__tests__/ContactActions.js
index ce0aad1017..ff0501a774 100644
--- a/__tests__/containers/ContactActions.js
+++ b/src/containers/ContactActions/__tests__/ContactActions.js
@@ -6,10 +6,11 @@ import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
import { Provider } from 'react-redux';
-import * as navigation from '../../src/actions/navigation';
-import * as interactions from '../../src/actions/interactions';
-import { createMockNavState, testSnapshot } from '../../testUtils';
-import { ContactActions } from '../../src/containers/ContactActions';
+import * as navigation from '../../../actions/navigation';
+import * as interactions from '../../../actions/interactions';
+import { createMockNavState, testSnapshot } from '../../../../testUtils';
+
+import { ContactActions } from '..';
const personId = '123';
diff --git a/__tests__/containers/__snapshots__/ContactActions.js.snap b/src/containers/ContactActions/__tests__/__snapshots__/ContactActions.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/ContactActions.js.snap
rename to src/containers/ContactActions/__tests__/__snapshots__/ContactActions.js.snap
diff --git a/__tests__/containers/ContactJourney.js b/src/containers/ContactJourney/__tests__/ContactJourney.js
similarity index 96%
rename from __tests__/containers/ContactJourney.js
rename to src/containers/ContactJourney/__tests__/ContactJourney.js
index 1d73744851..a1be080edb 100644
--- a/__tests__/containers/ContactJourney.js
+++ b/src/containers/ContactJourney/__tests__/ContactJourney.js
@@ -4,13 +4,15 @@ import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
import { Provider } from 'react-redux';
-import * as navigation from '../../src/actions/navigation';
-import ContactJourney from '../../src/containers/ContactJourney';
+import * as navigation from '../../../actions/navigation';
+
+import ContactJourney from '..';
+
import {
createMockNavState,
renderShallow,
testSnapshot,
-} from '../../testUtils';
+} from '../../../../testUtils';
const personId = '123';
const organizationId = 2;
@@ -28,7 +30,7 @@ const mockJourneyList = [
const mockAddComment = jest.fn(() => Promise.resolve());
const mockEditComment = jest.fn(() => Promise.resolve());
jest.mock('react-native-device-info');
-jest.mock('../../src/actions/interactions', () => ({
+jest.mock('../../../actions/interactions', () => ({
addNewInteraction: () => mockAddComment,
editComment: () => mockEditComment,
}));
diff --git a/__tests__/containers/__snapshots__/ContactJourney.js.snap b/src/containers/ContactJourney/__tests__/__snapshots__/ContactJourney.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/ContactJourney.js.snap
rename to src/containers/ContactJourney/__tests__/__snapshots__/ContactJourney.js.snap
diff --git a/__tests__/containers/ContactNotes.js b/src/containers/ContactNotes/__tests__/ContactNotes.js
similarity index 89%
rename from __tests__/containers/ContactNotes.js
rename to src/containers/ContactNotes/__tests__/ContactNotes.js
index a12efdefec..4d0f8436ae 100644
--- a/__tests__/containers/ContactNotes.js
+++ b/src/containers/ContactNotes/__tests__/ContactNotes.js
@@ -6,11 +6,13 @@ import Adapter from 'enzyme-adapter-react-16/build/index';
import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
-import '../../src/i18n';
-import { getPersonNote, savePersonNote } from '../../src/actions/person';
-import { ContactNotes } from '../../src/containers/ContactNotes';
-import Button from '../../src/components/Button';
-import { trackState } from '../../src/actions/analytics';
+import '../../../i18n';
+import { getPersonNote, savePersonNote } from '../../../actions/person';
+
+import { ContactNotes } from '..';
+
+import Button from '../../../components/Button';
+import { trackState } from '../../../actions/analytics';
Enzyme.configure({ adapter: new Adapter() });
@@ -26,8 +28,8 @@ savePersonNote.mockReturnValue(() => {});
trackState.mockReturnValue(() => {});
jest.mock('react-native-device-info');
-jest.mock('../../src/actions/person');
-jest.mock('../../src/actions/analytics');
+jest.mock('../../../actions/person');
+jest.mock('../../../actions/analytics');
beforeEach(() =>
(shallowScreen = shallow(
diff --git a/__tests__/containers/__snapshots__/ContactNotes.js.snap b/src/containers/ContactNotes/__tests__/__snapshots__/ContactNotes.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/ContactNotes.js.snap
rename to src/containers/ContactNotes/__tests__/__snapshots__/ContactNotes.js.snap
diff --git a/__tests__/containers/ContactSteps.js b/src/containers/ContactSteps/__tests__/ContactSteps.js
similarity index 81%
rename from __tests__/containers/ContactSteps.js
rename to src/containers/ContactSteps/__tests__/ContactSteps.js
index 448fd64fca..54071bd89d 100644
--- a/__tests__/containers/ContactSteps.js
+++ b/src/containers/ContactSteps/__tests__/ContactSteps.js
@@ -1,38 +1,38 @@
import 'react-native';
import React from 'react';
-import ContactSteps from '../../src/containers/ContactSteps';
+import ContactSteps from '..';
+
import {
createMockStore,
createMockNavState,
testSnapshotShallow,
renderShallow,
-} from '../../testUtils';
-import { navigatePush, navigateBack } from '../../src/actions/navigation';
-import { SELECT_MY_STEP_SCREEN } from '../../src/containers/SelectMyStepScreen';
-import { PERSON_SELECT_STEP_SCREEN } from '../../src/containers/PersonSelectStepScreen';
-import { buildTrackingObj } from '../../src/utils/common';
+} from '../../../../testUtils';
+import { navigatePush, navigateBack } from '../../../actions/navigation';
+import { SELECT_MY_STEP_SCREEN } from '../../SelectMyStepScreen';
+import { PERSON_SELECT_STEP_SCREEN } from '../../PersonSelectStepScreen';
+import { buildTrackingObj } from '../../../utils/common';
import {
getContactSteps,
completeStep,
deleteStepWithTracking,
-} from '../../src/actions/steps';
-import { contactAssignmentSelector } from '../../src/selectors/people';
-import { CONTACT_STEPS } from '../../src/constants';
-import { assignContactAndPickStage } from '../../src/actions/misc';
-import { promptToAssign } from '../../src/utils/promptToAssign';
-import { navigateToStageScreen } from '../../src/actions/misc';
-import { removeSwipeStepsContact } from '../../src/actions/swipe';
-import { reloadJourney } from '../../src/actions/journey';
-
-jest.mock('../../src/actions/steps');
-jest.mock('../../src/actions/navigation');
-jest.mock('../../src/selectors/people');
-jest.mock('react-native-device-info');
-jest.mock('../../src/actions/misc');
-jest.mock('../../src/utils/promptToAssign');
-jest.mock('../../src/actions/swipe');
-jest.mock('../../src/actions/journey');
+} from '../../../actions/steps';
+import { contactAssignmentSelector } from '../../../selectors/people';
+import { CONTACT_STEPS } from '../../../constants';
+import { assignContactAndPickStage } from '../../../actions/misc';
+import { promptToAssign } from '../../../utils/promptToAssign';
+import { navigateToStageScreen } from '../../../actions/misc';
+import { removeSwipeStepsContact } from '../../../actions/swipe';
+import { reloadJourney } from '../../../actions/journey';
+
+jest.mock('../../../actions/steps');
+jest.mock('../../../actions/navigation');
+jest.mock('../../../selectors/people');
+jest.mock('../../../actions/misc');
+jest.mock('../../../utils/promptToAssign');
+jest.mock('../../../actions/swipe');
+jest.mock('../../../actions/journey');
const steps = [{ id: '1', title: 'Test Step' }];
diff --git a/__tests__/containers/__snapshots__/ContactSteps.js.snap b/src/containers/ContactSteps/__tests__/__snapshots__/ContactSteps.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/ContactSteps.js.snap
rename to src/containers/ContactSteps/__tests__/__snapshots__/ContactSteps.js.snap
diff --git a/__tests__/containers/GetStartedScreen.js b/src/containers/GetStartedScreen/__tests__/GetStartedScreen.js
similarity index 83%
rename from __tests__/containers/GetStartedScreen.js
rename to src/containers/GetStartedScreen/__tests__/GetStartedScreen.js
index 33e1c6f570..f784988088 100644
--- a/__tests__/containers/GetStartedScreen.js
+++ b/src/containers/GetStartedScreen/__tests__/GetStartedScreen.js
@@ -3,16 +3,16 @@ import React from 'react';
import Enzyme, { shallow } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import { Provider } from 'react-redux';
-// Note: test renderer must be required after react-native.
-import GetStartedScreen from '../../src/containers/GetStartedScreen';
+import GetStartedScreen from '..';
+
import {
createMockNavState,
testSnapshot,
createMockStore,
-} from '../../testUtils';
-import * as navigation from '../../src/actions/navigation';
-import * as common from '../../src/utils/common';
+} from '../../../../testUtils';
+import * as navigation from '../../../actions/navigation';
+import * as common from '../../../utils/common';
const mockState = {
profile: {
diff --git a/__tests__/containers/__snapshots__/GetStartedScreen.js.snap b/src/containers/GetStartedScreen/__tests__/__snapshots__/GetStartedScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/GetStartedScreen.js.snap
rename to src/containers/GetStartedScreen/__tests__/__snapshots__/GetStartedScreen.js.snap
diff --git a/__tests__/containers/Groups/PersonScreen/AssignedPersonScreen.js b/src/containers/Groups/AssignedPersonScreen/__tests__/AssignedPersonScreen.js
similarity index 87%
rename from __tests__/containers/Groups/PersonScreen/AssignedPersonScreen.js
rename to src/containers/Groups/AssignedPersonScreen/__tests__/AssignedPersonScreen.js
index b2f9ce6a36..80b49962f0 100644
--- a/__tests__/containers/Groups/PersonScreen/AssignedPersonScreen.js
+++ b/src/containers/Groups/AssignedPersonScreen/__tests__/AssignedPersonScreen.js
@@ -8,19 +8,20 @@ import {
CONTACT_PERSON_TABS,
IS_USER_CREATED_MEMBER_PERSON_TABS,
IS_GROUPS_MEMBER_PERSON_TABS,
-} from '../../../../src/containers/Groups/AssignedPersonScreen';
-import { renderShallow, testSnapshotShallow } from '../../../../testUtils';
-import { PERSON_MENU_DRAWER } from '../../../../src/constants';
-import { contactAssignmentSelector } from '../../../../src/selectors/people';
-import { organizationSelector } from '../../../../src/selectors/organizations';
-import * as common from '../../../../src/utils/common';
-
-jest.mock('../../../../src/selectors/people');
-jest.mock('../../../../src/selectors/organizations');
-jest.mock('../../../../src/actions/navigation', () => ({
+} from '..';
+
+import { renderShallow, testSnapshotShallow } from '../../../../../testUtils';
+import { PERSON_MENU_DRAWER } from '../../../../constants';
+import { contactAssignmentSelector } from '../../../../selectors/people';
+import { organizationSelector } from '../../../../selectors/organizations';
+import * as common from '../../../../utils/common';
+
+jest.mock('../../../../selectors/people');
+jest.mock('../../../../selectors/organizations');
+jest.mock('../../../../actions/navigation', () => ({
navigateBack: jest.fn(() => ({ type: 'test' })),
}));
-jest.mock('../../../../src/utils/common');
+jest.mock('../../../../utils/common');
const organization = { id: '1', name: 'Test Org' };
const person = { id: '1', first_name: 'Test Person' };
@@ -84,7 +85,7 @@ beforeEach(() => {
describe('Contact', () => {
it('should provide necessary props', () => {
organizationSelector.mockReturnValue(undefined);
- common.communityIsCru.mockReturnValue(true);
+ common.orgIsCru.mockReturnValue(true);
expect(mapStateToProps(store, nav)).toEqual({
organization,
@@ -95,7 +96,7 @@ describe('Contact', () => {
myStageId: pathwayStage.id,
isCruOrg: true,
});
- expect(common.communityIsCru).toHaveBeenCalledWith(organization);
+ expect(common.orgIsCru).toHaveBeenCalledWith(organization);
});
it('should render AssignedPersonScreen correctly without stage', () => {
diff --git a/__tests__/containers/Groups/PersonScreen/__snapshots__/AssignedPersonScreen.js.snap b/src/containers/Groups/AssignedPersonScreen/__tests__/__snapshots__/AssignedPersonScreen.js.snap
similarity index 100%
rename from __tests__/containers/Groups/PersonScreen/__snapshots__/AssignedPersonScreen.js.snap
rename to src/containers/Groups/AssignedPersonScreen/__tests__/__snapshots__/AssignedPersonScreen.js.snap
diff --git a/src/containers/Groups/AssignedPersonScreen/index.js b/src/containers/Groups/AssignedPersonScreen/index.js
index 2b80f6088a..0c126410d5 100644
--- a/src/containers/Groups/AssignedPersonScreen/index.js
+++ b/src/containers/Groups/AssignedPersonScreen/index.js
@@ -28,7 +28,7 @@ import {
keyboardShow,
keyboardHide,
buildTrackingObj,
- communityIsCru,
+ orgIsCru,
} from '../../../utils/common';
import styles from './styles';
@@ -297,7 +297,7 @@ export const mapStateToProps = (
stages: stages.stages,
myId: authPerson.id,
myStageId: authPerson.user.pathway_stage_id,
- isCruOrg: communityIsCru(navParams.organization),
+ isCruOrg: orgIsCru(navParams.organization),
};
};
diff --git a/__tests__/containers/Groups/ContactsFilter.js b/src/containers/Groups/ContactsFilter/__tests__/ContactsFilter.js
similarity index 84%
rename from __tests__/containers/Groups/ContactsFilter.js
rename to src/containers/Groups/ContactsFilter/__tests__/ContactsFilter.js
index a0c2726b89..58cd71b00d 100644
--- a/__tests__/containers/Groups/ContactsFilter.js
+++ b/src/containers/Groups/ContactsFilter/__tests__/ContactsFilter.js
@@ -1,19 +1,20 @@
import React from 'react';
-import ContactsFilter from '../../../src/containers/Groups/ContactsFilter';
+import ContactsFilter from '..';
+
import {
createMockStore,
renderShallow,
testSnapshotShallow,
createMockNavState,
-} from '../../../testUtils';
-import { navigatePush } from '../../../src/actions/navigation';
-import * as filterUtils from '../../../src/utils/filters';
+} from '../../../../../testUtils';
+import { navigatePush } from '../../../../actions/navigation';
+import * as filterUtils from '../../../../utils/filters';
-jest.mock('../../../src/actions/navigation', () => ({
+jest.mock('../../../../actions/navigation', () => ({
navigatePush: jest.fn(() => ({ type: 'test' })),
}));
-jest.mock('../../../src/actions/labels', () => ({
+jest.mock('../../../../actions/labels', () => ({
getOrgLabels: jest.fn(() => ({
type: 'orgLabels',
response: [{ id: '3' }, { id: '4' }],
diff --git a/__tests__/containers/Groups/__snapshots__/ContactsFilter.js.snap b/src/containers/Groups/ContactsFilter/__tests__/__snapshots__/ContactsFilter.js.snap
similarity index 100%
rename from __tests__/containers/Groups/__snapshots__/ContactsFilter.js.snap
rename to src/containers/Groups/ContactsFilter/__tests__/__snapshots__/ContactsFilter.js.snap
diff --git a/__tests__/containers/Groups/SurveyContactsFilter.js b/src/containers/Groups/SurveyContactsFilter/__tests__/SurveyContactsFilter.js
similarity index 83%
rename from __tests__/containers/Groups/SurveyContactsFilter.js
rename to src/containers/Groups/SurveyContactsFilter/__tests__/SurveyContactsFilter.js
index 828ccbdfc7..521bd58e7f 100644
--- a/__tests__/containers/Groups/SurveyContactsFilter.js
+++ b/src/containers/Groups/SurveyContactsFilter/__tests__/SurveyContactsFilter.js
@@ -1,25 +1,26 @@
import React from 'react';
-import SurveyContactsFilter from '../../../src/containers/Groups/SurveyContactsFilter';
+import SurveyContactsFilter from '..';
+
import {
createMockStore,
renderShallow,
testSnapshotShallow,
createMockNavState,
-} from '../../../testUtils';
-import { navigatePush } from '../../../src/actions/navigation';
-import * as filterUtils from '../../../src/utils/filters';
+} from '../../../../../testUtils';
+import { navigatePush } from '../../../../actions/navigation';
+import * as filterUtils from '../../../../utils/filters';
-jest.mock('../../../src/actions/navigation', () => ({
+jest.mock('../../../../actions/navigation', () => ({
navigatePush: jest.fn(() => ({ type: 'test' })),
}));
-jest.mock('../../../src/actions/surveys', () => ({
+jest.mock('../../../../actions/surveys', () => ({
getSurveyQuestions: jest.fn(() => ({
type: 'surveyQuestions',
response: [{ id: '1' }, { id: '2' }],
})),
}));
-jest.mock('../../../src/actions/labels', () => ({
+jest.mock('../../../../actions/labels', () => ({
getOrgLabels: jest.fn(() => ({
type: 'orgLabels',
response: [{ id: '3' }, { id: '4' }],
diff --git a/__tests__/containers/Groups/__snapshots__/SurveyContactsFilter.js.snap b/src/containers/Groups/SurveyContactsFilter/__tests__/__snapshots__/SurveyContactsFilter.js.snap
similarity index 100%
rename from __tests__/containers/Groups/__snapshots__/SurveyContactsFilter.js.snap
rename to src/containers/Groups/SurveyContactsFilter/__tests__/__snapshots__/SurveyContactsFilter.js.snap
diff --git a/__tests__/containers/Groups/SurveyQuestionsFilterScreen.js b/src/containers/Groups/SurveyQuestionsFilter/__tests__/SurveyQuestionsFilter.js
similarity index 82%
rename from __tests__/containers/Groups/SurveyQuestionsFilterScreen.js
rename to src/containers/Groups/SurveyQuestionsFilter/__tests__/SurveyQuestionsFilter.js
index d336a09bb2..a557d38df4 100644
--- a/__tests__/containers/Groups/SurveyQuestionsFilterScreen.js
+++ b/src/containers/Groups/SurveyQuestionsFilter/__tests__/SurveyQuestionsFilter.js
@@ -1,23 +1,23 @@
import React from 'react';
-import { navigatePush } from '../../../src/actions/navigation';
-import { trackSearchFilter } from '../../../src/actions/analytics';
-import { buildTrackingObj } from '../../../src/utils/common';
-import SurveyQuestionsFilter from '../../../src/containers/Groups/SurveyQuestionsFilter';
-import { SEARCH_REFINE_SCREEN } from '../../../src/containers/SearchPeopleFilterRefineScreen';
+import { navigatePush } from '../../../../actions/navigation';
+import { trackSearchFilter } from '../../../../actions/analytics';
+import { buildTrackingObj } from '../../../../utils/common';
+import SurveyQuestionsFilter from '../../SurveyQuestionsFilter';
+import { SEARCH_REFINE_SCREEN } from '../../../SearchPeopleFilterRefineScreen';
import {
testSnapshotShallow,
renderShallow,
createMockNavState,
-} from '../../../testUtils';
+} from '../../../../../testUtils';
-jest.mock('../../../src/actions/navigation', () => ({
+jest.mock('../../../../actions/navigation', () => ({
navigatePush: jest.fn().mockReturnValue({ type: 'navigate success' }),
}));
-jest.mock('../../../src/actions/analytics', () => ({
+jest.mock('../../../../actions/analytics', () => ({
trackSearchFilter: jest.fn().mockReturnValue({ type: 'track success' }),
}));
-jest.mock('../../../src/utils/common');
+jest.mock('../../../../utils/common');
const options = [
{
diff --git a/__tests__/containers/Groups/__snapshots__/SurveyQuestionsFilterScreen.js.snap b/src/containers/Groups/SurveyQuestionsFilter/__tests__/__snapshots__/SurveyQuestionsFilter.js.snap
similarity index 100%
rename from __tests__/containers/Groups/__snapshots__/SurveyQuestionsFilterScreen.js.snap
rename to src/containers/Groups/SurveyQuestionsFilter/__tests__/__snapshots__/SurveyQuestionsFilter.js.snap
diff --git a/__tests__/containers/Groups/PersonScreen/UnassignedPersonScreen.js b/src/containers/Groups/UnassignedPersonScreen/__tests__/UnassignedPersonScreen.js
similarity index 80%
rename from __tests__/containers/Groups/PersonScreen/UnassignedPersonScreen.js
rename to src/containers/Groups/UnassignedPersonScreen/__tests__/UnassignedPersonScreen.js
index 9a269eb140..8e43716630 100644
--- a/__tests__/containers/Groups/PersonScreen/UnassignedPersonScreen.js
+++ b/src/containers/Groups/UnassignedPersonScreen/__tests__/UnassignedPersonScreen.js
@@ -1,20 +1,21 @@
import React from 'react';
import MockDate from 'mockdate';
-import UnassignedPersonScreen from '../../../../src/containers/Groups/UnassignedPersonScreen';
-import { INTERACTION_TYPES } from '../../../../src/constants';
+import UnassignedPersonScreen from '..';
+
+import { INTERACTION_TYPES } from '../../../../constants';
import {
renderShallow,
createMockStore,
testSnapshotShallow,
createMockNavState,
-} from '../../../../testUtils';
-import { getGroupJourney } from '../../../../src/actions/journey';
+} from '../../../../../testUtils';
+import { getGroupJourney } from '../../../../actions/journey';
-jest.mock('../../../../src/actions/journey', () => ({
+jest.mock('../../../../actions/journey', () => ({
getGroupJourney: jest.fn(() => [{ id: '1' }]),
}));
-jest.mock('../../../../src/actions/person', () => ({
+jest.mock('../../../../actions/person', () => ({
createContactAssignment: jest.fn(() => Promise.resolve()),
}));
diff --git a/__tests__/containers/Groups/PersonScreen/__snapshots__/UnassignedPersonScreen.js.snap b/src/containers/Groups/UnassignedPersonScreen/__tests__/__snapshots__/UnassignedPersonScreen.js.snap
similarity index 100%
rename from __tests__/containers/Groups/PersonScreen/__snapshots__/UnassignedPersonScreen.js.snap
rename to src/containers/Groups/UnassignedPersonScreen/__tests__/__snapshots__/UnassignedPersonScreen.js.snap
diff --git a/__tests__/containers/Groups/Contacts.js b/src/containers/Groups/__tests__/Contacts.js
similarity index 89%
rename from __tests__/containers/Groups/Contacts.js
rename to src/containers/Groups/__tests__/Contacts.js
index a75dc20968..7fbe615cdd 100644
--- a/__tests__/containers/Groups/Contacts.js
+++ b/src/containers/Groups/__tests__/Contacts.js
@@ -1,22 +1,22 @@
import React from 'react';
-import Contacts from '../../../src/containers/Groups/Contacts';
+import Contacts from '../Contacts';
import {
createMockStore,
renderShallow,
testSnapshotShallow,
-} from '../../../testUtils';
-import { navigatePush } from '../../../src/actions/navigation';
-import { navToPersonScreen } from '../../../src/actions/person';
+} from '../../../../testUtils';
+import { navigatePush } from '../../../actions/navigation';
+import { navToPersonScreen } from '../../../actions/person';
-jest.mock('../../../src/actions/navigation', () => ({
+jest.mock('../../../actions/navigation', () => ({
navigatePush: jest.fn(() => ({ type: 'test' })),
}));
-jest.mock('../../../src/actions/person', () => ({
+jest.mock('../../../actions/person', () => ({
navToPersonScreen: jest.fn(() => ({ type: 'test' })),
}));
-jest.mock('../../../src/actions/organizations', () => ({
+jest.mock('../../../actions/organizations', () => ({
getOrganizationContacts: jest.fn(() => ({
response: [{ id: '1' }, { id: '2' }],
meta: { total: 42 },
diff --git a/__tests__/containers/Groups/GroupCelebrate.js b/src/containers/Groups/__tests__/GroupCelebrate.js
similarity index 80%
rename from __tests__/containers/Groups/GroupCelebrate.js
rename to src/containers/Groups/__tests__/GroupCelebrate.js
index f38bbbf264..501bd4ddc7 100644
--- a/__tests__/containers/Groups/GroupCelebrate.js
+++ b/src/containers/Groups/__tests__/GroupCelebrate.js
@@ -1,22 +1,20 @@
import React from 'react';
import MockDate from 'mockdate';
-import GroupCelebrate, {
- mapStateToProps,
-} from '../../../src/containers/Groups/GroupCelebrate';
+import GroupCelebrate, { mapStateToProps } from '../GroupCelebrate';
import {
renderShallow,
testSnapshotShallow,
createMockStore,
-} from '../../../testUtils';
-import { organizationSelector } from '../../../src/selectors/organizations';
-import { celebrationSelector } from '../../../src/selectors/celebration';
-import { reloadGroupCelebrateFeed } from '../../../src/actions/celebration';
-import * as common from '../../../src/utils/common';
-
-jest.mock('../../../src/selectors/organizations');
-jest.mock('../../../src/selectors/celebration');
-jest.mock('../../../src/actions/celebration');
+} from '../../../../testUtils';
+import { organizationSelector } from '../../../selectors/organizations';
+import { celebrationSelector } from '../../../selectors/celebration';
+import { reloadGroupCelebrateFeed } from '../../../actions/celebration';
+import * as common from '../../../utils/common';
+
+jest.mock('../../../selectors/organizations');
+jest.mock('../../../selectors/celebration');
+jest.mock('../../../actions/celebration');
MockDate.set('2017-06-18');
const celebrate1 = {
diff --git a/__tests__/containers/Groups/GroupChallenges.js b/src/containers/Groups/__tests__/GroupChallenges.js
similarity index 80%
rename from __tests__/containers/Groups/GroupChallenges.js
rename to src/containers/Groups/__tests__/GroupChallenges.js
index 168b5324c0..411c05001c 100644
--- a/__tests__/containers/Groups/GroupChallenges.js
+++ b/src/containers/Groups/__tests__/GroupChallenges.js
@@ -1,26 +1,24 @@
import React from 'react';
-import GroupChallenges, {
- mapStateToProps,
-} from '../../../src/containers/Groups/GroupChallenges';
+import GroupChallenges, { mapStateToProps } from '../GroupChallenges';
import {
renderShallow,
testSnapshotShallow,
createMockStore,
-} from '../../../testUtils';
-import { organizationSelector } from '../../../src/selectors/organizations';
-import { challengesSelector } from '../../../src/selectors/challenges';
-import * as challenges from '../../../src/actions/challenges';
-import * as common from '../../../src/utils/common';
-import * as navigation from '../../../src/actions/navigation';
-import { ADD_CHALLENGE_SCREEN } from '../../../src/containers/AddChallengeScreen';
-import { orgPermissionSelector } from '../../../src/selectors/people';
-import { ORG_PERMISSIONS } from '../../../src/constants';
-
-jest.mock('../../../src/selectors/people');
-jest.mock('../../../src/selectors/organizations');
-jest.mock('../../../src/selectors/challenges');
-jest.mock('../../../src/actions/challenges');
+} from '../../../../testUtils';
+import { organizationSelector } from '../../../selectors/organizations';
+import { challengesSelector } from '../../../selectors/challenges';
+import * as challenges from '../../../actions/challenges';
+import * as common from '../../../utils/common';
+import * as navigation from '../../../actions/navigation';
+import { ADD_CHALLENGE_SCREEN } from '../../AddChallengeScreen';
+import { orgPermissionSelector } from '../../../selectors/people';
+import { ORG_PERMISSIONS } from '../../../constants';
+
+jest.mock('../../../selectors/people');
+jest.mock('../../../selectors/organizations');
+jest.mock('../../../selectors/challenges');
+jest.mock('../../../actions/challenges');
const orgPermission = { permission_id: ORG_PERMISSIONS.ADMIN };
orgPermissionSelector.mockReturnValue(orgPermission);
diff --git a/__tests__/containers/Groups/GroupScreen.js b/src/containers/Groups/__tests__/GroupScreen.js
similarity index 80%
rename from __tests__/containers/Groups/GroupScreen.js
rename to src/containers/Groups/__tests__/GroupScreen.js
index 518a6ac9f5..b4eb30a5fd 100644
--- a/__tests__/containers/Groups/GroupScreen.js
+++ b/src/containers/Groups/__tests__/GroupScreen.js
@@ -1,20 +1,16 @@
import React from 'react';
-import {
- GroupScreen,
- CRU_TABS,
- USER_CREATED_TABS,
-} from '../../../src/containers/Groups/GroupScreen';
+import { GroupScreen, CRU_TABS, USER_CREATED_TABS } from '../GroupScreen';
import {
testSnapshotShallow,
createMockNavState,
createMockStore,
renderShallow,
-} from '../../../testUtils';
-import { ADD_CONTACT_SCREEN } from '../../../src/containers/AddContactScreen';
-import { navigatePush } from '../../../src/actions/navigation';
+} from '../../../../testUtils';
+import { ADD_CONTACT_SCREEN } from '../../AddContactScreen';
+import { navigatePush } from '../../../actions/navigation';
-jest.mock('../../../src/actions/navigation', () => ({
+jest.mock('../../../actions/navigation', () => ({
navigateBack: jest.fn(() => ({ type: 'test' })),
navigatePush: jest.fn(),
}));
diff --git a/__tests__/containers/Groups/GroupsListScreen.js b/src/containers/Groups/__tests__/GroupsListScreen.js
similarity index 82%
rename from __tests__/containers/Groups/GroupsListScreen.js
rename to src/containers/Groups/__tests__/GroupsListScreen.js
index b77885d809..0f7344e553 100644
--- a/__tests__/containers/Groups/GroupsListScreen.js
+++ b/src/containers/Groups/__tests__/GroupsListScreen.js
@@ -1,22 +1,19 @@
import React from 'react';
import configureStore from 'redux-mock-store';
-import GroupsListScreen from '../../../src/containers/Groups/GroupsListScreen';
-import { renderShallow } from '../../../testUtils';
-import { navigatePush } from '../../../src/actions/navigation';
-import { getMyCommunities } from '../../../src/actions/organizations';
-import { communitiesSelector } from '../../../src/selectors/organizations';
-import * as common from '../../../src/utils/common';
-import {
- GROUP_SCREEN,
- USER_CREATED_GROUP_SCREEN,
-} from '../../../src/containers/Groups/GroupScreen';
-
-jest.mock('../../../src/selectors/organizations');
-jest.mock('../../../src/actions/navigation', () => ({
+import GroupsListScreen from '../GroupsListScreen';
+import { renderShallow } from '../../../../testUtils';
+import { navigatePush } from '../../../actions/navigation';
+import { getMyCommunities } from '../../../actions/organizations';
+import { communitiesSelector } from '../../../selectors/organizations';
+import * as common from '../../../utils/common';
+import { GROUP_SCREEN, USER_CREATED_GROUP_SCREEN } from '../GroupScreen';
+
+jest.mock('../../../selectors/organizations');
+jest.mock('../../../actions/navigation', () => ({
navigatePush: jest.fn(() => ({ type: 'test' })),
}));
-jest.mock('../../../src/actions/organizations', () => ({
+jest.mock('../../../actions/organizations', () => ({
getMyCommunities: jest.fn(() => ({ type: 'test' })),
}));
diff --git a/__tests__/containers/Groups/Members.js b/src/containers/Groups/__tests__/Members.js
similarity index 90%
rename from __tests__/containers/Groups/Members.js
rename to src/containers/Groups/__tests__/Members.js
index d73d2f9393..c394d74cf0 100644
--- a/__tests__/containers/Groups/Members.js
+++ b/src/containers/Groups/__tests__/Members.js
@@ -1,26 +1,26 @@
import React from 'react';
-import Members from '../../../src/containers/Groups/Members';
+import Members from '../Members';
import {
renderShallow,
createMockStore,
testSnapshotShallow,
-} from '../../../testUtils';
-import { navToPersonScreen } from '../../../src/actions/person';
-import * as common from '../../../src/utils/common';
+} from '../../../../testUtils';
+import { navToPersonScreen } from '../../../actions/person';
+import * as common from '../../../utils/common';
import {
getOrganizationMembers,
getOrganizationMembersNextPage,
-} from '../../../src/actions/organizations';
-import * as navigation from '../../../src/actions/navigation';
-import { ADD_CONTACT_SCREEN } from '../../../src/containers/AddContactScreen';
-import { ORG_PERMISSIONS } from '../../../src/constants';
+} from '../../../actions/organizations';
+import * as navigation from '../../../actions/navigation';
+import { ADD_CONTACT_SCREEN } from '../../AddContactScreen';
+import { ORG_PERMISSIONS } from '../../../constants';
-jest.mock('../../../src/actions/organizations', () => ({
+jest.mock('../../../actions/organizations', () => ({
getOrganizationMembers: jest.fn(() => ({ type: 'test' })),
getOrganizationMembersNextPage: jest.fn(() => ({ type: 'test' })),
}));
-jest.mock('../../../src/actions/person', () => ({
+jest.mock('../../../actions/person', () => ({
navToPersonScreen: jest.fn(() => ({ type: 'test' })),
}));
common.refresh = jest.fn();
diff --git a/__tests__/containers/Groups/OnboardingCard.js b/src/containers/Groups/__tests__/OnboardingCard.js
similarity index 94%
rename from __tests__/containers/Groups/OnboardingCard.js
rename to src/containers/Groups/__tests__/OnboardingCard.js
index 9383e49ee4..609287291f 100644
--- a/__tests__/containers/Groups/OnboardingCard.js
+++ b/src/containers/Groups/__tests__/OnboardingCard.js
@@ -4,13 +4,11 @@ import {
createMockStore,
testSnapshotShallow,
renderShallow,
-} from '../../../testUtils';
-import OnboardingCard, {
- GROUP_ONBOARDING_TYPES,
-} from '../../../src/containers/Groups/OnboardingCard';
-import { removeGroupOnboardingCard } from '../../../src/actions/swipe';
+} from '../../../../testUtils';
+import OnboardingCard, { GROUP_ONBOARDING_TYPES } from '../OnboardingCard';
+import { removeGroupOnboardingCard } from '../../../actions/swipe';
-jest.mock('../../../src/actions/swipe');
+jest.mock('../../../actions/swipe');
const groupOnboarding = {
[GROUP_ONBOARDING_TYPES.celebrate]: true,
diff --git a/__tests__/containers/Groups/SurveyContacts.js b/src/containers/Groups/__tests__/SurveyContacts.js
similarity index 86%
rename from __tests__/containers/Groups/SurveyContacts.js
rename to src/containers/Groups/__tests__/SurveyContacts.js
index 928923b5b8..be2989af5c 100644
--- a/__tests__/containers/Groups/SurveyContacts.js
+++ b/src/containers/Groups/__tests__/SurveyContacts.js
@@ -1,24 +1,24 @@
import React from 'react';
-import SurveyContacts from '../../../src/containers/Groups/SurveyContacts';
+import SurveyContacts from '../SurveyContacts';
import {
createMockStore,
renderShallow,
testSnapshotShallow,
createMockNavState,
-} from '../../../testUtils';
-import { navigatePush } from '../../../src/actions/navigation';
-import { navToPersonScreen } from '../../../src/actions/person';
-import * as organizations from '../../../src/actions/organizations';
-import { SEARCH_SURVEY_CONTACTS_FILTER_SCREEN } from '../../../src/containers/Groups/SurveyContactsFilter';
+} from '../../../../testUtils';
+import { navigatePush } from '../../../actions/navigation';
+import { navToPersonScreen } from '../../../actions/person';
+import * as organizations from '../../../actions/organizations';
+import { SEARCH_SURVEY_CONTACTS_FILTER_SCREEN } from '../SurveyContactsFilter';
-jest.mock('../../../src/actions/navigation', () => ({
+jest.mock('../../../actions/navigation', () => ({
navigatePush: jest.fn(() => ({ type: 'test' })),
}));
-jest.mock('../../../src/actions/person', () => ({
+jest.mock('../../../actions/person', () => ({
navToPersonScreen: jest.fn(() => ({ type: 'test' })),
}));
-jest.mock('../../../src/actions/organizations');
+jest.mock('../../../actions/organizations');
const store = createMockStore({});
const organization = { id: '1', name: 'Test Org' };
diff --git a/__tests__/containers/Groups/Surveys.js b/src/containers/Groups/__tests__/Surveys.js
similarity index 87%
rename from __tests__/containers/Groups/Surveys.js
rename to src/containers/Groups/__tests__/Surveys.js
index 7cdbef8a76..223861bf01 100644
--- a/__tests__/containers/Groups/Surveys.js
+++ b/src/containers/Groups/__tests__/Surveys.js
@@ -1,22 +1,19 @@
import React from 'react';
-import Surveys from '../../../src/containers/Groups/Surveys';
+import Surveys from '../Surveys';
import {
renderShallow,
createMockStore,
testSnapshotShallow,
-} from '../../../testUtils';
-import { navigatePush } from '../../../src/actions/navigation';
-import {
- getOrgSurveys,
- getOrgSurveysNextPage,
-} from '../../../src/actions/surveys';
-import * as common from '../../../src/utils/common';
+} from '../../../../testUtils';
+import { navigatePush } from '../../../actions/navigation';
+import { getOrgSurveys, getOrgSurveysNextPage } from '../../../actions/surveys';
+import * as common from '../../../utils/common';
-jest.mock('../../../src/actions/navigation', () => ({
+jest.mock('../../../actions/navigation', () => ({
navigatePush: jest.fn(() => ({ type: 'test' })),
}));
-jest.mock('../../../src/actions/surveys', () => ({
+jest.mock('../../../actions/surveys', () => ({
getOrgSurveys: jest.fn(() => ({ type: 'test' })),
getOrgSurveysNextPage: jest.fn(() => ({ type: 'test' })),
}));
diff --git a/__tests__/containers/Groups/__snapshots__/Contacts.js.snap b/src/containers/Groups/__tests__/__snapshots__/Contacts.js.snap
similarity index 100%
rename from __tests__/containers/Groups/__snapshots__/Contacts.js.snap
rename to src/containers/Groups/__tests__/__snapshots__/Contacts.js.snap
diff --git a/__tests__/containers/Groups/__snapshots__/GroupCelebrate.js.snap b/src/containers/Groups/__tests__/__snapshots__/GroupCelebrate.js.snap
similarity index 100%
rename from __tests__/containers/Groups/__snapshots__/GroupCelebrate.js.snap
rename to src/containers/Groups/__tests__/__snapshots__/GroupCelebrate.js.snap
diff --git a/__tests__/containers/Groups/__snapshots__/GroupChallenges.js.snap b/src/containers/Groups/__tests__/__snapshots__/GroupChallenges.js.snap
similarity index 100%
rename from __tests__/containers/Groups/__snapshots__/GroupChallenges.js.snap
rename to src/containers/Groups/__tests__/__snapshots__/GroupChallenges.js.snap
diff --git a/__tests__/containers/Groups/__snapshots__/GroupScreen.js.snap b/src/containers/Groups/__tests__/__snapshots__/GroupScreen.js.snap
similarity index 100%
rename from __tests__/containers/Groups/__snapshots__/GroupScreen.js.snap
rename to src/containers/Groups/__tests__/__snapshots__/GroupScreen.js.snap
diff --git a/__tests__/containers/Groups/__snapshots__/GroupsListScreen.js.snap b/src/containers/Groups/__tests__/__snapshots__/GroupsListScreen.js.snap
similarity index 100%
rename from __tests__/containers/Groups/__snapshots__/GroupsListScreen.js.snap
rename to src/containers/Groups/__tests__/__snapshots__/GroupsListScreen.js.snap
diff --git a/__tests__/containers/Groups/__snapshots__/Members.js.snap b/src/containers/Groups/__tests__/__snapshots__/Members.js.snap
similarity index 100%
rename from __tests__/containers/Groups/__snapshots__/Members.js.snap
rename to src/containers/Groups/__tests__/__snapshots__/Members.js.snap
diff --git a/__tests__/containers/Groups/__snapshots__/OnboardingCard.js.snap b/src/containers/Groups/__tests__/__snapshots__/OnboardingCard.js.snap
similarity index 100%
rename from __tests__/containers/Groups/__snapshots__/OnboardingCard.js.snap
rename to src/containers/Groups/__tests__/__snapshots__/OnboardingCard.js.snap
diff --git a/__tests__/containers/Groups/__snapshots__/SurveyContacts.js.snap b/src/containers/Groups/__tests__/__snapshots__/SurveyContacts.js.snap
similarity index 100%
rename from __tests__/containers/Groups/__snapshots__/SurveyContacts.js.snap
rename to src/containers/Groups/__tests__/__snapshots__/SurveyContacts.js.snap
diff --git a/__tests__/containers/Groups/__snapshots__/Surveys.js.snap b/src/containers/Groups/__tests__/__snapshots__/Surveys.js.snap
similarity index 100%
rename from __tests__/containers/Groups/__snapshots__/Surveys.js.snap
rename to src/containers/Groups/__tests__/__snapshots__/Surveys.js.snap
diff --git a/__tests__/containers/IconMessageScreen.js b/src/containers/IconMessageScreen/__tests__/IconMessageScreen.js
similarity index 72%
rename from __tests__/containers/IconMessageScreen.js
rename to src/containers/IconMessageScreen/__tests__/IconMessageScreen.js
index 757d96529a..e341dba3df 100644
--- a/__tests__/containers/IconMessageScreen.js
+++ b/src/containers/IconMessageScreen/__tests__/IconMessageScreen.js
@@ -2,9 +2,10 @@ import 'react-native';
import React from 'react';
import { Provider } from 'react-redux';
-import IconMessageScreen from '../../src/containers/IconMessageScreen/index';
-import { createMockStore } from '../../testUtils/index';
-import { testSnapshot } from '../../testUtils';
+import IconMessageScreen from '..';
+
+import { createMockStore } from '../../../../testUtils';
+import { testSnapshot } from '../../../../testUtils';
const store = createMockStore();
@@ -34,5 +35,7 @@ it('renders button text correctly', () => {
});
it('renders icon correctly', () => {
- renderAndTest({ iconPath: require('../../assets/images/footprints.png') });
+ renderAndTest({
+ iconPath: require('../../../../assets/images/footprints.png'),
+ });
});
diff --git a/__tests__/containers/__snapshots__/IconMessageScreen.js.snap b/src/containers/IconMessageScreen/__tests__/__snapshots__/IconMessageScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/IconMessageScreen.js.snap
rename to src/containers/IconMessageScreen/__tests__/__snapshots__/IconMessageScreen.js.snap
diff --git a/__tests__/containers/ImpactScreen.js b/src/containers/ImpactScreen/__tests__/ImpactScreen.js
similarity index 80%
rename from __tests__/containers/ImpactScreen.js
rename to src/containers/ImpactScreen/__tests__/ImpactScreen.js
index fb7f9b9b1d..7bab60f2c4 100644
--- a/__tests__/containers/ImpactScreen.js
+++ b/src/containers/ImpactScreen/__tests__/ImpactScreen.js
@@ -2,10 +2,12 @@ import 'react-native';
import React from 'react';
import MockDate from 'mockdate';
-import { createMockStore, renderShallow } from '../../testUtils/index';
-import ImpactScreen from '../../src/containers/ImpactScreen';
-import { testSnapshotShallow } from '../../testUtils';
-import * as common from '../../src/utils/common';
+import { createMockStore, renderShallow } from '../../../../testUtils';
+
+import ImpactScreen from '..';
+
+import { testSnapshotShallow } from '../../../../testUtils';
+import * as common from '../../../utils/common';
const store = createMockStore({
impact: {
diff --git a/__tests__/containers/__snapshots__/ImpactScreen.js.snap b/src/containers/ImpactScreen/__tests__/__snapshots__/ImpactScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/ImpactScreen.js.snap
rename to src/containers/ImpactScreen/__tests__/__snapshots__/ImpactScreen.js.snap
diff --git a/__tests__/containers/ImpactView.js b/src/containers/ImpactView/__tests__/ImpactView.js
similarity index 99%
rename from __tests__/containers/ImpactView.js
rename to src/containers/ImpactView/__tests__/ImpactView.js
index a245bcdf10..664df07e35 100644
--- a/__tests__/containers/ImpactView.js
+++ b/src/containers/ImpactView/__tests__/ImpactView.js
@@ -1,8 +1,9 @@
import 'react-native';
import React from 'react';
-import { testSnapshotShallow } from '../../testUtils';
-import { ImpactView, mapStateToProps } from '../../src/containers/ImpactView';
+import { testSnapshotShallow } from '../../../../testUtils';
+
+import { ImpactView, mapStateToProps } from '..';
const dispatch = jest.fn(response => Promise.resolve(response));
diff --git a/__tests__/containers/__snapshots__/ImpactView.js.snap b/src/containers/ImpactView/__tests__/__snapshots__/ImpactView.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/ImpactView.js.snap
rename to src/containers/ImpactView/__tests__/__snapshots__/ImpactView.js.snap
diff --git a/__tests__/containers/KeyLoginScreen.js b/src/containers/KeyLoginScreen/__tests__/KeyLoginScreen.js
similarity index 90%
rename from __tests__/containers/KeyLoginScreen.js
rename to src/containers/KeyLoginScreen/__tests__/KeyLoginScreen.js
index 954045620f..3a022e3ae7 100644
--- a/__tests__/containers/KeyLoginScreen.js
+++ b/src/containers/KeyLoginScreen/__tests__/KeyLoginScreen.js
@@ -2,30 +2,31 @@ import 'react-native';
import React from 'react';
import { Provider } from 'react-redux';
-import KeyLoginScreen from '../../src/containers/KeyLoginScreen';
+import KeyLoginScreen from '..';
+
import {
createMockNavState,
createMockStore,
renderShallow,
testSnapshot,
-} from '../../testUtils';
-import * as auth from '../../src/actions/auth';
-import { trackActionWithoutData } from '../../src/actions/analytics';
-import { ACTIONS, MFA_REQUIRED } from '../../src/constants';
-import { facebookLoginWithUsernamePassword } from '../../src/actions/facebook';
-import { navigatePush } from '../../src/actions/navigation';
-import { MFA_CODE_SCREEN } from '../../src/containers/MFACodeScreen';
+} from '../../../../testUtils';
+import * as auth from '../../../actions/auth';
+import { trackActionWithoutData } from '../../../actions/analytics';
+import { ACTIONS, MFA_REQUIRED } from '../../../constants';
+import { facebookLoginWithUsernamePassword } from '../../../actions/facebook';
+import { navigatePush } from '../../../actions/navigation';
+import { MFA_CODE_SCREEN } from '../../MFACodeScreen';
let store;
jest.mock('react-native-device-info');
-jest.mock('../../src/actions/auth', () => ({
+jest.mock('../../../actions/auth', () => ({
keyLogin: jest.fn().mockReturnValue({ type: 'test' }),
openKeyURL: jest.fn(),
}));
-jest.mock('../../src/actions/facebook');
+jest.mock('../../../actions/facebook');
facebookLoginWithUsernamePassword.mockReturnValue({ type: 'test' });
-jest.mock('../../src/actions/navigation');
+jest.mock('../../../actions/navigation');
jest.mock('react-native-fbsdk', () => ({
LoginManager: {
logInWithReadPermissions: jest
@@ -40,7 +41,7 @@ jest.mock('react-native-fbsdk', () => ({
GraphRequest: jest.fn((param1, param2, cb) => cb(undefined, {})),
GraphRequestManager: () => ({ addRequest: () => ({ start: jest.fn() }) }),
}));
-jest.mock('../../src/actions/analytics', () => ({
+jest.mock('../../../actions/analytics', () => ({
trackActionWithoutData: jest.fn(),
}));
diff --git a/__tests__/containers/__snapshots__/KeyLoginScreen.js.snap b/src/containers/KeyLoginScreen/__tests__/__snapshots__/KeyLoginScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/KeyLoginScreen.js.snap
rename to src/containers/KeyLoginScreen/__tests__/__snapshots__/KeyLoginScreen.js.snap
diff --git a/__tests__/containers/LoginOptionsScreen.js b/src/containers/LoginOptionsScreen/__tests__/LoginOptionsScreen.js
similarity index 93%
rename from __tests__/containers/LoginOptionsScreen.js
rename to src/containers/LoginOptionsScreen/__tests__/LoginOptionsScreen.js
index 790b55aa3f..33a3c3c67e 100644
--- a/__tests__/containers/LoginOptionsScreen.js
+++ b/src/containers/LoginOptionsScreen/__tests__/LoginOptionsScreen.js
@@ -3,24 +3,25 @@ import React from 'react';
import { Linking } from 'react-native';
import { Provider } from 'react-redux';
-import LoginOptionsScreen from '../../src/containers/LoginOptionsScreen';
+import LoginOptionsScreen from '..';
+
import {
createMockStore,
testSnapshot,
createMockNavState,
renderShallow,
-} from '../../testUtils';
-import * as auth from '../../src/actions/auth';
+} from '../../../../testUtils';
+import * as auth from '../../../actions/auth';
let store;
-jest.mock('../../src/actions/auth', () => ({
+jest.mock('../../../actions/auth', () => ({
facebookLoginAction: jest.fn().mockReturnValue({ type: 'test' }),
keyLogin: jest.fn().mockReturnValue({ type: 'test' }),
firstTime: jest.fn(),
openKeyURL: jest.fn(),
}));
-jest.mock('../../src/actions/navigation');
+jest.mock('../../../actions/navigation');
jest.mock('react-native-fbsdk', () => ({
LoginManager: {
logInWithReadPermissions: jest
diff --git a/__tests__/containers/__snapshots__/LoginOptionsScreen.js.snap b/src/containers/LoginOptionsScreen/__tests__/__snapshots__/LoginOptionsScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/LoginOptionsScreen.js.snap
rename to src/containers/LoginOptionsScreen/__tests__/__snapshots__/LoginOptionsScreen.js.snap
diff --git a/__tests__/containers/LoginScreen.js b/src/containers/LoginScreen/__tests__/LoginScreen.js
similarity index 86%
rename from __tests__/containers/LoginScreen.js
rename to src/containers/LoginScreen/__tests__/LoginScreen.js
index 756705e2b3..1882df2a6a 100644
--- a/__tests__/containers/LoginScreen.js
+++ b/src/containers/LoginScreen/__tests__/LoginScreen.js
@@ -6,10 +6,12 @@ import { Provider } from 'react-redux';
import renderer from 'react-test-renderer';
import Carousel from 'react-native-snap-carousel';
-import { createMockStore } from '../../testUtils/index';
-import LoginScreen from '../../src/containers/LoginScreen';
-import { renderShallow } from '../../testUtils';
-import * as analytics from '../../src/actions/analytics';
+import { createMockStore } from '../../../../testUtils';
+
+import LoginScreen from '..';
+
+import { renderShallow } from '../../../../testUtils';
+import * as analytics from '../../../actions/analytics';
const store = createMockStore({});
let screen;
diff --git a/__tests__/containers/__snapshots__/LoginScreen.js.snap b/src/containers/LoginScreen/__tests__/__snapshots__/LoginScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/LoginScreen.js.snap
rename to src/containers/LoginScreen/__tests__/__snapshots__/LoginScreen.js.snap
diff --git a/__tests__/containers/MFACodeScreen.js b/src/containers/MFACodeScreen/__tests__/MFACodeScreen.js
similarity index 87%
rename from __tests__/containers/MFACodeScreen.js
rename to src/containers/MFACodeScreen/__tests__/MFACodeScreen.js
index 41fa8d5138..74ae827aca 100644
--- a/__tests__/containers/MFACodeScreen.js
+++ b/src/containers/MFACodeScreen/__tests__/MFACodeScreen.js
@@ -3,13 +3,15 @@ import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
import { Alert } from 'react-native';
-import { renderShallow } from '../../testUtils';
-import MFACodeScreen from '../../src/containers/MFACodeScreen';
-import { keyLogin } from '../../src/actions/auth';
-import { MFA_REQUIRED } from '../../src/constants';
-import i18n from '../../src/i18n';
+import { renderShallow } from '../../../../testUtils';
-jest.mock('../../src/actions/auth');
+import MFACodeScreen from '..';
+
+import { keyLogin } from '../../../actions/auth';
+import { MFA_REQUIRED } from '../../../constants';
+import i18n from '../../../i18n';
+
+jest.mock('../../../actions/auth');
const mockStore = configureStore([thunk]);
const store = mockStore({});
diff --git a/__tests__/containers/__snapshots__/MFACodeScreen.js.snap b/src/containers/MFACodeScreen/__tests__/__snapshots__/MFACodeScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/MFACodeScreen.js.snap
rename to src/containers/MFACodeScreen/__tests__/__snapshots__/MFACodeScreen.js.snap
diff --git a/__tests__/containers/MemberCelebrate.js b/src/containers/MemberCelebrate/__tests__/MemberCelebrate.js
similarity index 92%
rename from __tests__/containers/MemberCelebrate.js
rename to src/containers/MemberCelebrate/__tests__/MemberCelebrate.js
index dcf88ca85e..a97f898dc8 100644
--- a/__tests__/containers/MemberCelebrate.js
+++ b/src/containers/MemberCelebrate/__tests__/MemberCelebrate.js
@@ -2,8 +2,9 @@ import React from 'react';
import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
-import MemberCelebrate from '../../src/containers/MemberCelebrate';
-import { testSnapshotShallow } from '../../testUtils';
+import MemberCelebrate from '..';
+
+import { testSnapshotShallow } from '../../../../testUtils';
const mockEmptyState = {
organizations: {
diff --git a/__tests__/containers/__snapshots__/MemberCelebrate.js.snap b/src/containers/MemberCelebrate/__tests__/__snapshots__/MemberCelebrate.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/MemberCelebrate.js.snap
rename to src/containers/MemberCelebrate/__tests__/__snapshots__/MemberCelebrate.js.snap
diff --git a/__tests__/containers/MemberContacts.js b/src/containers/MemberContacts/__tests__/MemberContacts.js
similarity index 92%
rename from __tests__/containers/MemberContacts.js
rename to src/containers/MemberContacts/__tests__/MemberContacts.js
index c1e1553be0..bcc5bc7a2f 100644
--- a/__tests__/containers/MemberContacts.js
+++ b/src/containers/MemberContacts/__tests__/MemberContacts.js
@@ -2,8 +2,9 @@ import React from 'react';
import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
-import MemberContacts from '../../src/containers/MemberContacts';
-import { testSnapshotShallow, renderShallow } from '../../testUtils';
+import MemberContacts from '..';
+
+import { testSnapshotShallow, renderShallow } from '../../../../testUtils';
const contactAssignment = { id: '1', person: {}, organization: { id: '100' } };
const contactAssignmentDifferentOrg = {
diff --git a/__tests__/containers/__snapshots__/MemberContacts.js.snap b/src/containers/MemberContacts/__tests__/__snapshots__/MemberContacts.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/MemberContacts.js.snap
rename to src/containers/MemberContacts/__tests__/__snapshots__/MemberContacts.js.snap
diff --git a/__tests__/containers/NotificationOffScreen.js b/src/containers/NotificationOffScreen/__tests__/NotificationOffScreen.js
similarity index 73%
rename from __tests__/containers/NotificationOffScreen.js
rename to src/containers/NotificationOffScreen/__tests__/NotificationOffScreen.js
index 60731c3572..9d0d62cd24 100644
--- a/__tests__/containers/NotificationOffScreen.js
+++ b/src/containers/NotificationOffScreen/__tests__/NotificationOffScreen.js
@@ -2,14 +2,16 @@ import 'react-native';
import React from 'react';
import configureStore from 'redux-mock-store';
-import { renderShallow } from '../../testUtils';
-import NotificationOffScreen from '../../src/containers/NotificationOffScreen';
-import { trackActionWithoutData } from '../../src/actions/analytics';
-import { navigateBack } from '../../src/actions/navigation';
-import { ACTIONS } from '../../src/constants';
-
-jest.mock('../../src/actions/analytics');
-jest.mock('../../src/actions/navigation');
+import { renderShallow } from '../../../../testUtils';
+
+import NotificationOffScreen from '..';
+
+import { trackActionWithoutData } from '../../../actions/analytics';
+import { navigateBack } from '../../../actions/navigation';
+import { ACTIONS } from '../../../constants';
+
+jest.mock('../../../actions/analytics');
+jest.mock('../../../actions/navigation');
const mockStore = configureStore();
let store;
diff --git a/__tests__/containers/__snapshots__/NotificationOffScreen.js.snap b/src/containers/NotificationOffScreen/__tests__/__snapshots__/NotificationOffScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/NotificationOffScreen.js.snap
rename to src/containers/NotificationOffScreen/__tests__/__snapshots__/NotificationOffScreen.js.snap
diff --git a/__tests__/containers/NotificationPrimerScreen.js b/src/containers/NotificationPrimerScreen/__tests__/NotificationPrimerScreen.js
similarity index 87%
rename from __tests__/containers/NotificationPrimerScreen.js
rename to src/containers/NotificationPrimerScreen/__tests__/NotificationPrimerScreen.js
index 948b85f156..d3d3d05d9c 100644
--- a/__tests__/containers/NotificationPrimerScreen.js
+++ b/src/containers/NotificationPrimerScreen/__tests__/NotificationPrimerScreen.js
@@ -5,22 +5,23 @@ import thunk from 'redux-thunk';
import configureStore from 'redux-mock-store';
import i18next from 'i18next';
-import NotificationPrimerScreen from '../../src/containers/NotificationPrimerScreen';
+import NotificationPrimerScreen from '..';
+
import {
createMockNavState,
testSnapshot,
renderShallow,
-} from '../../testUtils';
-import { requestNativePermissions } from '../../src/actions/notifications';
-import { trackActionWithoutData } from '../../src/actions/analytics';
-import { ACTIONS } from '../../src/constants';
+} from '../../../../testUtils';
+import { requestNativePermissions } from '../../../actions/notifications';
+import { trackActionWithoutData } from '../../../actions/analytics';
+import { ACTIONS } from '../../../constants';
const mockStore = configureStore([thunk]);
let store;
jest.mock('react-native-device-info');
-jest.mock('../../src/actions/notifications');
-jest.mock('../../src/actions/analytics');
+jest.mock('../../../actions/notifications');
+jest.mock('../../../actions/analytics');
const registerResult = { type: 'request permissions' };
const trackActionResult = { type: 'tracked action' };
diff --git a/__tests__/containers/__snapshots__/NotificationPrimerScreen.js.snap b/src/containers/NotificationPrimerScreen/__tests__/__snapshots__/NotificationPrimerScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/NotificationPrimerScreen.js.snap
rename to src/containers/NotificationPrimerScreen/__tests__/__snapshots__/NotificationPrimerScreen.js.snap
diff --git a/__tests__/containers/PathwayStageDisplay.js b/src/containers/PathwayStageDisplay/__tests__/PathwayStageDisplay.js
similarity index 92%
rename from __tests__/containers/PathwayStageDisplay.js
rename to src/containers/PathwayStageDisplay/__tests__/PathwayStageDisplay.js
index 664cf95563..6e98571fd2 100644
--- a/__tests__/containers/PathwayStageDisplay.js
+++ b/src/containers/PathwayStageDisplay/__tests__/PathwayStageDisplay.js
@@ -2,14 +2,15 @@ import React from 'react';
import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
-import PathwayStageDisplay from '../../src/containers/PathwayStageDisplay';
-import { testSnapshotShallow } from '../../testUtils';
+import PathwayStageDisplay from '..';
+
+import { testSnapshotShallow } from '../../../../testUtils';
import {
personSelector,
contactAssignmentSelector,
-} from '../../src/selectors/people';
+} from '../../../selectors/people';
-jest.mock('../../src/selectors/people');
+jest.mock('../../../selectors/people');
const stages = {
stages: [
diff --git a/__tests__/containers/__snapshots__/PathwayStageDisplay.js.snap b/src/containers/PathwayStageDisplay/__tests__/__snapshots__/PathwayStageDisplay.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/PathwayStageDisplay.js.snap
rename to src/containers/PathwayStageDisplay/__tests__/__snapshots__/PathwayStageDisplay.js.snap
diff --git a/__tests__/containers/PathwayStageScreen.js b/src/containers/PathwayStageScreen/__tests__/PathwayStageScreen.js
similarity index 90%
rename from __tests__/containers/PathwayStageScreen.js
rename to src/containers/PathwayStageScreen/__tests__/PathwayStageScreen.js
index 48d64dfce8..ce878ab560 100644
--- a/__tests__/containers/PathwayStageScreen.js
+++ b/src/containers/PathwayStageScreen/__tests__/PathwayStageScreen.js
@@ -4,10 +4,11 @@ import Enzyme, { shallow } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import { Provider } from 'react-redux';
-// Note: test renderer must be required after react-native.
-import { createMockStore, testSnapshot } from '../../testUtils';
-import PathwayStageScreen from '../../src/containers/PathwayStageScreen';
-import * as common from '../../src/utils/common';
+import { createMockStore, testSnapshot } from '../../../../testUtils';
+
+import PathwayStageScreen from '..';
+
+import * as common from '../../../utils/common';
const store = createMockStore({
stages: {
diff --git a/__tests__/containers/__snapshots__/PathwayStageScreen.js.snap b/src/containers/PathwayStageScreen/__tests__/__snapshots__/PathwayStageScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/PathwayStageScreen.js.snap
rename to src/containers/PathwayStageScreen/__tests__/__snapshots__/PathwayStageScreen.js.snap
diff --git a/__tests__/containers/PeopleItem.js b/src/containers/PeopleItem/__tests__/PeopleItem.js
similarity index 81%
rename from __tests__/containers/PeopleItem.js
rename to src/containers/PeopleItem/__tests__/PeopleItem.js
index 98aaaa4d84..984a578181 100644
--- a/__tests__/containers/PeopleItem.js
+++ b/src/containers/PeopleItem/__tests__/PeopleItem.js
@@ -2,11 +2,17 @@ import 'react-native';
import React from 'react';
import { Provider } from 'react-redux';
-import { createMockStore, renderShallow, testSnapshot } from '../../testUtils';
-import PeopleItem from '../../src/containers/PeopleItem';
-import { navigatePush } from '../../src/actions/navigation';
-import { PERSON_STAGE_SCREEN } from '../../src/containers/PersonStageScreen';
-import { communityIsCru, isMissionhubUser } from '../../src/utils/common';
+import {
+ createMockStore,
+ renderShallow,
+ testSnapshot,
+} from '../../../../testUtils';
+
+import PeopleItem from '..';
+
+import { navigatePush } from '../../../actions/navigation';
+import { PERSON_STAGE_SCREEN } from '../../PersonStageScreen';
+import { orgIsCru, isMissionhubUser } from '../../../utils/common';
const myId = '1';
const stageId = '1';
@@ -68,17 +74,16 @@ const mockGetPeopleResult = { type: 'got people' };
let shallowScreen;
-jest.mock('react-native-device-info');
-jest.mock('../../src/actions/people', () => ({
+jest.mock('../../../actions/people', () => ({
getMyPeople: () => mockGetPeopleResult,
}));
-jest.mock('../../src/actions/navigation', () => ({
+jest.mock('../../../actions/navigation', () => ({
navigatePush: jest.fn((_, params) => {
params.onComplete();
return mockNavigatePushResult;
}),
}));
-jest.mock('../../src/utils/common');
+jest.mock('../../../utils/common');
beforeEach(() => {
jest.clearAllMocks();
@@ -87,7 +92,7 @@ beforeEach(() => {
it('renders me correctly', () => {
const mePerson = { ...mockPerson, id: myId };
- communityIsCru.mockReturnValue(false);
+ orgIsCru.mockReturnValue(false);
isMissionhubUser.mockReturnValue(false);
testSnapshot(
@@ -99,12 +104,12 @@ it('renders me correctly', () => {
/>
,
);
- expect(communityIsCru).toHaveBeenCalledWith(mockPersonalMinistry);
+ expect(orgIsCru).toHaveBeenCalledWith(mockPersonalMinistry);
expect(isMissionhubUser).not.toHaveBeenCalled();
});
it('renders personal ministry contact correctly', () => {
- communityIsCru.mockReturnValue(false);
+ orgIsCru.mockReturnValue(false);
isMissionhubUser.mockReturnValue(false);
testSnapshot(
@@ -116,12 +121,12 @@ it('renders personal ministry contact correctly', () => {
/>
,
);
- expect(communityIsCru).toHaveBeenCalledWith(mockPersonalMinistry);
+ expect(orgIsCru).toHaveBeenCalledWith(mockPersonalMinistry);
expect(isMissionhubUser).not.toHaveBeenCalled();
});
it('renders cru org contact correctly', () => {
- communityIsCru.mockReturnValue(true);
+ orgIsCru.mockReturnValue(true);
isMissionhubUser.mockReturnValue(false);
testSnapshot(
@@ -133,12 +138,12 @@ it('renders cru org contact correctly', () => {
/>
,
);
- expect(communityIsCru).toHaveBeenCalledWith(mockOrganization);
+ expect(orgIsCru).toHaveBeenCalledWith(mockOrganization);
expect(isMissionhubUser).toHaveBeenCalledWith(mockOrgPermission);
});
it('renders cru org contact without stage correctly', () => {
- communityIsCru.mockReturnValue(true);
+ orgIsCru.mockReturnValue(true);
isMissionhubUser.mockReturnValue(false);
testSnapshot(
@@ -153,12 +158,12 @@ it('renders cru org contact without stage correctly', () => {
/>
,
);
- expect(communityIsCru).toHaveBeenCalledWith(mockOrganization);
+ expect(orgIsCru).toHaveBeenCalledWith(mockOrganization);
expect(isMissionhubUser).toHaveBeenCalledWith(mockOrgPermission);
});
it('renders uncontacted cru org contact correctly', () => {
- communityIsCru.mockReturnValue(true);
+ orgIsCru.mockReturnValue(true);
isMissionhubUser.mockReturnValue(false);
testSnapshot(
@@ -173,12 +178,12 @@ it('renders uncontacted cru org contact correctly', () => {
/>
,
);
- expect(communityIsCru).toHaveBeenCalledWith(mockOrganization);
+ expect(orgIsCru).toHaveBeenCalledWith(mockOrganization);
expect(isMissionhubUser).toHaveBeenCalledWith(mockOrgPermissionUncontacted);
});
it('renders cru org member correctly', () => {
- communityIsCru.mockReturnValue(true);
+ orgIsCru.mockReturnValue(true);
isMissionhubUser.mockReturnValue(true);
testSnapshot(
@@ -190,7 +195,7 @@ it('renders cru org member correctly', () => {
/>
,
);
- expect(communityIsCru).toHaveBeenCalledWith(mockOrganization);
+ expect(orgIsCru).toHaveBeenCalledWith(mockOrganization);
expect(isMissionhubUser).toHaveBeenCalledWith(mockOrgPermission);
});
diff --git a/__tests__/containers/__snapshots__/PeopleItem.js.snap b/src/containers/PeopleItem/__tests__/__snapshots__/PeopleItem.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/PeopleItem.js.snap
rename to src/containers/PeopleItem/__tests__/__snapshots__/PeopleItem.js.snap
diff --git a/src/containers/PeopleItem/index.js b/src/containers/PeopleItem/index.js
index 7d826008ec..ba58570186 100644
--- a/src/containers/PeopleItem/index.js
+++ b/src/containers/PeopleItem/index.js
@@ -7,7 +7,7 @@ import { Flex, Text, Touchable, Icon } from '../../components/common';
import { navigatePush } from '../../actions/navigation';
import { getMyPeople } from '../../actions/people';
import { PERSON_STAGE_SCREEN } from '../PersonStageScreen';
-import { isMissionhubUser, communityIsCru } from '../../utils/common';
+import { isMissionhubUser, orgIsCru } from '../../utils/common';
import styles from './styles';
@@ -72,7 +72,7 @@ export class PeopleItem extends Component {
}
}
- const isCruOrg = communityIsCru(organization);
+ const isCruOrg = orgIsCru(organization);
let status = 'uncontacted';
diff --git a/__tests__/containers/PeopleScreen.js b/src/containers/PeopleScreen/__tests__/PeopleScreen.js
similarity index 83%
rename from __tests__/containers/PeopleScreen.js
rename to src/containers/PeopleScreen/__tests__/PeopleScreen.js
index e0938c9f3d..0ae3d4b5d1 100644
--- a/__tests__/containers/PeopleScreen.js
+++ b/src/containers/PeopleScreen/__tests__/PeopleScreen.js
@@ -1,19 +1,17 @@
import 'react-native';
import React from 'react';
-import {
- PeopleScreen,
- mapStateToProps,
-} from '../../src/containers/PeopleScreen';
-import { testSnapshotShallow, renderShallow } from '../../testUtils';
-import { peopleByOrgSelector } from '../../src/selectors/people';
-import * as common from '../../src/utils/common';
-import { navToPersonScreen } from '../../src/actions/person';
+import { PeopleScreen, mapStateToProps } from '..';
-jest.mock('../../src/actions/person');
-jest.mock('../../src/selectors/people');
+import { testSnapshotShallow, renderShallow } from '../../../../testUtils';
+import { peopleByOrgSelector } from '../../../selectors/people';
+import * as common from '../../../utils/common';
+import { navToPersonScreen } from '../../../actions/person';
-jest.mock('../../src/actions/people', () => ({
+jest.mock('../../../actions/person');
+jest.mock('../../../selectors/people');
+
+jest.mock('../../../actions/people', () => ({
getMyPeople: jest.fn(),
}));
diff --git a/__tests__/containers/__snapshots__/PeopleScreen.js.snap b/src/containers/PeopleScreen/__tests__/__snapshots__/PeopleScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/PeopleScreen.js.snap
rename to src/containers/PeopleScreen/__tests__/__snapshots__/PeopleScreen.js.snap
diff --git a/__tests__/containers/SearchPeopleFilterRefineScreen.js b/src/containers/SearchPeopleFilterRefineScreen/__tests__/SearchPeopleFilterRefineScreen.js
similarity index 80%
rename from __tests__/containers/SearchPeopleFilterRefineScreen.js
rename to src/containers/SearchPeopleFilterRefineScreen/__tests__/SearchPeopleFilterRefineScreen.js
index f8dbb7e940..c95fb7e092 100644
--- a/__tests__/containers/SearchPeopleFilterRefineScreen.js
+++ b/src/containers/SearchPeopleFilterRefineScreen/__tests__/SearchPeopleFilterRefineScreen.js
@@ -2,9 +2,11 @@ import 'react-native';
import React from 'react';
import { Provider } from 'react-redux';
-import { createMockStore } from '../../testUtils/index';
-import SearchPeopleFilterRefineScreen from '../../src/containers/SearchPeopleFilterRefineScreen';
-import { createMockNavState, testSnapshot } from '../../testUtils';
+import { createMockStore } from '../../../../testUtils';
+
+import SearchPeopleFilterRefineScreen from '..';
+
+import { createMockNavState, testSnapshot } from '../../../../testUtils';
const store = createMockStore();
diff --git a/__tests__/containers/__snapshots__/SearchPeopleFilterRefineScreen.js.snap b/src/containers/SearchPeopleFilterRefineScreen/__tests__/__snapshots__/SearchPeopleFilterRefineScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/SearchPeopleFilterRefineScreen.js.snap
rename to src/containers/SearchPeopleFilterRefineScreen/__tests__/__snapshots__/SearchPeopleFilterRefineScreen.js.snap
diff --git a/__tests__/containers/SearchPeopleFilterScreen.js b/src/containers/SearchPeopleFilterScreen/__tests__/SearchPeopleFilterScreen.js
similarity index 77%
rename from __tests__/containers/SearchPeopleFilterScreen.js
rename to src/containers/SearchPeopleFilterScreen/__tests__/SearchPeopleFilterScreen.js
index f19b4cae65..db6f3ca27b 100644
--- a/__tests__/containers/SearchPeopleFilterScreen.js
+++ b/src/containers/SearchPeopleFilterScreen/__tests__/SearchPeopleFilterScreen.js
@@ -2,9 +2,11 @@ import 'react-native';
import React from 'react';
import { Provider } from 'react-redux';
-import { createMockStore } from '../../testUtils/index';
-import SearchPeopleFilterScreen from '../../src/containers/SearchPeopleFilterScreen';
-import { createMockNavState, testSnapshot } from '../../testUtils';
+import { createMockStore } from '../../../../testUtils';
+
+import SearchPeopleFilterScreen from '..';
+
+import { createMockNavState, testSnapshot } from '../../../../testUtils';
const mockStore = {
organizations: { all: [] },
diff --git a/__tests__/containers/__snapshots__/SearchPeopleFilterScreen.js.snap b/src/containers/SearchPeopleFilterScreen/__tests__/__snapshots__/SearchPeopleFilterScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/SearchPeopleFilterScreen.js.snap
rename to src/containers/SearchPeopleFilterScreen/__tests__/__snapshots__/SearchPeopleFilterScreen.js.snap
diff --git a/__tests__/containers/SearchPeopleScreen.js b/src/containers/SearchPeopleScreen/__tests__/SearchPeopleScreen.js
similarity index 92%
rename from __tests__/containers/SearchPeopleScreen.js
rename to src/containers/SearchPeopleScreen/__tests__/SearchPeopleScreen.js
index 613553a5e2..28a4cb9ada 100644
--- a/__tests__/containers/SearchPeopleScreen.js
+++ b/src/containers/SearchPeopleScreen/__tests__/SearchPeopleScreen.js
@@ -4,16 +4,19 @@ import Enzyme, { shallow } from 'enzyme';
import { Provider } from 'react-redux';
import Adapter from 'enzyme-adapter-react-16';
-import SearchPeopleScreenConnected, {
- SearchPeopleScreen,
-} from '../../src/containers/SearchPeopleScreen';
-import { testSnapshot, createMockStore, renderShallow } from '../../testUtils';
-import { navToPersonScreen } from '../../src/actions/person';
+import SearchPeopleScreenConnected, { SearchPeopleScreen } from '..';
+
+import {
+ testSnapshot,
+ createMockStore,
+ renderShallow,
+} from '../../../../testUtils';
+import { navToPersonScreen } from '../../../actions/person';
const store = createMockStore();
jest.mock('react-native-device-info');
-jest.mock('../../src/actions/person');
+jest.mock('../../../actions/person');
const mockDispatch = r => Promise.resolve(r);
diff --git a/__tests__/containers/__snapshots__/SearchPeopleScreen.js.snap b/src/containers/SearchPeopleScreen/__tests__/__snapshots__/SearchPeopleScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/SearchPeopleScreen.js.snap
rename to src/containers/SearchPeopleScreen/__tests__/__snapshots__/SearchPeopleScreen.js.snap
diff --git a/__tests__/containers/SelectStepScreen.js b/src/containers/SelectStepScreen/__tests__/SelectStepScreen.js
similarity index 92%
rename from __tests__/containers/SelectStepScreen.js
rename to src/containers/SelectStepScreen/__tests__/SelectStepScreen.js
index 40dfa1e646..9c2291626c 100644
--- a/__tests__/containers/SelectStepScreen.js
+++ b/src/containers/SelectStepScreen/__tests__/SelectStepScreen.js
@@ -1,23 +1,22 @@
import 'react-native';
import React from 'react';
-import SelectStepScreen, {
- mapStateToProps,
-} from '../../src/containers/SelectStepScreen';
+import SelectStepScreen, { mapStateToProps } from '..';
+
import {
renderShallow,
createMockStore,
testSnapshotShallow,
-} from '../../testUtils';
-import * as navigation from '../../src/actions/navigation';
-import { ADD_STEP_SCREEN } from '../../src/containers/AddStepScreen';
-import { addSteps, getStepSuggestions } from '../../src/actions/steps';
-import { shuffleArray } from '../../src/utils/common';
-import { CREATE_STEP } from '../../src/constants';
+} from '../../../../testUtils';
+import * as navigation from '../../../actions/navigation';
+import { ADD_STEP_SCREEN } from '../../AddStepScreen';
+import { addSteps, getStepSuggestions } from '../../../actions/steps';
+import { shuffleArray } from '../../../utils/common';
+import { CREATE_STEP } from '../../../constants';
jest.mock('react-native-device-info');
-jest.mock('../../src/actions/steps');
-jest.mock('../../src/utils/common');
+jest.mock('../../../actions/steps');
+jest.mock('../../../utils/common');
shuffleArray.mockImplementation(arr => arr);
const testName = 'Bill';
diff --git a/__tests__/containers/__snapshots__/SelectStepScreen.js.snap b/src/containers/SelectStepScreen/__tests__/__snapshots__/SelectStepScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/SelectStepScreen.js.snap
rename to src/containers/SelectStepScreen/__tests__/__snapshots__/SelectStepScreen.js.snap
diff --git a/__tests__/containers/SetupScreen.js b/src/containers/SetupScreen/__tests__/SetupScreen.js
similarity index 82%
rename from __tests__/containers/SetupScreen.js
rename to src/containers/SetupScreen/__tests__/SetupScreen.js
index 786dd5f7ef..c20065a3eb 100644
--- a/__tests__/containers/SetupScreen.js
+++ b/src/containers/SetupScreen/__tests__/SetupScreen.js
@@ -2,9 +2,15 @@ import 'react-native';
import React from 'react';
import { Provider } from 'react-redux';
-import { createMockStore, renderShallow, testSnapshot } from '../../testUtils';
-import SetupScreen from '../../src/containers/SetupScreen';
-import * as profile from '../../src/actions/onboardingProfile';
+import {
+ createMockStore,
+ renderShallow,
+ testSnapshot,
+} from '../../../../testUtils';
+
+import SetupScreen from '..';
+
+import * as profile from '../../../actions/onboardingProfile';
const store = createMockStore({ profile: {} });
diff --git a/__tests__/containers/__snapshots__/SetupScreen.js.snap b/src/containers/SetupScreen/__tests__/__snapshots__/SetupScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/SetupScreen.js.snap
rename to src/containers/SetupScreen/__tests__/__snapshots__/SetupScreen.js.snap
diff --git a/__tests__/containers/StatusCompleteScreen.js b/src/containers/StatusCompleteScreen/__tests__/StatusCompleteScreen.js
similarity index 85%
rename from __tests__/containers/StatusCompleteScreen.js
rename to src/containers/StatusCompleteScreen/__tests__/StatusCompleteScreen.js
index fcb3010843..c19d7916a7 100644
--- a/__tests__/containers/StatusCompleteScreen.js
+++ b/src/containers/StatusCompleteScreen/__tests__/StatusCompleteScreen.js
@@ -1,14 +1,15 @@
import React from 'react';
-import StatusCompleteScreen from '../../src/containers/StatusCompleteScreen';
-import { STATUS_REASON_SCREEN } from '../../src/containers/StatusReasonScreen';
+import StatusCompleteScreen from '..';
+
+import { STATUS_REASON_SCREEN } from '../../StatusReasonScreen';
import {
createMockStore,
renderShallow,
testSnapshotShallow,
createMockNavState,
-} from '../../testUtils';
-import * as navigation from '../../src/actions/navigation';
+} from '../../../../testUtils';
+import * as navigation from '../../../actions/navigation';
const store = createMockStore({
auth: {
diff --git a/__tests__/containers/__snapshots__/StatusCompleteScreen.js.snap b/src/containers/StatusCompleteScreen/__tests__/__snapshots__/StatusCompleteScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/StatusCompleteScreen.js.snap
rename to src/containers/StatusCompleteScreen/__tests__/__snapshots__/StatusCompleteScreen.js.snap
diff --git a/__tests__/containers/StatusReasonScreen.js b/src/containers/StatusReasonScreen/__tests__/StatusReasonScreen.js
similarity index 87%
rename from __tests__/containers/StatusReasonScreen.js
rename to src/containers/StatusReasonScreen/__tests__/StatusReasonScreen.js
index 91e0c613b3..c7bdffa5f1 100644
--- a/__tests__/containers/StatusReasonScreen.js
+++ b/src/containers/StatusReasonScreen/__tests__/StatusReasonScreen.js
@@ -1,16 +1,17 @@
import React from 'react';
-import StatusReasonScreen from '../../src/containers/StatusReasonScreen';
+import StatusReasonScreen from '..';
+
import {
createMockStore,
renderShallow,
createMockNavState,
-} from '../../testUtils';
-import { deleteContactAssignment } from '../../src/actions/person';
-import { navigateBack } from '../../src/actions/navigation';
+} from '../../../../testUtils';
+import { deleteContactAssignment } from '../../../actions/person';
+import { navigateBack } from '../../../actions/navigation';
-jest.mock('../../src/actions/person');
-jest.mock('../../src/actions/navigation');
+jest.mock('../../../actions/person');
+jest.mock('../../../actions/navigation');
const store = createMockStore({
auth: {
diff --git a/__tests__/containers/__snapshots__/StatusReasonScreen.js.snap b/src/containers/StatusReasonScreen/__tests__/__snapshots__/StatusReasonScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/StatusReasonScreen.js.snap
rename to src/containers/StatusReasonScreen/__tests__/__snapshots__/StatusReasonScreen.js.snap
diff --git a/__tests__/containers/StatusSelectScreen.js b/src/containers/StatusSelectScreen/__tests__/StatusSelectScreen.js
similarity index 87%
rename from __tests__/containers/StatusSelectScreen.js
rename to src/containers/StatusSelectScreen/__tests__/StatusSelectScreen.js
index db10366ccc..38063a3283 100644
--- a/__tests__/containers/StatusSelectScreen.js
+++ b/src/containers/StatusSelectScreen/__tests__/StatusSelectScreen.js
@@ -1,27 +1,26 @@
import React from 'react';
-import StatusSelectScreen, {
- mapStateToProps,
-} from '../../src/containers/StatusSelectScreen';
+import StatusSelectScreen, { mapStateToProps } from '..';
+
import {
createMockStore,
renderShallow,
testSnapshotShallow,
createMockNavState,
-} from '../../testUtils';
-import { updateFollowupStatus } from '../../src/actions/person';
-import * as navigation from '../../src/actions/navigation';
-import { STATUS_COMPLETE_SCREEN } from '../../src/containers/StatusCompleteScreen';
+} from '../../../../testUtils';
+import { updateFollowupStatus } from '../../../actions/person';
+import * as navigation from '../../../actions/navigation';
+import { STATUS_COMPLETE_SCREEN } from '../../StatusCompleteScreen';
import {
contactAssignmentSelector,
orgPermissionSelector,
personSelector,
-} from '../../src/selectors/people';
+} from '../../../selectors/people';
-jest.mock('../../src/actions/person', () => ({
+jest.mock('../../../actions/person', () => ({
updateFollowupStatus: jest.fn(() => Promise.resolve()),
}));
-jest.mock('../../src/selectors/people');
+jest.mock('../../../selectors/people');
const store = createMockStore({});
diff --git a/__tests__/containers/__snapshots__/StatusSelectScreen.js.snap b/src/containers/StatusSelectScreen/__tests__/__snapshots__/StatusSelectScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/StatusSelectScreen.js.snap
rename to src/containers/StatusSelectScreen/__tests__/__snapshots__/StatusSelectScreen.js.snap
diff --git a/__tests__/containers/StepsScreen.android.js b/src/containers/StepsScreen/__tests__/StepsScreen.android.js
similarity index 83%
rename from __tests__/containers/StepsScreen.android.js
rename to src/containers/StepsScreen/__tests__/StepsScreen.android.js
index ec6cb5ff46..93d780b928 100644
--- a/__tests__/containers/StepsScreen.android.js
+++ b/src/containers/StepsScreen/__tests__/StepsScreen.android.js
@@ -1,11 +1,12 @@
import 'react-native';
import React from 'react';
-import { StepsScreen } from '../../src/containers/StepsScreen';
-import { testSnapshotShallow } from '../../testUtils';
+import { StepsScreen } from '..';
+
+import { testSnapshotShallow } from '../../../../testUtils';
jest.mock('react-native-device-info');
-jest.mock('../../src/utils/common', () => ({
+jest.mock('../../../utils/common', () => ({
exists: v => typeof v !== 'undefined',
isAndroid: true,
isiPhoneX: jest.fn(),
diff --git a/__tests__/containers/StepsScreen.js b/src/containers/StepsScreen/__tests__/StepsScreen.js
similarity index 92%
rename from __tests__/containers/StepsScreen.js
rename to src/containers/StepsScreen/__tests__/StepsScreen.js
index b370cdf64c..cc3d2c06b9 100644
--- a/__tests__/containers/StepsScreen.js
+++ b/src/containers/StepsScreen/__tests__/StepsScreen.js
@@ -2,33 +2,35 @@ import { ScrollView } from 'react-native';
import React from 'react';
import i18next from 'i18next';
-import { renderShallow } from '../../testUtils';
-import { StepsScreen, mapStateToProps } from '../../src/containers/StepsScreen';
+import { renderShallow } from '../../../../testUtils';
+
+import { StepsScreen, mapStateToProps } from '..';
+
import {
reminderStepsSelector,
nonReminderStepsSelector,
-} from '../../src/selectors/steps';
-import theme from '../../src/theme';
-import { trackActionWithoutData } from '../../src/actions/analytics';
-import { ACTIONS } from '../../src/constants';
+} from '../../../selectors/steps';
+import theme from '../../../theme';
+import { trackActionWithoutData } from '../../../actions/analytics';
+import { ACTIONS } from '../../../constants';
import {
showReminderScreen,
showWelcomeNotification,
toast,
-} from '../../src/actions/notifications';
+} from '../../../actions/notifications';
import {
completeStepReminder,
deleteStepWithTracking,
setStepFocus,
-} from '../../src/actions/steps';
-import * as common from '../../src/utils/common';
-import { navToPersonScreen } from '../../src/actions/person';
-
-jest.mock('../../src/selectors/steps');
-jest.mock('../../src/actions/analytics');
-jest.mock('../../src/actions/notifications');
-jest.mock('../../src/actions/steps');
-jest.mock('../../src/actions/person');
+} from '../../../actions/steps';
+import * as common from '../../../utils/common';
+import { navToPersonScreen } from '../../../actions/person';
+
+jest.mock('../../../selectors/steps');
+jest.mock('../../../actions/analytics');
+jest.mock('../../../actions/notifications');
+jest.mock('../../../actions/steps');
+jest.mock('../../../actions/person');
const dispatch = jest.fn(async () => {});
diff --git a/__tests__/containers/__snapshots__/StepsScreen.android.js.snap b/src/containers/StepsScreen/__tests__/__snapshots__/StepsScreen.android.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/StepsScreen.android.js.snap
rename to src/containers/StepsScreen/__tests__/__snapshots__/StepsScreen.android.js.snap
diff --git a/__tests__/containers/__snapshots__/StepsScreen.js.snap b/src/containers/StepsScreen/__tests__/__snapshots__/StepsScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/StepsScreen.js.snap
rename to src/containers/StepsScreen/__tests__/__snapshots__/StepsScreen.js.snap
diff --git a/__tests__/containers/WelcomeScreen.js b/src/containers/WelcomeScreen/__tests__/WelcomeScreen.js
similarity index 76%
rename from __tests__/containers/WelcomeScreen.js
rename to src/containers/WelcomeScreen/__tests__/WelcomeScreen.js
index ace5d07ab6..c7c8e4897b 100644
--- a/__tests__/containers/WelcomeScreen.js
+++ b/src/containers/WelcomeScreen/__tests__/WelcomeScreen.js
@@ -3,17 +3,18 @@ import React from 'react';
import { shallow } from 'enzyme';
import { Provider } from 'react-redux';
-import WelcomeScreen from '../../src/containers/WelcomeScreen';
-import { testSnapshot, createMockStore } from '../../testUtils';
-import * as navigation from '../../src/actions/navigation';
-import * as common from '../../src/utils/common';
-import { trackActionWithoutData } from '../../src/actions/analytics';
-import { ACTIONS } from '../../src/constants';
+import WelcomeScreen from '..';
+
+import { testSnapshot, createMockStore } from '../../../../testUtils';
+import * as navigation from '../../../actions/navigation';
+import * as common from '../../../utils/common';
+import { trackActionWithoutData } from '../../../actions/analytics';
+import { ACTIONS } from '../../../constants';
const store = createMockStore();
jest.mock('react-native-device-info');
-jest.mock('../../src/actions/analytics');
+jest.mock('../../../actions/analytics');
it('renders correctly', () => {
testSnapshot(
diff --git a/__tests__/containers/__snapshots__/WelcomeScreen.js.snap b/src/containers/WelcomeScreen/__tests__/__snapshots__/WelcomeScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/WelcomeScreen.js.snap
rename to src/containers/WelcomeScreen/__tests__/__snapshots__/WelcomeScreen.js.snap
diff --git a/__tests__/containers/AddSomeoneScreen.js b/src/containers/__tests__/AddSomeoneScreen.js
similarity index 70%
rename from __tests__/containers/AddSomeoneScreen.js
rename to src/containers/__tests__/AddSomeoneScreen.js
index 83f3409fea..9f9f00f586 100644
--- a/__tests__/containers/AddSomeoneScreen.js
+++ b/src/containers/__tests__/AddSomeoneScreen.js
@@ -2,13 +2,13 @@ import 'react-native';
import React from 'react';
import configureStore from 'redux-mock-store';
-import AddSomeoneScreen from '../../src/containers/AddSomeoneScreen';
-import { renderShallow } from '../../testUtils';
-import { navigatePush } from '../../src/actions/navigation';
-import { SETUP_PERSON_SCREEN } from '../../src/containers/SetupPersonScreen';
+import AddSomeoneScreen from '../AddSomeoneScreen';
+import { renderShallow } from '../../../testUtils';
+import { navigatePush } from '../../actions/navigation';
+import { SETUP_PERSON_SCREEN } from '../SetupPersonScreen';
jest.mock('react-native-device-info');
-jest.mock('../../src/actions/navigation');
+jest.mock('../../actions/navigation');
const mockStore = configureStore();
let screen;
diff --git a/__tests__/MainTabs.js b/src/containers/__tests__/MainTabs.js
similarity index 85%
rename from __tests__/MainTabs.js
rename to src/containers/__tests__/MainTabs.js
index de5e84e780..9f24fccdbd 100644
--- a/__tests__/MainTabs.js
+++ b/src/containers/__tests__/MainTabs.js
@@ -2,9 +2,9 @@ import 'react-native';
import React from 'react';
import { Provider } from 'react-redux';
-import theme from '../src/theme';
-import { createMockStore, testSnapshot } from '../testUtils';
-import { MainTabBar, MainTabBarGroups, navItem } from '../src/AppRoutes';
+import theme from '../../theme';
+import { createMockStore, testSnapshot } from '../../../testUtils';
+import { MainTabBar, MainTabBarGroups, navItem } from '../../AppRoutes';
const store = createMockStore({
steps: {
diff --git a/__tests__/containers/PersonSelectStepScreen.js b/src/containers/__tests__/PersonSelectStepScreen.js
similarity index 88%
rename from __tests__/containers/PersonSelectStepScreen.js
rename to src/containers/__tests__/PersonSelectStepScreen.js
index bac7171a70..90f50cc7c5 100644
--- a/__tests__/containers/PersonSelectStepScreen.js
+++ b/src/containers/__tests__/PersonSelectStepScreen.js
@@ -1,13 +1,13 @@
import 'react-native';
import React from 'react';
-import PersonSelectStepScreen from '../../src/containers/PersonSelectStepScreen';
+import PersonSelectStepScreen from '../PersonSelectStepScreen';
import {
createMockNavState,
createMockStore,
testSnapshotShallow,
renderShallow,
-} from '../../testUtils';
+} from '../../../testUtils';
const myId = '14312';
const contactId = '123';
@@ -24,7 +24,7 @@ const mockState = {
const store = createMockStore(mockState);
jest.mock('react-native-device-info');
-jest.mock('../../src/selectors/people');
+jest.mock('../../selectors/people');
it('renders correctly', () => {
testSnapshotShallow(
diff --git a/__tests__/containers/PersonStageScreen.js b/src/containers/__tests__/PersonStageScreen.js
similarity index 89%
rename from __tests__/containers/PersonStageScreen.js
rename to src/containers/__tests__/PersonStageScreen.js
index ef79e480f0..f1443b259f 100644
--- a/__tests__/containers/PersonStageScreen.js
+++ b/src/containers/__tests__/PersonStageScreen.js
@@ -4,19 +4,19 @@ import { Provider } from 'react-redux';
import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
-import PersonStageScreen from '../../src/containers/PersonStageScreen';
+import PersonStageScreen from '../PersonStageScreen';
import {
testSnapshot,
createMockNavState,
createMockStore,
renderShallow,
-} from '../../testUtils';
-import * as navigation from '../../src/actions/navigation';
-import * as selectStage from '../../src/actions/selectStage';
-import * as analytics from '../../src/actions/analytics';
-import { navigatePush } from '../../src/actions/navigation';
-import { PERSON_SELECT_STEP_SCREEN } from '../../src/containers/PersonSelectStepScreen';
-import { completeOnboarding } from '../../src/actions/onboardingProfile';
+} from '../../../testUtils';
+import * as navigation from '../../actions/navigation';
+import * as selectStage from '../../actions/selectStage';
+import * as analytics from '../../actions/analytics';
+import { navigatePush } from '../../actions/navigation';
+import { PERSON_SELECT_STEP_SCREEN } from '../PersonSelectStepScreen';
+import { completeOnboarding } from '../../actions/onboardingProfile';
const mockState = {
personProfile: {
@@ -48,7 +48,7 @@ const mockNavState = {
const trackStateResult = { type: 'tracked state' };
jest.mock('react-native-device-info');
-jest.mock('../../src/actions/onboardingProfile', () => ({
+jest.mock('../../actions/onboardingProfile', () => ({
completeOnboarding: jest
.fn()
.mockReturnValue({ type: 'onboarding complete' }),
diff --git a/__tests__/containers/SelectMyStepScreen.js b/src/containers/__tests__/SelectMyStepScreen.js
similarity index 91%
rename from __tests__/containers/SelectMyStepScreen.js
rename to src/containers/__tests__/SelectMyStepScreen.js
index da1e5203c1..91e26b5feb 100644
--- a/__tests__/containers/SelectMyStepScreen.js
+++ b/src/containers/__tests__/SelectMyStepScreen.js
@@ -1,12 +1,12 @@
import 'react-native';
import React from 'react';
-import SelectMyStepScreen from '../../src/containers/SelectMyStepScreen';
+import SelectMyStepScreen from '../SelectMyStepScreen';
import {
createMockNavState,
createMockStore,
testSnapshotShallow,
-} from '../../testUtils';
+} from '../../../testUtils';
jest.mock('react-native-device-info');
diff --git a/__tests__/containers/SetupPersonScreen.js b/src/containers/__tests__/SetupPersonScreen.js
similarity index 85%
rename from __tests__/containers/SetupPersonScreen.js
rename to src/containers/__tests__/SetupPersonScreen.js
index ca539e6b3b..18a9006d0f 100644
--- a/__tests__/containers/SetupPersonScreen.js
+++ b/src/containers/__tests__/SetupPersonScreen.js
@@ -6,17 +6,17 @@ import { Provider } from 'react-redux';
import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
-import SetupPersonScreen from '../../src/containers/SetupPersonScreen';
-import { testSnapshot } from '../../testUtils';
-import * as profile from '../../src/actions/onboardingProfile';
-import * as navigation from '../../src/actions/navigation';
-import * as person from '../../src/actions/person';
-import { trackActionWithoutData } from '../../src/actions/analytics';
-import { ACTIONS } from '../../src/constants';
-
-jest.mock('../../src/actions/onboardingProfile');
+import SetupPersonScreen from '../SetupPersonScreen';
+import { testSnapshot } from '../../../testUtils';
+import * as profile from '../../actions/onboardingProfile';
+import * as navigation from '../../actions/navigation';
+import * as person from '../../actions/person';
+import { trackActionWithoutData } from '../../actions/analytics';
+import { ACTIONS } from '../../constants';
+
+jest.mock('../../actions/onboardingProfile');
jest.mock('react-native-device-info');
-jest.mock('../../src/actions/analytics');
+jest.mock('../../actions/analytics');
Enzyme.configure({ adapter: new Adapter() });
diff --git a/__tests__/containers/StageScreen.js b/src/containers/__tests__/StageScreen.js
similarity index 92%
rename from __tests__/containers/StageScreen.js
rename to src/containers/__tests__/StageScreen.js
index 32b62867cf..ecb0390807 100644
--- a/__tests__/containers/StageScreen.js
+++ b/src/containers/__tests__/StageScreen.js
@@ -5,16 +5,16 @@ import renderer from 'react-test-renderer';
import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
-import StageScreen from '../../src/containers/StageScreen';
+import StageScreen from '../StageScreen';
import {
createMockNavState,
mockFnWithParams,
renderShallow,
testSnapshot,
-} from '../../testUtils';
-import * as selectStage from '../../src/actions/selectStage';
-import * as navigation from '../../src/actions/navigation';
-import { SELECT_MY_STEP_SCREEN } from '../../src/containers/SelectMyStepScreen';
+} from '../../../testUtils';
+import * as selectStage from '../../actions/selectStage';
+import * as navigation from '../../actions/navigation';
+import { SELECT_MY_STEP_SCREEN } from '../SelectMyStepScreen';
jest.mock('react-native-device-info');
diff --git a/__tests__/containers/StageSuccessScreen.js b/src/containers/__tests__/StageSuccessScreen.js
similarity index 88%
rename from __tests__/containers/StageSuccessScreen.js
rename to src/containers/__tests__/StageSuccessScreen.js
index 7f1ae932aa..870970a053 100644
--- a/__tests__/containers/StageSuccessScreen.js
+++ b/src/containers/__tests__/StageSuccessScreen.js
@@ -2,12 +2,12 @@ import 'react-native';
import React from 'react';
import { Provider } from 'react-redux';
-import StageSuccessScreen from '../../src/containers/StageSuccessScreen';
+import StageSuccessScreen from '../StageSuccessScreen';
import {
testSnapshot,
createMockNavState,
createMockStore,
-} from '../../testUtils';
+} from '../../../testUtils';
const mockState = {
profile: {},
diff --git a/__tests__/containers/__snapshots__/AddSomeoneScreen.js.snap b/src/containers/__tests__/__snapshots__/AddSomeoneScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/AddSomeoneScreen.js.snap
rename to src/containers/__tests__/__snapshots__/AddSomeoneScreen.js.snap
diff --git a/__tests__/__snapshots__/MainTabs.js.snap b/src/containers/__tests__/__snapshots__/MainTabs.js.snap
similarity index 100%
rename from __tests__/__snapshots__/MainTabs.js.snap
rename to src/containers/__tests__/__snapshots__/MainTabs.js.snap
diff --git a/__tests__/containers/__snapshots__/PersonSelectStepScreen.js.snap b/src/containers/__tests__/__snapshots__/PersonSelectStepScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/PersonSelectStepScreen.js.snap
rename to src/containers/__tests__/__snapshots__/PersonSelectStepScreen.js.snap
diff --git a/__tests__/containers/__snapshots__/PersonStageScreen.js.snap b/src/containers/__tests__/__snapshots__/PersonStageScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/PersonStageScreen.js.snap
rename to src/containers/__tests__/__snapshots__/PersonStageScreen.js.snap
diff --git a/__tests__/containers/__snapshots__/SelectMyStepScreen.js.snap b/src/containers/__tests__/__snapshots__/SelectMyStepScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/SelectMyStepScreen.js.snap
rename to src/containers/__tests__/__snapshots__/SelectMyStepScreen.js.snap
diff --git a/__tests__/containers/__snapshots__/SetupPersonScreen.js.snap b/src/containers/__tests__/__snapshots__/SetupPersonScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/SetupPersonScreen.js.snap
rename to src/containers/__tests__/__snapshots__/SetupPersonScreen.js.snap
diff --git a/__tests__/containers/__snapshots__/StageScreen.js.snap b/src/containers/__tests__/__snapshots__/StageScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/StageScreen.js.snap
rename to src/containers/__tests__/__snapshots__/StageScreen.js.snap
diff --git a/__tests__/containers/__snapshots__/StageSuccessScreen.js.snap b/src/containers/__tests__/__snapshots__/StageSuccessScreen.js.snap
similarity index 100%
rename from __tests__/containers/__snapshots__/StageSuccessScreen.js.snap
rename to src/containers/__tests__/__snapshots__/StageSuccessScreen.js.snap
diff --git a/__tests__/middleware/tracking.js b/src/middleware/__tests__/tracking.js
similarity index 87%
rename from __tests__/middleware/tracking.js
rename to src/middleware/__tests__/tracking.js
index 7cb6483712..415197a22b 100644
--- a/__tests__/middleware/tracking.js
+++ b/src/middleware/__tests__/tracking.js
@@ -6,14 +6,14 @@ import {
NAVIGATE_BACK,
NAVIGATE_FORWARD,
NAVIGATE_RESET,
-} from '../../src/constants';
-import tracking from '../../src/middleware/tracking';
-import { trackableScreens } from '../../src/AppRoutes';
-import { buildTrackingObj } from '../../src/utils/common';
-import { SEARCH_SCREEN } from '../../src/containers/SearchPeopleScreen';
-import { trackState } from '../../src/actions/analytics';
-
-jest.mock('../../src/actions/analytics');
+} from '../../constants';
+import tracking from '../tracking';
+import { trackableScreens } from '../../AppRoutes';
+import { buildTrackingObj } from '../../utils/common';
+import { SEARCH_SCREEN } from '../../containers/SearchPeopleScreen';
+import { trackState } from '../../actions/analytics';
+
+jest.mock('../../actions/analytics');
const mockStore = configureStore([tracking]);
let store;
diff --git a/__tests__/reducers/__snapshots__/impact.js.snap b/src/reducers/__tests__/__snapshots__/impact.js.snap
similarity index 100%
rename from __tests__/reducers/__snapshots__/impact.js.snap
rename to src/reducers/__tests__/__snapshots__/impact.js.snap
diff --git a/__tests__/reducers/__snapshots__/organizations.js.snap b/src/reducers/__tests__/__snapshots__/organizations.js.snap
similarity index 100%
rename from __tests__/reducers/__snapshots__/organizations.js.snap
rename to src/reducers/__tests__/__snapshots__/organizations.js.snap
diff --git a/__tests__/reducers/__snapshots__/people.js.snap b/src/reducers/__tests__/__snapshots__/people.js.snap
similarity index 100%
rename from __tests__/reducers/__snapshots__/people.js.snap
rename to src/reducers/__tests__/__snapshots__/people.js.snap
diff --git a/__tests__/reducers/analytics.js b/src/reducers/__tests__/analytics.js
similarity index 90%
rename from __tests__/reducers/analytics.js
rename to src/reducers/__tests__/analytics.js
index 87eeb2fbb6..3c766955bd 100644
--- a/__tests__/reducers/analytics.js
+++ b/src/reducers/__tests__/analytics.js
@@ -1,15 +1,15 @@
-import analyticsReducer from '../../src/reducers/analytics';
+import analyticsReducer from '../analytics';
import {
ANALYTICS,
ANALYTICS_CONTEXT_CHANGED,
LOGOUT,
NOT_LOGGED_IN,
-} from '../../src/constants';
-import { REQUESTS } from '../../src/actions/api';
+} from '../../constants';
+import { REQUESTS } from '../../actions/api';
const guid = '340ba6de-ff51-408c-ab54-9a512acb35ff';
-jest.mock('../../src/i18n', () => ({
+jest.mock('../../i18n', () => ({
language: 'fr-FR',
t: jest.fn(),
}));
diff --git a/__tests__/reducers/auth.js b/src/reducers/__tests__/auth.js
similarity index 92%
rename from __tests__/reducers/auth.js
rename to src/reducers/__tests__/auth.js
index 9f728deb7f..3cdb85f873 100644
--- a/__tests__/reducers/auth.js
+++ b/src/reducers/__tests__/auth.js
@@ -1,9 +1,9 @@
-import auth from '../../src/reducers/auth';
-import { REQUESTS } from '../../src/actions/api';
-import { UPDATE_STAGES, UPDATE_TOKEN } from '../../src/constants';
-import { userIsJean } from '../../src/utils/common';
+import auth from '../auth';
+import { REQUESTS } from '../../actions/api';
+import { UPDATE_STAGES, UPDATE_TOKEN } from '../../constants';
+import { userIsJean } from '../../utils/common';
-jest.mock('../../src/utils/common');
+jest.mock('../../utils/common');
const token = 'asdfasndfiosdc';
const personId = '123456';
diff --git a/__tests__/reducers/drawer.js b/src/reducers/__tests__/drawer.js
similarity index 85%
rename from __tests__/reducers/drawer.js
rename to src/reducers/__tests__/drawer.js
index 6ed81733af..67b9909a41 100644
--- a/__tests__/reducers/drawer.js
+++ b/src/reducers/__tests__/drawer.js
@@ -1,7 +1,7 @@
import { DrawerActions } from 'react-navigation';
-import drawer from '../../src/reducers/drawer';
-import { LOGOUT } from '../../src/constants';
+import drawer from '../drawer';
+import { LOGOUT } from '../../constants';
it('updates drawer to be open', () => {
const state = drawer(undefined, {
diff --git a/__tests__/reducers/groups.js b/src/reducers/__tests__/groups.js
similarity index 82%
rename from __tests__/reducers/groups.js
rename to src/reducers/__tests__/groups.js
index 116c6750d9..0c5e53da22 100644
--- a/__tests__/reducers/groups.js
+++ b/src/reducers/__tests__/groups.js
@@ -1,5 +1,5 @@
-import { REQUESTS } from '../../src/actions/api';
-import groups from '../../src/reducers/groups';
+import { REQUESTS } from '../../actions/api';
+import groups from '../groups';
it('loads my groups', () => {
const newGroups = [
diff --git a/__tests__/reducers/impact.js b/src/reducers/__tests__/impact.js
similarity index 92%
rename from __tests__/reducers/impact.js
rename to src/reducers/__tests__/impact.js
index f3be8e4b9e..c883d051a6 100644
--- a/__tests__/reducers/impact.js
+++ b/src/reducers/__tests__/impact.js
@@ -1,6 +1,6 @@
-import impact from '../../src/reducers/impact';
-import { REQUESTS } from '../../src/actions/api';
-import { UPDATE_PEOPLE_INTERACTION_REPORT } from '../../src/constants';
+import impact from '../impact';
+import { REQUESTS } from '../../actions/api';
+import { UPDATE_PEOPLE_INTERACTION_REPORT } from '../../constants';
it('should update person impact reports', () => {
const state = impact(undefined, {
diff --git a/__tests__/reducers/journey.js b/src/reducers/__tests__/journey.js
similarity index 93%
rename from __tests__/reducers/journey.js
rename to src/reducers/__tests__/journey.js
index be74d3db6e..0e3ab6e48d 100644
--- a/__tests__/reducers/journey.js
+++ b/src/reducers/__tests__/journey.js
@@ -1,5 +1,5 @@
-import { LOGOUT, UPDATE_JOURNEY_ITEMS } from '../../src/constants';
-import journeyReducer from '../../src/reducers/journey';
+import { LOGOUT, UPDATE_JOURNEY_ITEMS } from '../../constants';
+import journeyReducer from '../journey';
const initialState = {
personal: {},
diff --git a/__tests__/reducers/nav.js b/src/reducers/__tests__/nav.js
similarity index 75%
rename from __tests__/reducers/nav.js
rename to src/reducers/__tests__/nav.js
index 5d1e02eb26..3aadd9fda8 100644
--- a/__tests__/reducers/nav.js
+++ b/src/reducers/__tests__/nav.js
@@ -1,8 +1,8 @@
import { NavigationActions } from 'react-navigation';
-import nav from '../../src/reducers/nav';
-import { UNASSIGNED_PERSON_SCREEN } from '../../src/containers/Groups/UnassignedPersonScreen';
-import { LOGIN_SCREEN } from '../../src/containers/LoginScreen';
+import nav from '../nav';
+import { UNASSIGNED_PERSON_SCREEN } from '../../containers/Groups/UnassignedPersonScreen';
+import { LOGIN_SCREEN } from '../../containers/LoginScreen';
describe('navReducer', () => {
it('should get state for nav action', () => {
diff --git a/__tests__/reducers/notifications.js b/src/reducers/__tests__/notifications.js
similarity index 91%
rename from __tests__/reducers/notifications.js
rename to src/reducers/__tests__/notifications.js
index 195eaf2cd3..0604fb16a5 100644
--- a/__tests__/reducers/notifications.js
+++ b/src/reducers/__tests__/notifications.js
@@ -1,11 +1,11 @@
-import notifications from '../../src/reducers/notifications';
+import notifications from '../notifications';
import {
LOGOUT,
DISABLE_WELCOME_NOTIFICATION,
REQUEST_NOTIFICATIONS,
LOAD_HOME_NOTIFICATION_REMINDER,
-} from '../../src/constants';
-import { REQUESTS } from '../../src/actions/api';
+} from '../../constants';
+import { REQUESTS } from '../../actions/api';
it('should update push device', () => {
const pushDevice = { id: '9', token: 'some token' };
diff --git a/__tests__/reducers/organizations.js b/src/reducers/__tests__/organizations.js
similarity index 99%
rename from __tests__/reducers/organizations.js
rename to src/reducers/__tests__/organizations.js
index c0d31867fa..bda73c909a 100644
--- a/__tests__/reducers/organizations.js
+++ b/src/reducers/__tests__/organizations.js
@@ -1,12 +1,12 @@
-import organizations from '../../src/reducers/organizations';
-import { REQUESTS } from '../../src/actions/api';
+import organizations from '../organizations';
+import { REQUESTS } from '../../actions/api';
import {
LOAD_ORGANIZATIONS,
GET_ORGANIZATIONS_CONTACTS_REPORT,
GET_ORGANIZATION_SURVEYS,
GET_ORGANIZATION_MEMBERS,
DEFAULT_PAGE_LIMIT,
-} from '../../src/constants';
+} from '../../constants';
const org1Id = '123';
const org2Id = '234';
diff --git a/__tests__/reducers/people.js b/src/reducers/__tests__/people.js
similarity index 97%
rename from __tests__/reducers/people.js
rename to src/reducers/__tests__/people.js
index dcb49ecff8..ee8e309599 100644
--- a/__tests__/reducers/people.js
+++ b/src/reducers/__tests__/people.js
@@ -1,12 +1,12 @@
-import people from '../../src/reducers/people';
+import people from '../people';
import {
DELETE_PERSON,
LOAD_PERSON_DETAILS,
PEOPLE_WITH_ORG_SECTIONS,
UPDATE_PERSON_ATTRIBUTES,
GET_ORGANIZATION_PEOPLE,
-} from '../../src/constants';
-import { REQUESTS } from '../../src/actions/api';
+} from '../../constants';
+import { REQUESTS } from '../../actions/api';
const orgId = '100';
const orgs = {
diff --git a/__tests__/reducers/personProfile.js b/src/reducers/__tests__/personProfile.js
similarity index 94%
rename from __tests__/reducers/personProfile.js
rename to src/reducers/__tests__/personProfile.js
index 45a4de5e56..c297f182a3 100644
--- a/__tests__/reducers/personProfile.js
+++ b/src/reducers/__tests__/personProfile.js
@@ -1,5 +1,5 @@
-import personProfile from '../../src/reducers/personProfile';
-import { REQUESTS } from '../../src/actions/api';
+import personProfile from '../personProfile';
+import { REQUESTS } from '../../actions/api';
import {
PERSON_FIRST_NAME_CHANGED,
PERSON_LAST_NAME_CHANGED,
@@ -7,7 +7,7 @@ import {
RESET_ONBOARDING_PERSON,
LOGOUT,
COMPLETE_ONBOARDING,
-} from '../../src/constants';
+} from '../../constants';
const person = {
id: '1',
diff --git a/__tests__/reducers/profile.js b/src/reducers/__tests__/profile.js
similarity index 85%
rename from __tests__/reducers/profile.js
rename to src/reducers/__tests__/profile.js
index 9108d49489..58322c2ec8 100644
--- a/__tests__/reducers/profile.js
+++ b/src/reducers/__tests__/profile.js
@@ -1,5 +1,5 @@
-import profile from '../../src/reducers/profile';
-import { REQUESTS } from '../../src/actions/api';
+import profile from '../profile';
+import { REQUESTS } from '../../actions/api';
const testNameSaved = type => {
const firstName = 'Roger';
diff --git a/__tests__/reducers/steps.js b/src/reducers/__tests__/steps.js
similarity index 96%
rename from __tests__/reducers/steps.js
rename to src/reducers/__tests__/steps.js
index e2af7935a3..73ce8afe89 100644
--- a/__tests__/reducers/steps.js
+++ b/src/reducers/__tests__/steps.js
@@ -1,6 +1,6 @@
-import { REQUESTS } from '../../src/actions/api';
-import steps from '../../src/reducers/steps';
-import { COMPLETED_STEP_COUNT, TOGGLE_STEP_FOCUS } from '../../src/constants';
+import { REQUESTS } from '../../actions/api';
+import steps from '../steps';
+import { COMPLETED_STEP_COUNT, TOGGLE_STEP_FOCUS } from '../../constants';
it('loads step suggestions for me', () => {
const stageId = 5;
diff --git a/__tests__/reducers/swipe.js b/src/reducers/__tests__/swipe.js
similarity index 94%
rename from __tests__/reducers/swipe.js
rename to src/reducers/__tests__/swipe.js
index d80310cc3f..ae48e544d4 100644
--- a/__tests__/reducers/swipe.js
+++ b/src/reducers/__tests__/swipe.js
@@ -1,12 +1,12 @@
-import swipe from '../../src/reducers/swipe';
+import swipe from '../swipe';
import {
SWIPE_REMINDER_STEPS_HOME,
SWIPE_REMINDER_STEPS_CONTACT,
SWIPE_REMINDER_STEPS_REMINDER,
SWIPE_REMINDER_JOURNEY,
GROUP_ONBOARDING_CARD,
-} from '../../src/constants';
-import { GROUP_ONBOARDING_TYPES } from '../../src/containers/Groups/OnboardingCard';
+} from '../../constants';
+import { GROUP_ONBOARDING_TYPES } from '../../containers/Groups/OnboardingCard';
it('updates swipe steps home value', () => {
const state = swipe(
diff --git a/__tests__/selectors/__snapshots__/celebration.js.snap b/src/selectors/__tests__/__snapshots__/celebration.js.snap
similarity index 100%
rename from __tests__/selectors/__snapshots__/celebration.js.snap
rename to src/selectors/__tests__/__snapshots__/celebration.js.snap
diff --git a/__tests__/selectors/__snapshots__/challenges.js.snap b/src/selectors/__tests__/__snapshots__/challenges.js.snap
similarity index 100%
rename from __tests__/selectors/__snapshots__/challenges.js.snap
rename to src/selectors/__tests__/__snapshots__/challenges.js.snap
diff --git a/__tests__/selectors/__snapshots__/people.js.snap b/src/selectors/__tests__/__snapshots__/people.js.snap
similarity index 100%
rename from __tests__/selectors/__snapshots__/people.js.snap
rename to src/selectors/__tests__/__snapshots__/people.js.snap
diff --git a/__tests__/selectors/__snapshots__/steps.js.snap b/src/selectors/__tests__/__snapshots__/steps.js.snap
similarity index 100%
rename from __tests__/selectors/__snapshots__/steps.js.snap
rename to src/selectors/__tests__/__snapshots__/steps.js.snap
diff --git a/__tests__/selectors/celebration.js b/src/selectors/__tests__/celebration.js
similarity index 97%
rename from __tests__/selectors/celebration.js
rename to src/selectors/__tests__/celebration.js
index 556c211d88..d9b799187d 100644
--- a/__tests__/selectors/celebration.js
+++ b/src/selectors/__tests__/celebration.js
@@ -1,4 +1,4 @@
-import { celebrationSelector } from '../../src/selectors/celebration';
+import { celebrationSelector } from '../celebration';
const celebrateItems = [
{
diff --git a/__tests__/selectors/challenges.js b/src/selectors/__tests__/challenges.js
similarity index 95%
rename from __tests__/selectors/challenges.js
rename to src/selectors/__tests__/challenges.js
index f87539eadb..bb93b5cecb 100644
--- a/__tests__/selectors/challenges.js
+++ b/src/selectors/__tests__/challenges.js
@@ -1,6 +1,6 @@
import MockDate from 'mockdate';
-import { challengesSelector } from '../../src/selectors/challenges';
+import { challengesSelector } from '../challenges';
const organization = { id: '123' };
const mockDate = '2018-09-15';
diff --git a/__tests__/selectors/organizations.js b/src/selectors/__tests__/organizations.js
similarity index 91%
rename from __tests__/selectors/organizations.js
rename to src/selectors/__tests__/organizations.js
index a8c4eb5de7..9ee580d1c0 100644
--- a/__tests__/selectors/organizations.js
+++ b/src/selectors/__tests__/organizations.js
@@ -2,10 +2,10 @@ import {
organizationSelector,
allOrganizationsSelector,
communitiesSelector,
-} from '../../src/selectors/organizations';
-import { removeHiddenOrgs } from '../../src/selectors/selectorUtils';
+} from '../organizations';
+import { removeHiddenOrgs } from '../selectorUtils';
-jest.mock('../../src/selectors/selectorUtils');
+jest.mock('../../selectors/selectorUtils');
const orgOne = { id: '95', community: true };
const orgTwo = { id: '96', community: false };
diff --git a/__tests__/selectors/people.js b/src/selectors/__tests__/people.js
similarity index 97%
rename from __tests__/selectors/people.js
rename to src/selectors/__tests__/people.js
index 0cccc79a6b..1cc6733370 100644
--- a/__tests__/selectors/people.js
+++ b/src/selectors/__tests__/people.js
@@ -3,10 +3,10 @@ import {
personSelector,
contactAssignmentSelector,
orgPermissionSelector,
-} from '../../src/selectors/people';
-import { removeHiddenOrgs } from '../../src/selectors/selectorUtils';
+} from '../people';
+import { removeHiddenOrgs } from '../selectorUtils';
-jest.mock('../../src/selectors/selectorUtils', () => ({
+jest.mock('../../selectors/selectorUtils', () => ({
removeHiddenOrgs: jest.fn().mockImplementation(orgs => orgs),
}));
diff --git a/__tests__/selectors/selectorUtils.js b/src/selectors/__tests__/selectorUtils.js
similarity index 85%
rename from __tests__/selectors/selectorUtils.js
rename to src/selectors/__tests__/selectorUtils.js
index 5a33210732..54efdb73d3 100644
--- a/__tests__/selectors/selectorUtils.js
+++ b/src/selectors/__tests__/selectorUtils.js
@@ -1,4 +1,4 @@
-import { removeHiddenOrgs } from '../../src/selectors/selectorUtils';
+import { removeHiddenOrgs } from '../selectorUtils';
const org1 = { id: '1' };
const org2 = { id: '2' };
diff --git a/__tests__/selectors/steps.js b/src/selectors/__tests__/steps.js
similarity index 98%
rename from __tests__/selectors/steps.js
rename to src/selectors/__tests__/steps.js
index be589f029d..5cf94471b9 100644
--- a/__tests__/selectors/steps.js
+++ b/src/selectors/__tests__/steps.js
@@ -2,7 +2,7 @@ import {
reminderStepsSelector,
nonReminderStepsSelector,
hasReminderStepsSelector,
-} from '../../src/selectors/steps';
+} from '../steps';
const people = {
allByOrg: {
diff --git a/__tests__/utils/__snapshots__/filters.js.snap b/src/utils/__tests__/__snapshots__/filters.js.snap
similarity index 100%
rename from __tests__/utils/__snapshots__/filters.js.snap
rename to src/utils/__tests__/__snapshots__/filters.js.snap
diff --git a/__tests__/utils/common.js b/src/utils/__tests__/common.js
similarity index 86%
rename from __tests__/utils/common.js
rename to src/utils/__tests__/common.js
index c3ae7647e4..20a47ac6f5 100644
--- a/__tests__/utils/common.js
+++ b/src/utils/__tests__/common.js
@@ -2,7 +2,9 @@ import { DrawerActions } from 'react-navigation';
import {
userIsJean,
- communityIsCru,
+ orgIsPersonalMinistry,
+ orgIsUserCreated,
+ orgIsCru,
isMissionhubUser,
isAdminForOrg,
openMainMenu,
@@ -17,8 +19,8 @@ import {
getPersonPhoneNumber,
getPersonEmailAddress,
getStageIndex,
-} from '../../src/utils/common';
-import { MAIN_MENU_DRAWER, DEFAULT_PAGE_LIMIT } from '../../src/constants';
+} from '../common';
+import { MAIN_MENU_DRAWER, DEFAULT_PAGE_LIMIT } from '../../constants';
jest.mock('react-navigation', () => ({
DrawerActions: {
@@ -45,15 +47,52 @@ describe('userIsJean', () => {
});
});
-describe('communityIsCru', () => {
+describe('orgIsPersonalMinistry', () => {
+ it('returns true for empty org', () => {
+ expect(orgIsPersonalMinistry({})).toEqual(true);
+ });
+ it('returns true for personal ministry', () => {
+ expect(orgIsPersonalMinistry({ id: 'personal' })).toEqual(true);
+ });
+ it('returns false for user-created community', () => {
+ expect(orgIsPersonalMinistry({ id: '1', user_created: true })).toEqual(
+ false,
+ );
+ });
+ it('returns false for cru community', () => {
+ expect(orgIsPersonalMinistry({ id: '1', user_created: false })).toEqual(
+ false,
+ );
+ });
+});
+
+describe('orgIsUserCreated', () => {
+ it('returns false for empty org', () => {
+ expect(orgIsUserCreated({})).toEqual(false);
+ });
+ it('returns false for personal ministry', () => {
+ expect(orgIsUserCreated({ id: 'personal' })).toEqual(false);
+ });
+ it('returns true for user-created community', () => {
+ expect(orgIsUserCreated({ id: '1', user_created: true })).toEqual(true);
+ });
+ it('returns false for cru community', () => {
+ expect(orgIsUserCreated({ id: '1', user_created: false })).toEqual(false);
+ });
+});
+
+describe('orgIsCru', () => {
+ it('returns false for empty org', () => {
+ expect(orgIsCru({})).toEqual(false);
+ });
it('returns false for personal ministry', () => {
- expect(communityIsCru({ id: 'personal' })).toEqual(false);
+ expect(orgIsCru({ id: 'personal' })).toEqual(false);
});
it('returns false for user-created community', () => {
- expect(communityIsCru({ id: '1', user_created: true })).toEqual(false);
+ expect(orgIsCru({ id: '1', user_created: true })).toEqual(false);
});
it('returns true for cru community', () => {
- expect(communityIsCru({ id: '1', user_created: false })).toEqual(true);
+ expect(orgIsCru({ id: '1', user_created: false })).toEqual(true);
});
});
diff --git a/__tests__/utils/filters.js b/src/utils/__tests__/filters.js
similarity index 99%
rename from __tests__/utils/filters.js
rename to src/utils/__tests__/filters.js
index 6ea3929635..82a4dfadf4 100644
--- a/__tests__/utils/filters.js
+++ b/src/utils/__tests__/filters.js
@@ -3,7 +3,7 @@ import {
searchSelectFilter,
searchRemoveFilter,
getFilterOptions,
-} from '../../src/utils/filters';
+} from '../filters';
describe('getFilterOptions', () => {
const t = jest.fn(() => 'Title');
diff --git a/__tests__/utils/pagination.js b/src/utils/__tests__/pagination.js
similarity index 83%
rename from __tests__/utils/pagination.js
rename to src/utils/__tests__/pagination.js
index 114f360896..a7d98f6b08 100644
--- a/__tests__/utils/pagination.js
+++ b/src/utils/__tests__/pagination.js
@@ -1,5 +1,5 @@
-import { buildUpdatedPagination } from '../../src/utils/pagination';
-import { DEFAULT_PAGE_LIMIT } from '../../src/constants';
+import { buildUpdatedPagination } from '../pagination';
+import { DEFAULT_PAGE_LIMIT } from '../../constants';
describe('building pagination', () => {
it('should increment page by 1 and not have more', () => {
diff --git a/__tests__/utils/promptToAssign.js b/src/utils/__tests__/promptToAssign.js
similarity index 90%
rename from __tests__/utils/promptToAssign.js
rename to src/utils/__tests__/promptToAssign.js
index 39b7f0e52e..f9516ad22e 100644
--- a/__tests__/utils/promptToAssign.js
+++ b/src/utils/__tests__/promptToAssign.js
@@ -1,9 +1,9 @@
import { Alert } from 'react-native';
-import { promptToAssign } from '../../src/utils/promptToAssign';
-import i18n from '../../src/i18n';
+import { promptToAssign } from '../promptToAssign';
+import i18n from '../../i18n';
-jest.mock('../../src/i18n');
+jest.mock('../../i18n');
beforeEach(() => (i18n.t = jest.fn(string => string)));
diff --git a/src/utils/common.js b/src/utils/common.js
index adb05fa952..c60e9ff211 100644
--- a/src/utils/common.js
+++ b/src/utils/common.js
@@ -71,8 +71,11 @@ export const isAuthenticated = authState => authState.token;
export const userIsJean = orgPermissions =>
orgPermissions.some(p => !p.organization.user_created);
-export const communityIsCru = organization =>
- organization && organization.id !== 'personal' && !organization.user_created;
+export const orgIsPersonalMinistry = org =>
+ org && (!org.id || org.id === 'personal');
+export const orgIsUserCreated = org => !!(org && org.user_created);
+export const orgIsCru = org =>
+ org && !orgIsPersonalMinistry(org) && !orgIsUserCreated(org);
const MHUB_PERMISSIONS = [ORG_PERMISSIONS.ADMIN, ORG_PERMISSIONS.USER];
export const isMissionhubUser = orgPermission =>
diff --git a/yarn.lock b/yarn.lock
index 8d20c4634c..3e063e5421 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -7243,10 +7243,10 @@ react-native-fabric@^0.5.1:
resolved "https://registry.yarnpkg.com/react-native-fabric/-/react-native-fabric-0.5.1.tgz#e5eb65c56196355b41f230c14adcc9c4bcf60dda"
integrity sha512-NKYXiH8w/DjNXoozko1twjAd5F8shL/UiTVx/PQ8QNaasWpbxlXgeJ5exhDSIcDXao0AUdcPWJunYdSCjq208g==
-react-native-fbsdk@^0.7.0:
- version "0.7.0"
- resolved "https://registry.yarnpkg.com/react-native-fbsdk/-/react-native-fbsdk-0.7.0.tgz#263dfe5845205de7b80efb0f18ed5c1ded025291"
- integrity sha512-wM+S+NGaqn437H6IYebLhBy2612aIXNPPxunvN5SdJVIIQZdGhkdDZUDbZmgmFnMRY3wQpQatzp+vRjEmAcEmg==
+react-native-fbsdk@^0.8.0:
+ version "0.8.0"
+ resolved "https://registry.yarnpkg.com/react-native-fbsdk/-/react-native-fbsdk-0.8.0.tgz#4ee95ebb7be4b00fa9f871ca594f068c9782c7de"
+ integrity sha512-odqSTgvXtw9f84iU0THTjK+Z9Lvy14aP5Yd0fdfHCXFpb/Q0WrpwsSyjPFXG1AsWIe+FtpzzgJsjOu6E2xqgMQ==
dependencies:
adm-zip "^0.4.7"
fastfall "^1.5.1"