Skip to content

Commit

Permalink
Remove venmoAppLabel experiment (#2231)
Browse files Browse the repository at this point in the history
  • Loading branch information
jshawl authored Sep 6, 2023
1 parent 9227d40 commit c27574e
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 59 deletions.
5 changes: 1 addition & 4 deletions src/funding/venmo/config.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { PLATFORM } from "@paypal/sdk-constants/src";
import { BUTTON_COLOR, BUTTON_LAYOUT } from "../../constants";
import { DEFAULT_FUNDING_CONFIG, type FundingSourceConfig } from "../common";

import { WalletLabel, Label, AppLabel } from "./template";
import { WalletLabel, Label } from "./template";

export function getVenmoConfig(): FundingSourceConfig {
return {
Expand Down Expand Up @@ -55,9 +55,6 @@ export function getVenmoConfig(): FundingSourceConfig {
},

Label: ({ ...props }) => {
if (props.experiment && props.experiment.enableVenmoAppLabel) {
return AppLabel(props);
}
return Label(props);
},

Expand Down
17 changes: 0 additions & 17 deletions src/funding/venmo/template.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,6 @@ import { Text, Space } from "../../ui/text";

import css from "./style.scoped.scss";

export function AppLabel(opts: LabelOptions): ChildType {
const { logoColor } = opts;

const AppLogo: ChildType = (
<Style css={css}>
{__WEB__ ? (
<VenmoLogoExternalImage logoColor={logoColor} />
) : (
<VenmoLogoInlineSVG logoColor={logoColor} />
)}
<Text className={["app-label"]}>App</Text>
</Style>
);

return <BasicLabel {...opts} logo={AppLogo} />;
}

export function Label(opts: LabelOptions): ChildType {
return <BasicLabel {...opts} />;
}
Expand Down
1 change: 0 additions & 1 deletion src/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ export type ContentType = {|
export type Experiment = {|
enableVenmo?: boolean,
disablePaylater?: boolean,
enableVenmoAppLabel?: boolean,
venmoWebEnabled?: boolean,
|};

Expand Down
20 changes: 1 addition & 19 deletions src/zoid/buttons/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,17 @@ import {
isDevice,
isTablet,
getElement,
isLocalStorageEnabled,
isStandAlone,
once,
} from "@krakenjs/belter/src";
import { ENV, FUNDING } from "@paypal/sdk-constants/src";
import { FUNDING } from "@paypal/sdk-constants/src";
import {
getEnableFunding,
getLogger,
createExperiment,
getFundingEligibility,
getPlatform,
getComponents,
getEnv,
} from "@paypal/sdk-client/src";
import { getRefinedFundingEligibility } from "@paypal/funding-components/src";

Expand Down Expand Up @@ -175,21 +173,6 @@ export function getVenmoExperiment(): EligibilityExperiment {
}
}

export function getVenmoAppLabelExperiment(): EligibilityExperiment {
const isEnvForTest =
getEnv() === ENV.LOCAL || getEnv() === ENV.TEST || getEnv() === ENV.STAGE;

let isEnabledForTest = false;

if (isLocalStorageEnabled() && isEnvForTest) {
isEnabledForTest = window.localStorage.getItem("enable_venmo_app_label");
}

return {
enableVenmoAppLabel: isEnabledForTest,
};
}

export function getRenderedButtons(
props: ButtonProps
): $ReadOnlyArray<$Values<typeof FUNDING>> {
Expand Down Expand Up @@ -322,7 +305,6 @@ export function applePaySession(): ?ApplePaySessionConfigRequest {
export function getButtonExperiments(): EligibilityExperiment {
return {
...getVenmoExperiment(),
...getVenmoAppLabelExperiment(),
};
}

Expand Down
20 changes: 2 additions & 18 deletions test/integration/tests/button/eligibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe("venmo button eligibility", () => {
test: {
onRender: expect("onRender", ({ xprops, fundingSources }) => {
const {
experiment: { enableVenmo, enableVenmoAppLabel, venmoWebEnabled },
experiment: { enableVenmo, venmoWebEnabled },
} = xprops;
if (!enableVenmo) {
throw new Error(
Expand All @@ -60,14 +60,6 @@ describe("venmo button eligibility", () => {
);
}

if (enableVenmoAppLabel) {
throw new Error(
`Expected enableVenmoAppLabel experiment to not be eligible: ${JSON.stringify(
xprops.experiment
)}`
);
}

if (!fundingSources.includes(FUNDING.VENMO)) {
throw new Error(
`Venmo is missing from the list of funding sources: ${fundingSources}`
Expand Down Expand Up @@ -102,7 +94,7 @@ describe("venmo button eligibility", () => {
test: {
onRender: expect("onRender", ({ xprops, fundingSources }) => {
const {
experiment: { enableVenmo, enableVenmoAppLabel },
experiment: { enableVenmo },
} = xprops;
if (!enableVenmo) {
throw new Error(
Expand All @@ -112,14 +104,6 @@ describe("venmo button eligibility", () => {
);
}

if (!enableVenmoAppLabel) {
throw new Error(
`Expected enableVenmoAppLabel experiment to be eligible: ${JSON.stringify(
xprops.experiment
)}`
);
}

if (!fundingSources.includes(FUNDING.VENMO)) {
throw new Error(
`Venmo is missing from the list of funding sources: ${fundingSources}`
Expand Down

0 comments on commit c27574e

Please sign in to comment.