Skip to content

Commit

Permalink
Merge pull request #785 from Financial-Times/chore--update-deps-feb-24
Browse files Browse the repository at this point in the history
chore: update deps and fix ESlint issues
  • Loading branch information
JuanTincho committed Feb 9, 2024
2 parents 321a6a0 + b82d55c commit c7bf91f
Show file tree
Hide file tree
Showing 35 changed files with 8,716 additions and 8,608 deletions.
4 changes: 1 addition & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# CONFIG GENERATED BY DOTCOM-TOOL-KIT, DO NOT EDIT BY HAND
version: 2.1
orbs:
tool-kit: financial-times/dotcom-tool-kit@4
tool-kit: financial-times/dotcom-tool-kit@5
executors:
node:
docker:
Expand Down Expand Up @@ -31,8 +31,6 @@ workflows:
filters:
branches:
only: /(^renovate-.*|^nori/.*)/
tags:
only: /^v\d+\.\d+\.\d+(-.+)?/
- tool-kit/setup:
name: tool-kit/setup-<< matrix.executor >>
requires:
Expand Down
10 changes: 6 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
module.exports = {
extends: [
"@financial-times/eslint-config-next",
"plugin:prettier/recommended",
"plugin:storybook/recommended"
"@financial-times/eslint-config-next",
"plugin:prettier/recommended",
"plugin:storybook/recommended",
"plugin:jest/recommended",
"plugin:jest/style"
],
rules: {
'prettier/prettier': 'error',
},
plugins: ['prettier'],
plugins: ['prettier','jest'],
};
6 changes: 3 additions & 3 deletions components/accept-terms-subscription.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ describe('AcceptTermsSubscription', () => {
const transitionTerms2 = component.find('.terms-transition').at(1);
const transitionTerms3 = component.find('.terms-transition').at(2);

expect(transitionTerms1.text()).toEqual(
expect(transitionTerms1.text()).toBe(
'I give consent for the chosen payment method to be charged automatically.'
);
expect(transitionTerms2.text()).toEqual(
expect(transitionTerms2.text()).toBe(
'By placing your order subject to the Terms & Conditions (save for section 2) referred to below, you are waiving your statutory right to cancel our contract within 14 days of payment. Your payment is a one-time payment collected at the time of checkout, and unsubscribing or cancelling at any point (whether before or after the 14-day period) will not entitle you to a refund.'
);
expect(transitionTerms3.text()).toEqual(
expect(transitionTerms3.text()).toBe(
'Please see here for the complete Terms & Conditions.'
);
});
Expand Down
6 changes: 2 additions & 4 deletions components/company-name.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,15 @@ describe('CompanyName', () => {

const component = mount(CompanyName(props));

expect(component.find('.o-forms-title__main').text()).toEqual(
'Company name'
);
expect(component.find('.o-forms-title__main').text()).toBe('Company name');
});

it('renders with custom label wording', () => {
const props = { fieldLabel: 'Organisation name' };

const component = mount(CompanyName(props));

expect(component.find('.o-forms-title__main').text()).toEqual(
expect(component.find('.o-forms-title__main').text()).toBe(
'Organisation name'
);
});
Expand Down
12 changes: 6 additions & 6 deletions components/delivery-security-instructions.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('DeliverySecurityInstructions', () => {
wrapper = shallow(<DeliverySecurityInstructions />);
});

test('contains textAreaProps id set to default: deliverySecurityInstructionsField ', () => {
test('contains textAreaProps id set to default: deliverySecurityInstructionsField', () => {
expect(wrapper.prop('id')).toBe('deliverySecurityInstructionsField');
});

Expand Down Expand Up @@ -55,11 +55,11 @@ describe('DeliverySecurityInstructions', () => {
});

it('does not set maxLength when no value is given', () => {
expect(textAreaProps.maxLength).toBeUndefined;
expect(textAreaProps.maxLength).toBeUndefined();
});

it('does not set rows when no value is given', () => {
expect(textAreaProps.rows).toBeUndefined;
expect(textAreaProps.rows).toBeUndefined();
});

it('sets data-trackable to field-deliverySecurityInstructions', () => {
Expand All @@ -75,11 +75,11 @@ describe('DeliverySecurityInstructions', () => {
});

it('sets disabled to false', () => {
expect(textAreaProps.disabled).toBeFalse;
expect(textAreaProps.disabled).toBe(false);
});

it('does not set value when no value is given', () => {
expect(textAreaProps.defaultValue).toBeUndefined;
expect(textAreaProps.defaultValue).toBe('');
});
});

Expand Down Expand Up @@ -117,7 +117,7 @@ describe('DeliverySecurityInstructions', () => {
});

it('sets disabled to true', () => {
expect(textAreaProps.disabled).toBeTrue;
expect(textAreaProps.disabled).toBe(true);
});

it('sets value', () => {
Expand Down
4 changes: 2 additions & 2 deletions components/graduation-date.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ describe('GraduationDate', () => {
const wrapper = shallow(<GraduationDate value="2020-08-28" />);

it('sets the default month', () => {
expect(wrapper.find('#graduationDateMonth').prop('defaultValue')).toEqual(
expect(wrapper.find('#graduationDateMonth').prop('defaultValue')).toBe(
'08'
);
});

it('sets the default year', () => {
expect(wrapper.find('#graduationDateYear').prop('defaultValue')).toEqual(
expect(wrapper.find('#graduationDateYear').prop('defaultValue')).toBe(
'2020'
);
});
Expand Down
8 changes: 4 additions & 4 deletions components/industry.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ describe('Industry', () => {

const component = mount(Industry(props));

expect(component.find('.o-forms-title__main').text()).toEqual(
expect(component.find('.o-forms-title__main').text()).toBe(
'In which industry do you work?'
);
});
Expand All @@ -81,15 +81,15 @@ describe('Industry', () => {

const component = mount(Industry(props));

expect(component.find('.o-forms-title__main').text()).toEqual('Industry');
expect(component.find('.o-forms-title__main').text()).toBe('Industry');
});

it('renders with optional title class, when not required', () => {
const props = { isRequired: false };
const component = mount(Industry(props));

expect(
component.find('.o-forms-title.o-forms-field--optional').length
).toEqual(1);
component.find('.o-forms-title.o-forms-field--optional')
).toHaveLength(1);
});
});
4 changes: 2 additions & 2 deletions components/job-title.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('JobTitle', () => {
const component = mount(JobTitle(props));

expect(
component.find('.o-forms-title.o-forms-field--optional').length
).toEqual(1);
component.find('.o-forms-title.o-forms-field--optional')
).toHaveLength(1);
});
});
4 changes: 2 additions & 2 deletions components/payment-term.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ describe('PaymentTerm', () => {
},
];
const wrapper = shallow(<PaymentTerm options={options} />);
expect(wrapper.find('input').prop('data-base-amount')).toEqual(100);
expect(wrapper.find('input').prop('data-base-amount')).toBe(100);
});

it('renders option.trialAmount as data-base-amount if isTrial is true', () => {
Expand All @@ -347,7 +347,7 @@ describe('PaymentTerm', () => {
},
];
const wrapper = shallow(<PaymentTerm options={options} />);
expect(wrapper.find('input').prop('data-base-amount')).toEqual(1);
expect(wrapper.find('input').prop('data-base-amount')).toBe(1);
});
});

Expand Down
10 changes: 4 additions & 6 deletions components/personal-title.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,25 +71,23 @@ describe('PersonalTitle', () => {

const component = mount(PersonalTitle(props));

expect(component.find('.o-forms-title__main').text()).toEqual('Title');
expect(component.find('.o-forms-title__main').text()).toBe('Title');
});

it('renders with custom label wording', () => {
const props = { fieldLabel: 'PersonalTitle' };

const component = mount(PersonalTitle(props));

expect(component.find('.o-forms-title__main').text()).toEqual(
'PersonalTitle'
);
expect(component.find('.o-forms-title__main').text()).toBe('PersonalTitle');
});

it('renders with optional title class, when not required', () => {
const props = { isRequired: false };
const component = mount(PersonalTitle(props));

expect(
component.find('.o-forms-title.o-forms-field--optional').length
).toEqual(1);
component.find('.o-forms-title.o-forms-field--optional')
).toHaveLength(1);
});
});
4 changes: 2 additions & 2 deletions components/phone.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('Phone', () => {
const component = mount(Phone(props));

expect(
component.find('.o-forms-title.o-forms-field--optional').length
).toEqual(1);
component.find('.o-forms-title.o-forms-field--optional')
).toHaveLength(1);
});
});
4 changes: 2 additions & 2 deletions components/position.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('Position', () => {
const component = mount(Position(props));

expect(
component.find('.o-forms-title.o-forms-field--optional').length
).toEqual(1);
component.find('.o-forms-title.o-forms-field--optional')
).toHaveLength(1);
});
});
4 changes: 2 additions & 2 deletions components/responsibility.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ describe('Responsibility', () => {
const component = mount(Responsibility(props));

expect(
component.find('.o-forms-title.o-forms-field--optional').length
).toEqual(1);
component.find('.o-forms-title.o-forms-field--optional')
).toHaveLength(1);
});
});
10 changes: 5 additions & 5 deletions components/text-input.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('Text Input', () => {
const errorMsg = component.find('.o-forms-input__error');

expect(element.exists()).toBe(true);
expect(errorMsg.text()).toEqual('Invalid value');
expect(errorMsg.text()).toBe('Invalid value');
});

it('renders a field with custom input id', () => {
Expand Down Expand Up @@ -59,7 +59,7 @@ describe('Text Input', () => {
const component = mount(TextInput(props));
const element = component.find('input');

expect(element.prop('defaultValue')).toEqual('foobar');
expect(element.prop('defaultValue')).toBe('foobar');
});

it('renders with disabled input', () => {
Expand All @@ -77,7 +77,7 @@ describe('Text Input', () => {
const component = mount(TextInput(props));
const label = component.find('.o-forms-title__main');

expect(label.text()).toEqual('');
expect(label.text()).toBe('');
});

it('renders with custom label wording', () => {
Expand All @@ -86,7 +86,7 @@ describe('Text Input', () => {
const component = mount(TextInput(props));
const label = component.find('.o-forms-title__main');

expect(label.text()).toEqual('Code');
expect(label.text()).toBe('Code');
});

it('renders with custom description wording', () => {
Expand All @@ -95,7 +95,7 @@ describe('Text Input', () => {
const component = mount(TextInput(props));
const description = component.find('.o-forms-title__prompt');

expect(description.text()).toEqual('Description text');
expect(description.text()).toBe('Description text');
});

it('renders as required field', () => {
Expand Down
4 changes: 2 additions & 2 deletions helpers/ncf-countries.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('ncf-countries', () => {

expect(
context.countries.find((country) => country.selected)
).not.toBeDefined();
).toBeUndefined();
});

it('does not mark any countries selected if incorrect value passed', () => {
Expand All @@ -57,7 +57,7 @@ describe('ncf-countries', () => {

expect(
context.countries.find((country) => country.selected)
).not.toBeDefined();
).toBeUndefined();
});

it('marks a country as selected if value matches code', () => {
Expand Down
Loading

0 comments on commit c7bf91f

Please sign in to comment.