Skip to content

Commit

Permalink
give test more meaningful name
Browse files Browse the repository at this point in the history
  • Loading branch information
tjsilver committed Nov 19, 2019
1 parent 72061d8 commit 06b30ec
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions support-frontend/assets/helpers/abTests/abtestDefinitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
export type LandingPageCopyReturningSinglesTestVariants = 'control' | 'returningSingle' | 'notintest';
export type LandingPageStripeElementsRecurringTestVariants = 'control' | 'stripeElements' | 'notintest';
export type RecurringStripePaymentRequestButtonTestVariants = 'control' | 'paymentRequestButton' | 'notintest';
export type PaymentSecurityDesignTest1BVariants = 'control' | 'V1_securemiddlegrey' | 'notintest';
export type paymentSecuritySecureTransactionGreyNonUKVariants = 'control' | 'V1_securetransactiongrey' | 'notintest';

const contributionsLandingPageMatch = '/(uk|us|eu|au|ca|nz|int)/contribute(/.*)?$';

Expand Down Expand Up @@ -83,14 +83,14 @@ export const tests: Tests = {
targetPage: contributionsLandingPageMatch,
},

paymentSecurityDesignTest1B: {
paymentSecuritySecureTransactionGreyNonUK: {
type: 'OTHER',
variants: [
{
id: 'control',
},
{
id: 'V1_securemiddlegrey',
id: 'V1_securetransactiongrey',
},
],
audiences: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import type { PaymentMethod } from 'helpers/paymentMethods';
import { DirectDebit, Stripe, ExistingCard, ExistingDirectDebit } from 'helpers/paymentMethods';
import { getCampaignName } from 'helpers/campaigns';
import type { LandingPageStripeElementsRecurringTestVariants } from 'helpers/abTests/abtestDefinitions';
import type { PaymentSecurityDesignTest1BVariants, RecurringStripePaymentRequestButtonTestVariants } from 'helpers/abTests/abtestDefinitions';
import type { paymentSecuritySecureTransactionGreyNonUKVariants, RecurringStripePaymentRequestButtonTestVariants } from 'helpers/abTests/abtestDefinitions';


// ----- Types ----- //
Expand Down Expand Up @@ -85,7 +85,7 @@ type PropTypes = {|
country: IsoCountry,
createStripePaymentMethod: () => void,
stripeElementsRecurringTestVariant: LandingPageStripeElementsRecurringTestVariants,
paymentSecurityDesignTest1BVariant: PaymentSecurityDesignTest1BVariants,
paymentSecuritySecureTransactionGreyNonUKVariant: paymentSecuritySecureTransactionGreyNonUKVariants,
recurringStripePaymentRequestButtonTestVariant: RecurringStripePaymentRequestButtonTestVariants,
|};

Expand Down Expand Up @@ -118,7 +118,7 @@ const mapStateToProps = (state: State) => ({
country: state.common.internationalisation.countryId,
stripeV3HasLoaded: state.page.form.stripeV3HasLoaded,
stripeElementsRecurringTestVariant: state.common.abParticipations.stripeElementsRecurring,
paymentSecurityDesignTest1BVariant: state.common.abParticipations.paymentSecurityDesignTest1B,
paymentSecuritySecureTransactionGreyNonUKVariant: state.common.abParticipations.paymentSecuritySecureTransactionGreyNonUK,
recurringStripePaymentRequestButtonTestVariant: state.common.abParticipations.recurringStripePaymentRequestButton,
});

Expand Down Expand Up @@ -247,7 +247,7 @@ function withProps(props: PropTypes) {

const classModifiers = ['contribution', 'with-labels'];

const showSecureStripeContainer: boolean = props.paymentSecurityDesignTest1BVariant !== 'control' || props.countryGroupId === 'GBPCountries';
const showSecureStripeContainer: boolean = props.paymentSecuritySecureTransactionGreyNonUKVariant !== 'control' || props.countryGroupId === 'GBPCountries';
const showSecureButtonBg: boolean = showSecureStripeContainer && props.paymentMethod === Stripe && (props.stripeElementsRecurringTestVariant === 'stripeElements' || props.contributionType === 'ONE_OFF');

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import {
subscriptionToExplainerPart,
} from '../../../helpers/existingPaymentMethods/existingPaymentMethods';
import SecureTransactionIndicator from 'components/secureTransactionIndicator/secureTransactionIndicator';
import type { PaymentSecurityDesignTest1BVariants } from 'helpers/abTests/abtestDefinitions';
import type { paymentSecuritySecureTransactionGreyNonUKVariants } from 'helpers/abTests/abtestDefinitions';
import {
type CountryGroupId,
detect,
Expand All @@ -62,7 +62,7 @@ type PropTypes = {|
updateSelectedExistingPaymentMethod: (RecentlySignedInExistingPaymentMethod | typeof undefined) => Action,
isTestUser: boolean,
switches: Switches,
paymentSecurityDesignTest1BVariant: PaymentSecurityDesignTest1BVariants,
paymentSecuritySecureTransactionGreyNonUKVariant: paymentSecuritySecureTransactionGreyNonUKVariants,
|};
/* eslint-enable react/no-unused-prop-types */

Expand All @@ -75,7 +75,7 @@ const mapStateToProps = (state: State) => ({
existingPaymentMethod: state.page.form.existingPaymentMethod,
isTestUser: state.page.user.isTestUser || false,
switches: state.common.settings.switches,
paymentSecurityDesignTest1BVariant: state.common.abParticipations.paymentSecurityDesignTest1B,
paymentSecuritySecureTransactionGreyNonUKVariant: state.common.abParticipations.paymentSecuritySecureTransactionGreyNonUK,
});

const mapDispatchToProps = {
Expand Down Expand Up @@ -121,7 +121,7 @@ function withProps(props: PropTypes) {
<legend id="payment_method" className="form__legend"><h3>Payment method</h3></legend>
);

const legend = props.paymentSecurityDesignTest1BVariant === 'V1_securemiddlegrey' && countryGroupId !== 'GBPCountries' ?
const legend = props.paymentSecuritySecureTransactionGreyNonUKVariant === 'V1_securetransactiongrey' && countryGroupId !== 'GBPCountries' ?
(
<div className="secure-transaction">
{legendSimple} <SecureTransactionIndicator modifierClasses={['middle', 'showaftermobile']} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const backgroundImageSrc = campaignName && campaigns[campaignName] && campaigns[
const showSecureTransactionIndicator = () => {
if (countryGroupId === 'GBPCountries') {
return <SecureTransactionIndicator modifierClasses={['top']} />;
} else if (store.getState().common.abParticipations.paymentSecurityDesignTest1B === 'V1_securemiddlegrey') {
} else if (store.getState().common.abParticipations.paymentSecuritySecureTransactionGreyNonUK === 'V1_securetransactiongrey') {
return <SecureTransactionIndicator modifierClasses={['top', 'hideaftermobile']} />;
}
return null;
Expand Down

0 comments on commit 06b30ec

Please sign in to comment.