diff --git a/pro/src/screens/Offers/Offers.tsx b/pro/src/screens/Offers/Offers.tsx index 9c6ac034c6f..be10e4d2f83 100644 --- a/pro/src/screens/Offers/Offers.tsx +++ b/pro/src/screens/Offers/Offers.tsx @@ -136,8 +136,7 @@ export const Offers = ({ const areAllIndividualOffersSelected = selectedIndividualOffers.length > 0 && - selectedIndividualOffers.length === - offers.filter((offer) => offer.isEditable).length + selectedIndividualOffers.length === offers.length function clearSelectedOfferIds() { setSelectedCollectiveOffers([]) @@ -152,11 +151,7 @@ export const Offers = ({ : offers.filter((offer) => offer.isEditable) ) } else { - setSelectedIndividualOffers( - areAllIndividualOffersSelected - ? [] - : offers.filter((offer) => offer.isEditable) - ) + setSelectedIndividualOffers(areAllIndividualOffersSelected ? [] : offers) } } diff --git a/pro/src/screens/Offers/__specs__/Offers.spec.tsx b/pro/src/screens/Offers/__specs__/Offers.spec.tsx index d650edd11c5..c57fe07fc4b 100644 --- a/pro/src/screens/Offers/__specs__/Offers.spec.tsx +++ b/pro/src/screens/Offers/__specs__/Offers.spec.tsx @@ -553,8 +553,8 @@ describe('screen Offers', () => { expect(firstOfferCheckbox).toBeChecked() expect(secondOfferCheckbox).toBeChecked() - expect(thirdOfferCheckbox).not.toBeChecked() - expect(fourthOfferCheckbox).not.toBeChecked() + expect(thirdOfferCheckbox).toBeChecked() + expect(fourthOfferCheckbox).toBeChecked() await userEvent.click(screen.getByLabelText('Tout désélectionner'))