richie-education 2.25.0-b2.dev80 → 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
|
-
|
|
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 {
|
|
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 || ''}
|