richie-education 2.25.0-b2.dev81 → 2.25.0-b2.dev82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -61,7 +61,7 @@ const RegisteredAddress = ({ promote, select, edit, remove, address }: Props) =>
61
61
  <Radio
62
62
  aria-describedby={`address-${address.id}-infos`}
63
63
  aria-label={intl.formatMessage(messages.promoteButtonLabel, { title: address.title })}
64
- onClick={() => promote(address)}
64
+ onChange={() => promote(address)}
65
65
  title={intl.formatMessage(messages.promoteButtonLabel, { title: address.title })}
66
66
  name="registered-addresses"
67
67
  checked={address.is_main}
@@ -5,6 +5,7 @@ import { QueryClientProvider } from '@tanstack/react-query';
5
5
  import { CunninghamProvider } from '@openfun/cunningham-react';
6
6
  import { PropsWithChildren, useMemo, useState } from 'react';
7
7
  import userEvent from '@testing-library/user-event';
8
+ import { queryByRole } from '@testing-library/dom';
8
9
  import {
9
10
  RichieContextFactory as mockRichieContextFactory,
10
11
  UserFactory,
@@ -210,6 +211,9 @@ describe('SaleTunnelStepPayment', () => {
210
211
  },
211
212
  );
212
213
 
214
+ // The select field should not be clearable
215
+ expect(queryByRole(dropdown, 'button', { name: 'Clear selection' })).toBeNull();
216
+
213
217
  // A button to add an address should be displayed
214
218
  const $button = screen.getByText('Add an address', { selector: 'button' });
215
219
 
@@ -123,7 +123,7 @@ export const SaleTunnelStepPayment = ({ next }: SaleTunnelStepPaymentProps) => {
123
123
  * Retrieve address through its `id` provided by the event target value
124
124
  * then update `selectedAddress` state
125
125
  *
126
- * @param {React.ChangeEvent<HTMLSelectElement>} event
126
+ * @param {string} newValue
127
127
  */
128
128
  const handleSelectAddress = (newValue: string) => {
129
129
  const targetedAddress = addresses.items.find((a) => a.id === newValue);
@@ -220,6 +220,7 @@ export const SaleTunnelStepPayment = ({ next }: SaleTunnelStepPaymentProps) => {
220
220
  <Select
221
221
  className="form-field--minimal"
222
222
  name="invoice_address"
223
+ clearable={false}
223
224
  label={intl.formatMessage(messages.userBillingAddressSelectLabel)}
224
225
  onChange={(e) => handleSelectAddress((e.target.value || '') as string)}
225
226
  defaultValue={selectedAddress!.id || ''}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "richie-education",
3
- "version": "2.25.0-b2.dev81",
3
+ "version": "2.25.0-b2.dev82",
4
4
  "description": "A CMS to build learning portals for Open Education",
5
5
  "main": "sandbox/manage.py",
6
6
  "scripts": {