richie-education 3.2.2-dev37 → 3.2.2-dev41
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.
- package/js/api/lms/dummy.ts +22 -16
- package/js/components/SaleTunnel/SaleTunnelInformation/SaleTunnelInformationGroup.tsx +4 -4
- package/js/components/SaleTunnel/SaleTunnelInformation/SaleTunnelInformationSingular.tsx +1 -1
- package/js/components/SaleTunnel/SaleTunnelInformation/StepContent.tsx +20 -16
- package/js/components/SaleTunnel/SaleTunnelInformation/index.tsx +2 -2
- package/js/components/SaleTunnel/index.full-process-b2b.spec.tsx +82 -16
- package/js/components/SaleTunnel/index.spec.tsx +2 -2
- package/package.json +1 -1
package/js/api/lms/dummy.ts
CHANGED
|
@@ -25,26 +25,32 @@ type JWTPayload = {
|
|
|
25
25
|
username: string;
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
/* All JWT tokens will expire the
|
|
28
|
+
/* All JWT tokens will expire the 05 Feb 2027 ! */
|
|
29
29
|
const JOANIE_DEV_DEMO_USER_JWT_TOKENS = {
|
|
30
|
-
|
|
31
|
-
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
|
|
32
|
-
user1:
|
|
33
|
-
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzcwMjIzOTY5LCJpYXQiOjE3Mzg2ODc5NjksImp0aSI6ImIwYjk3YjZkZjFlMzRkMTg4NjFiMGFhMjcxYWI0YWU1IiwiZW1haWwiOiJzYW1wc29uYW5uYUBleGFtcGxlLm9yZyIsImxhbmd1YWdlIjoiZW4tdXMiLCJ1c2VybmFtZSI6InVzZXIxIiwiZnVsbF9uYW1lIjoiT3RoZXIgT3duZXIifQ.yd46_63iuw19zmzH8aVNRAVAvAE4VGH8W8BjmFs6PPU',
|
|
34
|
-
user2:
|
|
35
|
-
'eyJhbGciOiJIUzI1NiIsIn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wiZW1haWwiOiJiZW5qYW1pbjU5QGV4YW1wbGUub3JnIiwibGFuZ3VhZ2UiOiJlbi11cyIsInVzZXJuYW1lIjoidXNlcjEwIiwiZnVsbF9uYW1lIjoiUm9uYWxkIEpvaG5zb24ifQ.c_AEOp6jD_K0xsJK4ZvkZcGnKlD3wmm_eJ2UEBGY5v0',
|
|
52
|
+
user11:
|
|
53
|
+
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxODAxODMyNDI4LCJpYXQiOjE3NzAyOTY0MjgsImp0aSI6Ijc5ZDg3NDkxZDU0NDRmMWVhZDAzYTYyMmQ0NWI0Y2E1IiwiZW1haWwiOiJhbWFuZGExMUBleGFtcGxlLm5ldCIsImxhbmd1YWdlIjoiZW4tdXMiLCJ1c2VybmFtZSI6InVzZXIxMSIsImZ1bGxfbmFtZSI6IkNoZXJ5bCBUYXlsb3IifQ.e6DEq75EHvCgtjf7aLr7Tk1DyZ9-4f-n-W8DXySCZZM',
|
|
48
54
|
};
|
|
49
55
|
|
|
50
56
|
export type DevDemoUser = keyof typeof JOANIE_DEV_DEMO_USER_JWT_TOKENS;
|
|
@@ -21,7 +21,7 @@ const messages = defineMessages({
|
|
|
21
21
|
description: {
|
|
22
22
|
id: 'components.SaleTunnel.Information.description',
|
|
23
23
|
description: 'Helper text explaining that the information will be used for billing',
|
|
24
|
-
defaultMessage: '
|
|
24
|
+
defaultMessage: 'This information will be used for billing',
|
|
25
25
|
},
|
|
26
26
|
purchaseTypeTitle: {
|
|
27
27
|
id: 'components.SaleTunnel.Information.purchaseTypeTitle',
|
|
@@ -36,12 +36,12 @@ const messages = defineMessages({
|
|
|
36
36
|
purchaseTypeOptionSingle: {
|
|
37
37
|
id: 'components.SaleTunnel.Information.purchaseTypeOptionSingle',
|
|
38
38
|
description: 'Option label for selecting a single purchase (B2C)',
|
|
39
|
-
defaultMessage: '
|
|
39
|
+
defaultMessage: 'I am purchasing as an individual',
|
|
40
40
|
},
|
|
41
41
|
purchaseTypeOptionGroup: {
|
|
42
42
|
id: 'components.SaleTunnel.Information.purchaseTypeOptionGroup',
|
|
43
43
|
description: 'Option label for selecting a group purchase (B2B)',
|
|
44
|
-
defaultMessage: '
|
|
44
|
+
defaultMessage: 'I am purchasing on behalf of an organization',
|
|
45
45
|
},
|
|
46
46
|
stepCompany: {
|
|
47
47
|
id: 'components.SaleTunnel.BatchOrderForm.stepCompany',
|
|
@@ -169,7 +169,7 @@ const BatchOrderForm = () => {
|
|
|
169
169
|
signatory_email: '',
|
|
170
170
|
signatory_telephone: '',
|
|
171
171
|
nb_seats: 0,
|
|
172
|
-
payment_method:
|
|
172
|
+
payment_method: undefined as any,
|
|
173
173
|
funding_amount: 0,
|
|
174
174
|
};
|
|
175
175
|
|
|
@@ -21,7 +21,7 @@ const messages = defineMessages({
|
|
|
21
21
|
description: {
|
|
22
22
|
id: 'components.SaleTunnel.Information.description',
|
|
23
23
|
description: 'Description of the information section',
|
|
24
|
-
defaultMessage: '
|
|
24
|
+
defaultMessage: 'This information will be used for billing',
|
|
25
25
|
},
|
|
26
26
|
paymentSchedule: {
|
|
27
27
|
id: 'components.SaleTunnel.Information.paymentSchedule',
|
|
@@ -38,7 +38,7 @@ const messages = defineMessages({
|
|
|
38
38
|
id: 'components.SaleTunnel.BatchOrderForm.stepAdminTitle',
|
|
39
39
|
description:
|
|
40
40
|
'Title of the section with details about the person responsible for admin follow-up',
|
|
41
|
-
defaultMessage: '
|
|
41
|
+
defaultMessage: 'Administrative contact',
|
|
42
42
|
},
|
|
43
43
|
stepSignatoryTitle: {
|
|
44
44
|
id: 'components.SaleTunnel.BatchOrderForm.stepSignatoryTitle',
|
|
@@ -49,17 +49,17 @@ const messages = defineMessages({
|
|
|
49
49
|
stepBillingTitle: {
|
|
50
50
|
id: 'components.SaleTunnel.BatchOrderForm.stepBillingTitle',
|
|
51
51
|
description: 'Title of the section with billing details',
|
|
52
|
-
defaultMessage: 'Billing
|
|
52
|
+
defaultMessage: 'Billing details',
|
|
53
53
|
},
|
|
54
54
|
stepParticipantsTitle: {
|
|
55
55
|
id: 'components.SaleTunnel.BatchOrderForm.stepParticipantsTitle',
|
|
56
56
|
description: 'Title of the section to enter the number of registrations/participants',
|
|
57
|
-
defaultMessage: '
|
|
57
|
+
defaultMessage: 'Number of registrations',
|
|
58
58
|
},
|
|
59
59
|
stepFinancingTitle: {
|
|
60
60
|
id: 'components.SaleTunnel.BatchOrderForm.stepFinancingTitle',
|
|
61
61
|
description: 'Title of the section to select the payment plan of the course',
|
|
62
|
-
defaultMessage: '
|
|
62
|
+
defaultMessage: 'Ordering method',
|
|
63
63
|
},
|
|
64
64
|
companyName: {
|
|
65
65
|
id: 'batchOrder.companyName',
|
|
@@ -70,7 +70,7 @@ const messages = defineMessages({
|
|
|
70
70
|
id: 'batchOrder.identificationNumber',
|
|
71
71
|
description:
|
|
72
72
|
'Label for the field asking the company identification number (eg. SIRET in France)',
|
|
73
|
-
defaultMessage: '
|
|
73
|
+
defaultMessage: 'Registration number (SIRET for French companies)',
|
|
74
74
|
},
|
|
75
75
|
vatNumber: {
|
|
76
76
|
id: 'batchOrder.vatNumber',
|
|
@@ -85,7 +85,7 @@ const messages = defineMessages({
|
|
|
85
85
|
postCode: {
|
|
86
86
|
id: 'batchOrder.postCode',
|
|
87
87
|
description: 'Label for the field asking the postal code',
|
|
88
|
-
defaultMessage: '
|
|
88
|
+
defaultMessage: 'Postal code',
|
|
89
89
|
},
|
|
90
90
|
city: {
|
|
91
91
|
id: 'batchOrder.city',
|
|
@@ -120,42 +120,42 @@ const messages = defineMessages({
|
|
|
120
120
|
phone: {
|
|
121
121
|
id: 'batchOrder.phone',
|
|
122
122
|
description: 'Label for the field asking the phone number of the contact person',
|
|
123
|
-
defaultMessage: 'Phone',
|
|
123
|
+
defaultMessage: 'Phone number',
|
|
124
124
|
},
|
|
125
125
|
checkBilling: {
|
|
126
126
|
id: 'components.SaleTunnel.BatchOrderForm.checkBilling',
|
|
127
127
|
description: 'Checkbox label to indicate using alternative billing information',
|
|
128
|
-
defaultMessage: 'Use
|
|
128
|
+
defaultMessage: 'Use different billing information',
|
|
129
129
|
},
|
|
130
130
|
contactName: {
|
|
131
131
|
id: 'batchOrder.contactName',
|
|
132
132
|
description: 'Label for the field asking the billing contact name',
|
|
133
|
-
defaultMessage: '
|
|
133
|
+
defaultMessage: 'Contact name',
|
|
134
134
|
},
|
|
135
135
|
contactEmail: {
|
|
136
136
|
id: 'batchOrder.contactEmail',
|
|
137
137
|
description: 'Label for the field asking the billing contact email',
|
|
138
|
-
defaultMessage: '
|
|
138
|
+
defaultMessage: 'Contact email',
|
|
139
139
|
},
|
|
140
140
|
nbSeats: {
|
|
141
141
|
id: 'batchOrder.nbSeats',
|
|
142
142
|
description: 'Label for the field asking the number of participants/seats',
|
|
143
|
-
defaultMessage: '
|
|
143
|
+
defaultMessage: 'Number of participants to register',
|
|
144
144
|
},
|
|
145
145
|
cardPayment: {
|
|
146
146
|
id: 'batchOrder.cardPayment',
|
|
147
147
|
description: 'Option label for selecting credit card payment',
|
|
148
|
-
defaultMessage: '
|
|
148
|
+
defaultMessage: 'Credit card',
|
|
149
149
|
},
|
|
150
150
|
bankTransfer: {
|
|
151
151
|
id: 'batchOrder.bankTransfer',
|
|
152
152
|
description: 'Option label for selecting bank transfer payment',
|
|
153
|
-
defaultMessage: '
|
|
153
|
+
defaultMessage: 'Bank transfer',
|
|
154
154
|
},
|
|
155
155
|
purchaseOrder: {
|
|
156
156
|
id: 'batchOrder.purchaseOrder',
|
|
157
157
|
description: 'Option label for selecting payment via purchase order',
|
|
158
|
-
defaultMessage: '
|
|
158
|
+
defaultMessage: 'Purchase order',
|
|
159
159
|
},
|
|
160
160
|
withoutOrderForm: {
|
|
161
161
|
id: 'batchOrder.withoutOrderForm',
|
|
@@ -191,7 +191,7 @@ const messages = defineMessages({
|
|
|
191
191
|
participatingOrganisations: {
|
|
192
192
|
id: 'batchOrder.participatingOrganisations',
|
|
193
193
|
description: 'Label for the field listing other participating organisations',
|
|
194
|
-
defaultMessage: 'Participating
|
|
194
|
+
defaultMessage: 'Participating organizations',
|
|
195
195
|
},
|
|
196
196
|
});
|
|
197
197
|
|
|
@@ -211,6 +211,7 @@ export const StepContent = ({
|
|
|
211
211
|
value: organization.id,
|
|
212
212
|
}));
|
|
213
213
|
const [otherBillingAddress, setOtherBillingAddress] = useState(false);
|
|
214
|
+
const organizationId = form.watch('organization_id');
|
|
214
215
|
|
|
215
216
|
return (
|
|
216
217
|
<div className="step-content">
|
|
@@ -525,11 +526,14 @@ export const StepContent = ({
|
|
|
525
526
|
</div>
|
|
526
527
|
<FormattedMessage {...messages.recommandation} />
|
|
527
528
|
<Select
|
|
528
|
-
{...register('organization_id')}
|
|
529
529
|
label={intl.formatMessage(messages.participatingOrganisations)}
|
|
530
530
|
clearable
|
|
531
531
|
options={orgOptions}
|
|
532
532
|
className="recommandation"
|
|
533
|
+
value={organizationId ?? ''}
|
|
534
|
+
onChange={(e) => {
|
|
535
|
+
form.setValue('organization_id', e.target.value as string);
|
|
536
|
+
}}
|
|
533
537
|
/>
|
|
534
538
|
</div>
|
|
535
539
|
</div>
|
|
@@ -19,12 +19,12 @@ const messages = defineMessages({
|
|
|
19
19
|
purchaseTypeOptionSingle: {
|
|
20
20
|
id: 'components.SaleTunnel.Information.purchaseTypeOptionSingle',
|
|
21
21
|
description: 'Label for B2C option',
|
|
22
|
-
defaultMessage: '
|
|
22
|
+
defaultMessage: 'I am purchasing as an individual',
|
|
23
23
|
},
|
|
24
24
|
purchaseTypeOptionGroup: {
|
|
25
25
|
id: 'components.SaleTunnel.Information.purchaseTypeOptionGroup',
|
|
26
26
|
description: 'Label for B2C option',
|
|
27
|
-
defaultMessage: '
|
|
27
|
+
defaultMessage: 'I am purchasing on behalf of an organization',
|
|
28
28
|
},
|
|
29
29
|
});
|
|
30
30
|
|
|
@@ -2,6 +2,7 @@ import { screen, within } from '@testing-library/react';
|
|
|
2
2
|
import fetchMock from 'fetch-mock';
|
|
3
3
|
import queryString from 'query-string';
|
|
4
4
|
import userEvent from '@testing-library/user-event';
|
|
5
|
+
import { PaymentMethod } from 'components/PaymentInterfaces/types';
|
|
5
6
|
import {
|
|
6
7
|
RichieContextFactory as mockRichieContextFactory,
|
|
7
8
|
PacedCourseFactory,
|
|
@@ -17,6 +18,7 @@ import {
|
|
|
17
18
|
OfferingBatchOrderFactory,
|
|
18
19
|
BatchOrderReadFactory,
|
|
19
20
|
CredentialOrderFactory,
|
|
21
|
+
OrganizationFactory,
|
|
20
22
|
} from 'utils/test/factories/joanie';
|
|
21
23
|
import { CourseRun, NOT_CANCELED_ORDER_STATES, OrderState } from 'types/Joanie';
|
|
22
24
|
import { Priority } from 'types';
|
|
@@ -82,9 +84,7 @@ describe('SaleTunnel', () => {
|
|
|
82
84
|
const product = ProductFactory().one();
|
|
83
85
|
const offering = OfferingFactory({ course, product, is_withdrawable: false }).one();
|
|
84
86
|
const paymentPlan = PaymentPlanFactory().one();
|
|
85
|
-
const
|
|
86
|
-
product: { id: product.id, title: product.title },
|
|
87
|
-
}).one();
|
|
87
|
+
const organizations = OrganizationFactory().many(3);
|
|
88
88
|
|
|
89
89
|
fetchMock.get(
|
|
90
90
|
`https://joanie.endpoint/api/v1.0/courses/${course.code}/products/${product.id}/`,
|
|
@@ -105,7 +105,7 @@ describe('SaleTunnel', () => {
|
|
|
105
105
|
);
|
|
106
106
|
fetchMock.get(
|
|
107
107
|
`https://joanie.endpoint/api/v1.0/offerings/${offering.id}/get-organizations/`,
|
|
108
|
-
|
|
108
|
+
organizations,
|
|
109
109
|
);
|
|
110
110
|
|
|
111
111
|
render(<CourseProductItem productId={product.id} course={course} />, {
|
|
@@ -152,13 +152,13 @@ describe('SaleTunnel', () => {
|
|
|
152
152
|
expectMenuToBeClosed(menu);
|
|
153
153
|
await user.click(formTypeSelect);
|
|
154
154
|
expectMenuToBeOpen(menu);
|
|
155
|
-
await user.click(screen.getByText('
|
|
155
|
+
await user.click(screen.getByText('I am purchasing on behalf of an organization'));
|
|
156
156
|
|
|
157
157
|
// Company step
|
|
158
158
|
const $companyName = await screen.findByRole('textbox', { name: 'Company name' });
|
|
159
|
-
const $idNumber = screen.getByRole('textbox', { name: /
|
|
159
|
+
const $idNumber = screen.getByRole('textbox', { name: /Registration number/ });
|
|
160
160
|
const $address = screen.getByRole('textbox', { name: 'Address' });
|
|
161
|
-
const $postCode = screen.getByRole('textbox', { name: '
|
|
161
|
+
const $postCode = screen.getByRole('textbox', { name: 'Postal code' });
|
|
162
162
|
const $city = screen.getByRole('textbox', { name: 'City' });
|
|
163
163
|
const $country = screen.getByRole('combobox', { name: 'Country' });
|
|
164
164
|
|
|
@@ -183,7 +183,7 @@ describe('SaleTunnel', () => {
|
|
|
183
183
|
const $firstName = screen.getByRole('textbox', { name: 'First name' });
|
|
184
184
|
const $role = screen.getByRole('textbox', { name: 'Role' });
|
|
185
185
|
const $email = screen.getByRole('textbox', { name: 'Email' });
|
|
186
|
-
const $phone = screen.getByRole('textbox', { name: 'Phone' });
|
|
186
|
+
const $phone = screen.getByRole('textbox', { name: 'Phone number' });
|
|
187
187
|
|
|
188
188
|
await user.type($lastName, 'Doe');
|
|
189
189
|
await user.type($firstName, 'John');
|
|
@@ -200,7 +200,7 @@ describe('SaleTunnel', () => {
|
|
|
200
200
|
const $signatoryFirstName = screen.getByRole('textbox', { name: 'First name' });
|
|
201
201
|
const $signatoryRole = screen.getByRole('textbox', { name: 'Role' });
|
|
202
202
|
const $signatoryEmail = screen.getByRole('textbox', { name: 'Email' });
|
|
203
|
-
const $signatoryPhone = screen.getByRole('textbox', { name: 'Phone' });
|
|
203
|
+
const $signatoryPhone = screen.getByRole('textbox', { name: 'Phone number' });
|
|
204
204
|
|
|
205
205
|
await user.type($signatoryLastName, 'Doe');
|
|
206
206
|
await user.type($signatoryFirstName, 'John');
|
|
@@ -210,10 +210,37 @@ describe('SaleTunnel', () => {
|
|
|
210
210
|
|
|
211
211
|
// Participants step
|
|
212
212
|
await user.click(screen.getByRole('button', { name: 'Next' }));
|
|
213
|
-
const $nbParticipants = await screen.findByLabelText('
|
|
213
|
+
const $nbParticipants = await screen.findByLabelText('Number of participants to register');
|
|
214
214
|
await user.type($nbParticipants, '13');
|
|
215
215
|
expect($nbParticipants).toHaveValue(13);
|
|
216
216
|
|
|
217
|
+
// Financing step
|
|
218
|
+
await user.click(screen.getByRole('button', { name: 'Next' }));
|
|
219
|
+
|
|
220
|
+
const $purchaseOrderRadio = await screen.findByLabelText('Purchase order');
|
|
221
|
+
await user.click($purchaseOrderRadio);
|
|
222
|
+
|
|
223
|
+
const $fundingEntity = screen.getByLabelText('Entity name');
|
|
224
|
+
await user.type($fundingEntity, 'OPCO');
|
|
225
|
+
expect($fundingEntity).toHaveValue('OPCO');
|
|
226
|
+
|
|
227
|
+
const $fundingAmount = screen.getByLabelText('Amount covered');
|
|
228
|
+
await user.type($fundingAmount, '5000');
|
|
229
|
+
expect($fundingAmount).toHaveValue(5000);
|
|
230
|
+
|
|
231
|
+
const organizationComboboxes = screen.getAllByRole('combobox', {
|
|
232
|
+
name: 'Participating organizations',
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
const $organizationSelect = organizationComboboxes[organizationComboboxes.length - 1];
|
|
236
|
+
await user.click($organizationSelect);
|
|
237
|
+
const organizationMenu: HTMLDivElement = screen.getByRole('listbox', {
|
|
238
|
+
name: 'Participating organizations',
|
|
239
|
+
});
|
|
240
|
+
expectMenuToBeOpen(organizationMenu);
|
|
241
|
+
const firstOrg = organizations[0];
|
|
242
|
+
await user.click(screen.getByRole('option', { name: firstOrg.title }));
|
|
243
|
+
|
|
217
244
|
// Submit the batch order
|
|
218
245
|
const batchOrderRead = BatchOrderReadFactory().one();
|
|
219
246
|
fetchMock.post('https://joanie.endpoint/api/v1.0/batch-orders/', batchOrderRead);
|
|
@@ -229,6 +256,39 @@ describe('SaleTunnel', () => {
|
|
|
229
256
|
'href',
|
|
230
257
|
`/en/dashboard/batch-orders/${batchOrderRead.id}`,
|
|
231
258
|
);
|
|
259
|
+
|
|
260
|
+
// Verify the batch order payload contains all required and optional fields
|
|
261
|
+
const batchOrderCalls = fetchMock.calls('https://joanie.endpoint/api/v1.0/batch-orders/');
|
|
262
|
+
expect(batchOrderCalls).toHaveLength(1);
|
|
263
|
+
const batchOrderCall = batchOrderCalls[0];
|
|
264
|
+
const batchOrderRequest = batchOrderCall[1];
|
|
265
|
+
const batchOrderPayload = JSON.parse(batchOrderRequest?.body as string);
|
|
266
|
+
|
|
267
|
+
// Verify all payload fields
|
|
268
|
+
expect(batchOrderPayload).toEqual({
|
|
269
|
+
offering_id: offering.id,
|
|
270
|
+
company_name: 'GIP-FUN',
|
|
271
|
+
identification_number: '789 242 229 01694',
|
|
272
|
+
address: '61 Bis Rue de la Glaciere',
|
|
273
|
+
postcode: '75013',
|
|
274
|
+
city: 'Paris',
|
|
275
|
+
country: 'FR',
|
|
276
|
+
administrative_lastname: 'Doe',
|
|
277
|
+
administrative_firstname: 'John',
|
|
278
|
+
administrative_profession: 'HR',
|
|
279
|
+
administrative_email: 'john.doe@fun-mooc.com',
|
|
280
|
+
administrative_telephone: '+338203920103',
|
|
281
|
+
signatory_lastname: 'Doe',
|
|
282
|
+
signatory_firstname: 'John',
|
|
283
|
+
signatory_profession: 'CEO',
|
|
284
|
+
signatory_email: 'john.doe@fun-mooc.com',
|
|
285
|
+
signatory_telephone: '+338203920103',
|
|
286
|
+
nb_seats: '13',
|
|
287
|
+
payment_method: PaymentMethod.PURCHASE_ORDER,
|
|
288
|
+
funding_entity: 'OPCO',
|
|
289
|
+
funding_amount: '5000',
|
|
290
|
+
organization_id: firstOrg.id,
|
|
291
|
+
});
|
|
232
292
|
}, 30000);
|
|
233
293
|
|
|
234
294
|
it('tests the entire process of subscribing with a voucher from a batch order', async () => {
|
|
@@ -429,13 +489,13 @@ describe('SaleTunnel', () => {
|
|
|
429
489
|
expectMenuToBeClosed(menu);
|
|
430
490
|
await user.click(formTypeSelect);
|
|
431
491
|
expectMenuToBeOpen(menu);
|
|
432
|
-
await user.click(screen.getByText('
|
|
492
|
+
await user.click(screen.getByText('I am purchasing on behalf of an organization'));
|
|
433
493
|
|
|
434
494
|
// Company step
|
|
435
495
|
const $companyName = await screen.findByRole('textbox', { name: 'Company name' });
|
|
436
|
-
const $idNumber = screen.getByRole('textbox', { name: /
|
|
496
|
+
const $idNumber = screen.getByRole('textbox', { name: /Registration number/ });
|
|
437
497
|
const $address = screen.getByRole('textbox', { name: 'Address' });
|
|
438
|
-
const $postCode = screen.getByRole('textbox', { name: '
|
|
498
|
+
const $postCode = screen.getByRole('textbox', { name: 'Postal code' });
|
|
439
499
|
const $city = screen.getByRole('textbox', { name: 'City' });
|
|
440
500
|
const $country = screen.getByRole('combobox', { name: 'Country' });
|
|
441
501
|
|
|
@@ -460,7 +520,7 @@ describe('SaleTunnel', () => {
|
|
|
460
520
|
const $firstName = screen.getByRole('textbox', { name: 'First name' });
|
|
461
521
|
const $role = screen.getByRole('textbox', { name: 'Role' });
|
|
462
522
|
const $email = screen.getByRole('textbox', { name: 'Email' });
|
|
463
|
-
const $phone = screen.getByRole('textbox', { name: 'Phone' });
|
|
523
|
+
const $phone = screen.getByRole('textbox', { name: 'Phone number' });
|
|
464
524
|
|
|
465
525
|
await user.type($lastName, 'Doe');
|
|
466
526
|
await user.type($firstName, 'John');
|
|
@@ -477,7 +537,7 @@ describe('SaleTunnel', () => {
|
|
|
477
537
|
const $signatoryFirstName = screen.getByRole('textbox', { name: 'First name' });
|
|
478
538
|
const $signatoryRole = screen.getByRole('textbox', { name: 'Role' });
|
|
479
539
|
const $signatoryEmail = screen.getByRole('textbox', { name: 'Email' });
|
|
480
|
-
const $signatoryPhone = screen.getByRole('textbox', { name: 'Phone' });
|
|
540
|
+
const $signatoryPhone = screen.getByRole('textbox', { name: 'Phone number' });
|
|
481
541
|
|
|
482
542
|
await user.type($signatoryLastName, 'Doe');
|
|
483
543
|
await user.type($signatoryFirstName, 'John');
|
|
@@ -487,10 +547,16 @@ describe('SaleTunnel', () => {
|
|
|
487
547
|
|
|
488
548
|
// Participants step
|
|
489
549
|
await user.click(screen.getByRole('button', { name: 'Next' }));
|
|
490
|
-
const $nbParticipants = await screen.findByLabelText('
|
|
550
|
+
const $nbParticipants = await screen.findByLabelText('Number of participants to register');
|
|
491
551
|
await user.type($nbParticipants, '13');
|
|
492
552
|
expect($nbParticipants).toHaveValue(13);
|
|
493
553
|
|
|
554
|
+
// Financing step
|
|
555
|
+
await user.click(screen.getByRole('button', { name: 'Next' }));
|
|
556
|
+
|
|
557
|
+
const $purchaseOrderRadio = await screen.findByLabelText('Purchase order');
|
|
558
|
+
await user.click($purchaseOrderRadio);
|
|
559
|
+
|
|
494
560
|
fetchMock.post('https://joanie.endpoint/api/v1.0/batch-orders/', {
|
|
495
561
|
status: 422,
|
|
496
562
|
body: {
|
|
@@ -772,7 +772,7 @@ describe.each([
|
|
|
772
772
|
queryOptions: { client: createTestQueryClient({ user: richieUser }) },
|
|
773
773
|
});
|
|
774
774
|
expect(
|
|
775
|
-
await screen.queryByText('
|
|
775
|
+
await screen.queryByText('This information will be used for billing'),
|
|
776
776
|
).toBeInTheDocument();
|
|
777
777
|
|
|
778
778
|
await user.type(screen.getByLabelText('Voucher code'), 'DISCOUNT100');
|
|
@@ -781,7 +781,7 @@ describe.each([
|
|
|
781
781
|
expect(await screen.findByText('Discount applied')).toBeInTheDocument();
|
|
782
782
|
await waitFor(async () =>
|
|
783
783
|
expect(
|
|
784
|
-
await screen.queryByText('
|
|
784
|
+
await screen.queryByText('This information will be used for billing'),
|
|
785
785
|
).not.toBeInTheDocument(),
|
|
786
786
|
);
|
|
787
787
|
expect(await screen.queryByTestId('withdraw-right-checkbox')).not.toBeInTheDocument();
|