Skip to content

Commit

Permalink
Undo unnecessary mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
ospfranco committed Oct 19, 2023
1 parent e74a276 commit f8e8a4f
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 270 deletions.
307 changes: 80 additions & 227 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "1.3.84-1",
"version": "1.3.86-1",
"author": "Expensify, Inc.",
"homepage": "https://new.expensify.com",
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
Expand Down Expand Up @@ -90,15 +90,14 @@
"@types/node": "^18.14.0",
"@ua/react-native-airship": "^15.2.6",
"awesome-phonenumber": "^5.4.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"babel-polyfill": "^6.26.0",
"canvas-size": "^1.2.6",
"core-js": "^3.32.0",
"date-fns": "^2.30.0",
"date-fns-tz": "^2.0.0",
"dom-serializer": "^0.2.2",
"domhandler": "^4.3.0",
"expensify-common": "git+ssh://git@github.com/Expensify/expensify-common.git#009c2ab79bf7ddeab0eea7a3a4c0d9cc4277c34b",
"expensify-common": "git+ssh://git@github.com/Expensify/expensify-common.git#bdbdf44825658500ba581d3e86237d7b8996cc2e",
"fbjs": "^3.0.2",
"htmlparser2": "^7.2.0",
"idb-keyval": "^6.2.1",
Expand Down Expand Up @@ -185,8 +184,6 @@
"@babel/runtime": "^7.20.0",
"@electron/notarize": "^1.2.3",
"@jest/globals": "^29.5.0",
"@kie/act-js": "^2.0.1",
"@kie/mock-github": "^1.0.0",
"@octokit/core": "4.0.4",
"@octokit/plugin-paginate-rest": "3.1.0",
"@octokit/plugin-throttling": "4.1.0",
Expand Down Expand Up @@ -269,7 +266,7 @@
"react-native-performance-flipper-reporter": "^2.0.0",
"react-native-svg-transformer": "^1.0.0",
"react-test-renderer": "18.2.0",
"reassure": "^0.9.0",
"reassure": "^0.10.1",
"setimmediate": "^1.0.5",
"shellcheck": "^1.1.0",
"style-loader": "^2.0.0",
Expand Down
6 changes: 0 additions & 6 deletions src/libs/E2E/API.mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import mockSigninUser from './apiMocks/signinUser';
import mockAuthenticatePusher from './apiMocks/authenticatePusher';
import mockOpenApp from './apiMocks/openApp';
import mockOpenReport from './apiMocks/openReport';
import mockSignInAttemptState from './apiMocks/signInAttemptState';

/**
* A dictionary which has the name of a API command as key, and a function which
Expand All @@ -23,15 +22,10 @@ const mocks = {
ReconnectApp: mockOpenApp,
OpenReport: mockOpenReport,
AuthenticatePusher: mockAuthenticatePusher,
SignInAttemptState: mockSignInAttemptState,
};

function mockCall(command, apiCommandParameters, tag) {
const mockResponse = mocks[command] && mocks[command](apiCommandParameters);
Log.warn('🫐🫐🫐🫐🫐🫐🫐🫐🫐🫐🫐🫐🫐🫐🫐🫐');
Log.warn('🫐🫐🫐🫐🫐🫐🫐🫐🫐🫐🫐🫐🫐🫐🫐🫐');
Log.warn(`Mock Call to ${command}`);
Log.warn('🫐🫐🫐🫐🫐🫐🫐🫐🫐🫐🫐🫐🫐🫐🫐🫐');
if (!mockResponse || !_.isArray(mockResponse.onyxData)) {
Log.warn(`[${tag}] for command ${command} is not mocked yet!`);
return;
Expand Down
1 change: 0 additions & 1 deletion src/libs/E2E/apiMocks/beginSignin.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export default ({email}) => ({
key: 'account',
value: {
validated: true,
hasEmailDeliveryFailure: false,
},
},
{
Expand Down
21 changes: 0 additions & 21 deletions src/libs/E2E/apiMocks/signInAttemptState.js

This file was deleted.

1 change: 0 additions & 1 deletion src/libs/E2E/apiMocks/signinUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ export default ({email}) => ({
key: 'account',
value: {
requiresTwoFactorAuth: false,
hasEmailDeliveryFailure: false,
},
},
],
Expand Down
4 changes: 0 additions & 4 deletions src/pages/signin/SignInPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,7 @@ function getRenderOptions({hasLogin, hasValidateCode, account, isPrimaryLogin, i
}

const shouldShowLoginForm = isClientTheLeader && !hasLogin && !hasValidateCode;
console.warn('🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏');
console.warn('🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏');
console.warn('🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏🍏');
const shouldShowEmailDeliveryFailurePage = hasLogin && hasEmailDeliveryFailure && !shouldShowChooseSSOOrMagicCode && !shouldInitiateSAMLLogin;
console.warn({shouldShowEmailDeliveryFailurePage, hasLogin, hasEmailDeliveryFailure});
const isUnvalidatedSecondaryLogin = hasLogin && !isPrimaryLogin && !account.validated && !hasEmailDeliveryFailure;
const shouldShowValidateCodeForm =
hasAccount && (hasLogin || hasValidateCode) && !isUnvalidatedSecondaryLogin && !hasEmailDeliveryFailure && !shouldShowChooseSSOOrMagicCode && !isSAMLRequired;
Expand Down
8 changes: 4 additions & 4 deletions tests/e2e/utils/execAsync.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const {exec} = require('child_process');
const _ = require('underscore');
// const _ = require('underscore');
const Logger = require('./logger');

/**
Expand All @@ -17,9 +17,9 @@ module.exports = (command, env = {}) => {
...env,
};

if (_.keys(env).length !== 0) {
Logger.log(`environment variables:`, JSON.stringify(finalEnv, null, 2));
}
// if (_.keys(env).length !== 0) {
// Logger.log(`environment variables:`, JSON.stringify(finalEnv, null, 2));
// }

Logger.important(command);

Expand Down

0 comments on commit f8e8a4f

Please sign in to comment.