Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(BSR)[PRO] cleanup after eslint update #15192

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pro/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,12 @@ export default [
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-unnecessary-condition': 'error',
'require-await': 'error',

// TODO turn into error
'@typescript-eslint/no-unnecessary-condition': 'warn',
'react-hooks/rules-of-hooks': 'warn',
'@typescript-eslint/switch-exhaustiveness-check': 'warn',
'require-await': 'warn',
'react-hooks/exhaustive-deps': 'warn',

'react/self-closing-comp': [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -461,16 +461,16 @@ describe('CollectiveActionsCells', () => {
{
offer: collectiveOfferFactory({
isShowcase: false,
allowedActions: [
CollectiveOfferAllowedAction.CAN_CANCEL,
],
allowedActions: [CollectiveOfferAllowedAction.CAN_CANCEL],
}),
}, ['ENABLE_COLLECTIVE_NEW_STATUSES'])
},
['ENABLE_COLLECTIVE_NEW_STATUSES']
)

await userEvent.click(screen.getByTitle('Action'))
await userEvent.click(screen.getByTitle('Action'))

expect(screen.getByText('Annuler la réservation')).toBeInTheDocument()
})
expect(screen.getByText('Annuler la réservation')).toBeInTheDocument()
})

it('should allow to hide template offer when the ENABLE_COLLECTIVE_NEW_STATUSES FF is enabled', async () => {
renderCollectiveActionsCell(
Expand All @@ -496,7 +496,7 @@ describe('CollectiveActionsCells', () => {
)
})

it('should not show cancel button when ENABLE_COLLECTIVE_NEW_STATUSES and offer has not CAN_CANCEL allowed action', async () => {
it('should not show cancel button when ENABLE_COLLECTIVE_NEW_STATUSES and offer has not CAN_CANCEL allowed action', () => {
renderCollectiveActionsCell(
{
offer: collectiveOfferFactory({
Expand All @@ -507,7 +507,7 @@ describe('CollectiveActionsCells', () => {
['ENABLE_COLLECTIVE_NEW_STATUSES']
)

expect(screen.queryByText('Annuler la réservation')).not.toBeInTheDocument()
expect(screen.queryByText('Annuler la réservation')).not.toBeInTheDocument()
})

it('should allow to publish template offer when the ENABLE_COLLECTIVE_NEW_STATUSES FF is enabled', async () => {
Expand Down
9 changes: 6 additions & 3 deletions pro/src/ui-kit/form/QuantityInput/QuantityInput.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { Formik } from 'formik'

import { QuantityInput, QuantityInputProps } from './QuantityInput'

const renderQuantityInput = (props: QuantityInputProps, initialQuantity: number | string = '') => {
const renderQuantityInput = (
props: QuantityInputProps,
initialQuantity: number | string = ''
) => {
return render(
<Formik initialValues={{ quantity: initialQuantity }} onSubmit={() => {}}>
<QuantityInput {...props} />
Expand Down Expand Up @@ -76,7 +79,7 @@ describe('QuantityInput', () => {
expect(checkbox).toBeChecked()
})

it('should check the checkbox initially when the input value is an empty string', async () => {
it('should check the checkbox initially when the input value is an empty string', () => {
renderQuantityInput({}, '')

let input = screen.getByRole('spinbutton', { name: LABELS.input })
Expand All @@ -86,7 +89,7 @@ describe('QuantityInput', () => {
expect(checkbox).toBeChecked()
})

it('should uncheck the checkbox when the input value is set', async () => {
it('should uncheck the checkbox when the input value is set', () => {
renderQuantityInput({}, '1')

let input = screen.getByRole('spinbutton', { name: LABELS.input })
Expand Down
Loading