mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-18 02:21:47 -05:00
Fixed various linting issues
- these changes were needed ahead of the upcoming bump to react-scripts, which bumps eslint to v8, and therefore we can update eslint-plugin-ghost, which introduces some new linting rules
This commit is contained in:
parent
264e6d41a7
commit
8daa06a3b8
6 changed files with 17 additions and 7 deletions
ghost/portal/src
components/pages
tests
utils
|
@ -402,7 +402,7 @@ export default class AccountPlanPage extends React.Component {
|
|||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
onCancelSubscription({subscriptionId, cancelAtPeriodEnd}) {
|
||||
const {member} = this.context;
|
||||
|
|
|
@ -336,7 +336,7 @@ class SignupPage extends React.Component {
|
|||
};
|
||||
});
|
||||
}, 5);
|
||||
}
|
||||
};
|
||||
|
||||
onKeyDown(e) {
|
||||
// Handles submit on Enter press
|
||||
|
|
|
@ -678,7 +678,9 @@ describe('Signup', () => {
|
|||
});
|
||||
|
||||
// added fake timeout for react state delay in setting plan
|
||||
await new Promise(r => setTimeout(r, 10));
|
||||
await new Promise((r) => {
|
||||
setTimeout(r, 10);
|
||||
});
|
||||
fireEvent.click(chooseBtns[1]);
|
||||
await waitFor(() => expect(ghostApi.member.checkoutPlan).toHaveBeenCalledTimes(1));
|
||||
});
|
||||
|
|
|
@ -205,7 +205,9 @@ describe('Logged-in free member', () => {
|
|||
const monthlyPlanContainer = await within(popupIframeDocument).findByText('Monthly');
|
||||
fireEvent.click(monthlyPlanContainer);
|
||||
// added fake timeout for react state delay in setting plan
|
||||
await new Promise(r => setTimeout(r, 10));
|
||||
await new Promise((r) => {
|
||||
setTimeout(r, 10);
|
||||
});
|
||||
|
||||
const submitButton = within(popupIframeDocument).queryByRole('button', {name: 'Continue'});
|
||||
|
||||
|
@ -242,7 +244,9 @@ describe('Logged-in free member', () => {
|
|||
const yearlyPlanContainer = await within(popupIframeDocument).findByText('Yearly');
|
||||
fireEvent.click(yearlyPlanContainer);
|
||||
// added fake timeout for react state delay in setting plan
|
||||
await new Promise(r => setTimeout(r, 10));
|
||||
await new Promise((r) => {
|
||||
setTimeout(r, 10);
|
||||
});
|
||||
|
||||
const submitButton = within(popupIframeDocument).queryByRole('button', {name: 'Continue'});
|
||||
|
||||
|
@ -364,7 +368,9 @@ describe('Logged-in free member', () => {
|
|||
await within(popupIframeDocument).findByText('Monthly');
|
||||
|
||||
// allow default checkbox switch to yearly
|
||||
await new Promise(r => setTimeout(r, 10));
|
||||
await new Promise((r) => {
|
||||
setTimeout(r, 10);
|
||||
});
|
||||
|
||||
const chooseBtns = within(popupIframeDocument).queryAllByRole('button', {name: 'Choose'});
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
/* eslint-disable camelcase */
|
||||
|
||||
export const sites = {
|
||||
singleProduct: getSiteData({
|
||||
products: getProductsData({numOfProducts: 1})
|
||||
|
|
|
@ -649,7 +649,7 @@ export const getSupportAddress = ({site}) => {
|
|||
}
|
||||
|
||||
if (supportAddress?.split('@')?.length > 1) {
|
||||
const [recipient, domain] = supportAddress?.split('@');
|
||||
const [recipient, domain] = supportAddress.split('@');
|
||||
const updatedDomain = domain?.replace(/^(www)\.(?=[^/]*\..{2,5})/, '') || '';
|
||||
return `${recipient}@${updatedDomain}`;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue