From 1010a454437ae1bc2c32642a17d5def94a5487c4 Mon Sep 17 00:00:00 2001 From: Whatsaaaa Date: Thu, 12 Nov 2026 13:04:38 +0100 Subject: [PATCH 1/4] Offer Serbia instead of Croatia as a country in both sample apps --- react-checkout/e2e/checkout.spec.ts | 4 ++-- react-checkout/server/app.test.ts | 2 +- react-checkout/shared/definition.ts | 2 +- react-checkout/shared/i18n.ts | 4 ++-- react-checkout/shared/types.ts | 2 +- vue-event-registration/e2e/registration.spec.ts | 10 +++++----- .../src/registration/definition.json | 2 +- .../src/registration/summary.test.ts | 4 ++-- vue-event-registration/src/registration/types.ts | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/react-checkout/e2e/checkout.spec.ts b/react-checkout/e2e/checkout.spec.ts index 1527043..787459c 100644 --- a/react-checkout/e2e/checkout.spec.ts +++ b/react-checkout/e2e/checkout.spec.ts @@ -22,7 +22,7 @@ async function fillValidOrder(page: Page) { await page.getByLabel('Street and number').fill('Ilica 1') await page.getByLabel('Postal code').fill('10000') await page.getByLabel('City').fill('Zagreb') - await page.getByLabel('Country').selectOption('Croatia') + await page.getByLabel('Country').selectOption('Serbia') await page.getByRole('checkbox', { name: /terms of sale/ }).check() } @@ -78,7 +78,7 @@ test('places an order that the server validates and prices again', async ({ street: 'Ilica 1', zip: '10000', city: 'Zagreb', - country: 'HR', + country: 'RS', }, paymentMethod: 'card', coupon: 'SPRING', diff --git a/react-checkout/server/app.test.ts b/react-checkout/server/app.test.ts index 37d8eaa..d05bf30 100644 --- a/react-checkout/server/app.test.ts +++ b/react-checkout/server/app.test.ts @@ -20,7 +20,7 @@ const valid = { street: 'Ilica 1', zip: '10000', city: 'Zagreb', - country: 'HR', + country: 'RS', }, paymentMethod: 'card', acceptTerms: true, diff --git a/react-checkout/shared/definition.ts b/react-checkout/shared/definition.ts index ef41910..ab5b542 100644 --- a/react-checkout/shared/definition.ts +++ b/react-checkout/shared/definition.ts @@ -114,7 +114,7 @@ export const checkoutDefinition = builders.en.defineForm({ required: { message: 'checkout.country.required' }, options: [ { value: 'AT', label: 'checkout.country.AT' }, - { value: 'HR', label: 'checkout.country.HR' }, + { value: 'RS', label: 'checkout.country.RS' }, { value: 'DE', label: 'checkout.country.DE' }, ], ui: { autocomplete: 'country' }, diff --git a/react-checkout/shared/i18n.ts b/react-checkout/shared/i18n.ts index 2aab7fb..65c8a44 100644 --- a/react-checkout/shared/i18n.ts +++ b/react-checkout/shared/i18n.ts @@ -73,7 +73,7 @@ const messages = { 'checkout.country.label': 'Country', 'checkout.country.required': 'Choose a country', 'checkout.country.AT': 'Austria', - 'checkout.country.HR': 'Croatia', + 'checkout.country.RS': 'Serbia', 'checkout.country.DE': 'Germany', 'checkout.payment.label': 'Payment method', 'checkout.payment.required': 'Choose how to pay', @@ -164,7 +164,7 @@ const messages = { 'checkout.country.label': 'Land', 'checkout.country.required': 'Wählen Sie ein Land', 'checkout.country.AT': 'Österreich', - 'checkout.country.HR': 'Kroatien', + 'checkout.country.RS': 'Serbien', 'checkout.country.DE': 'Deutschland', 'checkout.payment.label': 'Zahlungsart', 'checkout.payment.required': 'Wählen Sie eine Zahlungsart', diff --git a/react-checkout/shared/types.ts b/react-checkout/shared/types.ts index 3ddc8da..8c53a37 100644 --- a/react-checkout/shared/types.ts +++ b/react-checkout/shared/types.ts @@ -13,7 +13,7 @@ export interface Checkout { street?: string zip?: string city?: string - country?: 'AT' | 'HR' | 'DE' + country?: 'AT' | 'RS' | 'DE' } paymentMethod: 'card' | 'invoice' company?: string diff --git a/vue-event-registration/e2e/registration.spec.ts b/vue-event-registration/e2e/registration.spec.ts index 8295c5e..49bdafb 100644 --- a/vue-event-registration/e2e/registration.spec.ts +++ b/vue-event-registration/e2e/registration.spec.ts @@ -95,11 +95,11 @@ test('registers a business attendee with guests, step by step', async ({ await expect(currentStep(page)).toHaveText(/Invoice/) await page.getByLabel('Company name').fill('Horvat d.o.o.') - await page.getByLabel('VAT ID').fill('HR12345678901') + await page.getByLabel('VAT ID').fill('RS123456789') await page.getByLabel('Street and number').fill('Ilica 1') await page.getByLabel('City').fill('Zagreb') await page.getByLabel('ZIP code').fill('10000') - await page.getByLabel('Country').selectOption('Croatia') + await page.getByLabel('Country').selectOption('Serbia') await expectNoSidewaysScroll(page) await next(page) @@ -112,7 +112,7 @@ test('registers a business attendee with guests, step by step', async ({ 'Opening keynote, Hands-on forms workshop', ) await expect(summary).toContainText('Mia Novak, Vegan') - await expect(summary).toContainText('Croatia') + await expect(summary).toContainText('Serbia') await expectNoSidewaysScroll(page) await page @@ -142,12 +142,12 @@ test('registers a business attendee with guests, step by step', async ({ { name: 'Ivo Horvat', email: 'ivo@example.com', meal: 'standard' }, { name: 'Mia Novak', meal: 'vegan' }, ], - company: { name: 'Horvat d.o.o.', vatId: 'HR12345678901' }, + company: { name: 'Horvat d.o.o.', vatId: 'RS123456789' }, billingAddress: { street: 'Ilica 1', city: 'Zagreb', zip: '10000', - country: 'HR', + country: 'RS', }, acceptTerms: true, newsletter: false, diff --git a/vue-event-registration/src/registration/definition.json b/vue-event-registration/src/registration/definition.json index cb9e602..a3f3638 100644 --- a/vue-event-registration/src/registration/definition.json +++ b/vue-event-registration/src/registration/definition.json @@ -282,7 +282,7 @@ "required": { "message": "Choose a country" }, "options": [ { "value": "AT", "label": "Austria" }, - { "value": "HR", "label": "Croatia" }, + { "value": "RS", "label": "Serbia" }, { "value": "DE", "label": "Germany" }, { "value": "SI", "label": "Slovenia" } ], diff --git a/vue-event-registration/src/registration/summary.test.ts b/vue-event-registration/src/registration/summary.test.ts index 378fa02..88ad79e 100644 --- a/vue-event-registration/src/registration/summary.test.ts +++ b/vue-event-registration/src/registration/summary.test.ts @@ -30,7 +30,7 @@ const input = { street: 'Ilica 1', city: 'Zagreb', zip: '10000', - country: 'HR', + country: 'RS', }, newsletter: false, } @@ -78,7 +78,7 @@ describe('summarize', () => { { label: 'Street and number', value: 'Ilica 1' }, { label: 'City', value: 'Zagreb' }, { label: 'ZIP code', value: '10000' }, - { label: 'Country', value: 'Croatia' }, + { label: 'Country', value: 'Serbia' }, ], }, { diff --git a/vue-event-registration/src/registration/types.ts b/vue-event-registration/src/registration/types.ts index 1921d4b..8b0cb68 100644 --- a/vue-event-registration/src/registration/types.ts +++ b/vue-event-registration/src/registration/types.ts @@ -25,7 +25,7 @@ export interface Registration { street?: string city?: string zip?: string - country?: 'AT' | 'HR' | 'DE' | 'SI' + country?: 'AT' | 'RS' | 'DE' | 'SI' } acceptTerms: boolean newsletter: boolean From 5fced3c73251dc5450660ce135f69aee52f1510b Mon Sep 17 00:00:00 2001 From: Whatsaaaa Date: Thu, 12 Nov 2026 13:05:57 +0100 Subject: [PATCH 2/4] Move the test addresses that go with the country from Zagreb to Belgrade --- react-checkout/e2e/checkout.spec.ts | 14 +++++++------- react-checkout/server/app.test.ts | 6 +++--- vue-event-registration/e2e/registration.spec.ts | 12 ++++++------ .../src/registration/summary.test.ts | 12 ++++++------ 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/react-checkout/e2e/checkout.spec.ts b/react-checkout/e2e/checkout.spec.ts index 787459c..2a9798b 100644 --- a/react-checkout/e2e/checkout.spec.ts +++ b/react-checkout/e2e/checkout.spec.ts @@ -10,7 +10,7 @@ async function expectNoSidewaysScroll(page: Page) { expect(overflow).toBeLessThanOrEqual(0) } -/** Fills in an order that is valid: two mugs, shipped to Zagreb, paid by card. */ +/** Fills in an order that is valid: two mugs, shipped to Belgrade, paid by card. */ async function fillValidOrder(page: Page) { await page.getByRole('textbox', { name: 'Email' }).fill('jana@example.com') await page.getByRole('button', { name: 'Add an item' }).click() @@ -19,9 +19,9 @@ async function fillValidOrder(page: Page) { await item.getByLabel('Quantity').fill('2') await page.getByRole('radio', { name: /^Standard/ }).check() await page.getByLabel('Full name').fill('Jana Kovač') - await page.getByLabel('Street and number').fill('Ilica 1') - await page.getByLabel('Postal code').fill('10000') - await page.getByLabel('City').fill('Zagreb') + await page.getByLabel('Street and number').fill('Knez Mihailova 1') + await page.getByLabel('Postal code').fill('11000') + await page.getByLabel('City').fill('Belgrade') await page.getByLabel('Country').selectOption('Serbia') await page.getByRole('checkbox', { name: /terms of sale/ }).check() } @@ -75,9 +75,9 @@ test('places an order that the server validates and prices again', async ({ delivery: 'standard', shipping: { fullName: 'Jana Kovač', - street: 'Ilica 1', - zip: '10000', - city: 'Zagreb', + street: 'Knez Mihailova 1', + zip: '11000', + city: 'Belgrade', country: 'RS', }, paymentMethod: 'card', diff --git a/react-checkout/server/app.test.ts b/react-checkout/server/app.test.ts index d05bf30..dab4fff 100644 --- a/react-checkout/server/app.test.ts +++ b/react-checkout/server/app.test.ts @@ -17,9 +17,9 @@ const valid = { delivery: 'standard', shipping: { fullName: 'Jana Kovač', - street: 'Ilica 1', - zip: '10000', - city: 'Zagreb', + street: 'Knez Mihailova 1', + zip: '11000', + city: 'Belgrade', country: 'RS', }, paymentMethod: 'card', diff --git a/vue-event-registration/e2e/registration.spec.ts b/vue-event-registration/e2e/registration.spec.ts index 49bdafb..35f181b 100644 --- a/vue-event-registration/e2e/registration.spec.ts +++ b/vue-event-registration/e2e/registration.spec.ts @@ -96,9 +96,9 @@ test('registers a business attendee with guests, step by step', async ({ await expect(currentStep(page)).toHaveText(/Invoice/) await page.getByLabel('Company name').fill('Horvat d.o.o.') await page.getByLabel('VAT ID').fill('RS123456789') - await page.getByLabel('Street and number').fill('Ilica 1') - await page.getByLabel('City').fill('Zagreb') - await page.getByLabel('ZIP code').fill('10000') + await page.getByLabel('Street and number').fill('Knez Mihailova 1') + await page.getByLabel('City').fill('Belgrade') + await page.getByLabel('ZIP code').fill('11000') await page.getByLabel('Country').selectOption('Serbia') await expectNoSidewaysScroll(page) await next(page) @@ -144,9 +144,9 @@ test('registers a business attendee with guests, step by step', async ({ ], company: { name: 'Horvat d.o.o.', vatId: 'RS123456789' }, billingAddress: { - street: 'Ilica 1', - city: 'Zagreb', - zip: '10000', + street: 'Knez Mihailova 1', + city: 'Belgrade', + zip: '11000', country: 'RS', }, acceptTerms: true, diff --git a/vue-event-registration/src/registration/summary.test.ts b/vue-event-registration/src/registration/summary.test.ts index 88ad79e..295b90a 100644 --- a/vue-event-registration/src/registration/summary.test.ts +++ b/vue-event-registration/src/registration/summary.test.ts @@ -27,9 +27,9 @@ const input = { ], company: { name: 'Horvat d.o.o.' }, billingAddress: { - street: 'Ilica 1', - city: 'Zagreb', - zip: '10000', + street: 'Knez Mihailova 1', + city: 'Belgrade', + zip: '11000', country: 'RS', }, newsletter: false, @@ -75,9 +75,9 @@ describe('summarize', () => { label: 'Invoice', rows: [ { label: 'Company name', value: 'Horvat d.o.o.' }, - { label: 'Street and number', value: 'Ilica 1' }, - { label: 'City', value: 'Zagreb' }, - { label: 'ZIP code', value: '10000' }, + { label: 'Street and number', value: 'Knez Mihailova 1' }, + { label: 'City', value: 'Belgrade' }, + { label: 'ZIP code', value: '11000' }, { label: 'Country', value: 'Serbia' }, ], }, From 9c41874d9c309917173c045d32d5076f4b5ba937 Mon Sep 17 00:00:00 2001 From: Whatsaaaa Date: Thu, 12 Nov 2026 13:09:05 +0100 Subject: [PATCH 3/4] Ship the checkout from Belgrade and use a Serbian example phone number --- react-checkout/shared/i18n.ts | 4 ++-- vue-event-registration/e2e/registration.spec.ts | 6 +++--- vue-event-registration/src/registration/definition.json | 2 +- vue-event-registration/src/registration/definition.test.ts | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/react-checkout/shared/i18n.ts b/react-checkout/shared/i18n.ts index 65c8a44..798c57e 100644 --- a/react-checkout/shared/i18n.ts +++ b/react-checkout/shared/i18n.ts @@ -19,7 +19,7 @@ export function isLocale(value: unknown): value is Locale { const messages = { en: { 'app.title': 'Checkout', - 'app.lead': 'Paper goods, shipped from Zagreb.', + 'app.lead': 'Paper goods, shipped from Belgrade.', 'app.language': 'Language', 'app.loading': 'Loading the checkout...', 'app.loadFailed': "The checkout can't be loaded", @@ -109,7 +109,7 @@ const messages = { }, de: { 'app.title': 'Kasse', - 'app.lead': 'Papierwaren, verschickt aus Zagreb.', + 'app.lead': 'Papierwaren, verschickt aus Belgrad.', 'app.language': 'Sprache', 'app.loading': 'Die Kasse wird geladen...', 'app.loadFailed': 'Die Kasse kann nicht geladen werden', diff --git a/vue-event-registration/e2e/registration.spec.ts b/vue-event-registration/e2e/registration.spec.ts index 35f181b..4237b57 100644 --- a/vue-event-registration/e2e/registration.spec.ts +++ b/vue-event-registration/e2e/registration.spec.ts @@ -50,7 +50,7 @@ test('registers a business attendee with guests, step by step', async ({ /Confirm/, ]) await fillAboutYou(page, 'Business') - await page.getByRole('textbox', { name: 'Phone' }).fill('+385 91 234 5678') + await page.getByRole('textbox', { name: 'Phone' }).fill('+381 61 234 5678') await expect(stepLabels(page)).toHaveText([ /About you/, /Your visit/, @@ -130,7 +130,7 @@ test('registers a business attendee with guests, step by step', async ({ firstName: 'Ana', lastName: 'Horvat', email: 'ana@example.com', - phone: '+385 91 234 5678', + phone: '+381 61 234 5678', ticketType: 'business', arrival: '2027-05-10', departure: '2027-05-11', @@ -176,7 +176,7 @@ test('keeps the user on a step until its fields are valid', async ({ await expect(currentStep(page)).toHaveText(/About you/) await expect(page.getByText('Enter a valid email address')).toBeVisible() await expect( - page.getByText('Use digits and spaces, like +385 91 234 5678'), + page.getByText('Use digits and spaces, like +381 61 234 5678'), ).toBeVisible() await expect(page.getByText('Enter your student ID')).toBeVisible() await expect(page.getByText('Enter your first name')).toHaveCount(0) diff --git a/vue-event-registration/src/registration/definition.json b/vue-event-registration/src/registration/definition.json index a3f3638..cfe39c3 100644 --- a/vue-event-registration/src/registration/definition.json +++ b/vue-event-registration/src/registration/definition.json @@ -36,7 +36,7 @@ { "rule": "regex", "pattern": "^\\+?[0-9 ]{6,20}$", - "message": "Use digits and spaces, like +385 91 234 5678" + "message": "Use digits and spaces, like +381 61 234 5678" } ], "ui": { "autocomplete": "tel" } diff --git a/vue-event-registration/src/registration/definition.test.ts b/vue-event-registration/src/registration/definition.test.ts index a274f54..7888a0c 100644 --- a/vue-event-registration/src/registration/definition.test.ts +++ b/vue-event-registration/src/registration/definition.test.ts @@ -74,7 +74,7 @@ describe('the schema of the registration', () => { errorsOf({ ...valid, email: 'ana@example', phone: 'call me' }), ).toEqual({ email: ['Enter a valid email address'], - phone: ['Use digits and spaces, like +385 91 234 5678'], + phone: ['Use digits and spaces, like +381 61 234 5678'], }) }) From 18b9bb613124552e2abce21469ccdbd217987647 Mon Sep 17 00:00:00 2001 From: Whatsaaaa Date: Thu, 12 Nov 2026 13:12:25 +0100 Subject: [PATCH 4/4] Give the sample people and companies in the tests common Serbian names --- react-checkout/e2e/checkout.spec.ts | 20 ++++---- react-checkout/server/app.test.ts | 6 +-- react-checkout/shared/definition.test.ts | 2 +- .../e2e/registration.spec.ts | 46 +++++++++++-------- .../src/registration/definition.test.ts | 16 ++++--- .../src/registration/summary.test.ts | 27 ++++++----- 6 files changed, 66 insertions(+), 51 deletions(-) diff --git a/react-checkout/e2e/checkout.spec.ts b/react-checkout/e2e/checkout.spec.ts index 2a9798b..a7971dc 100644 --- a/react-checkout/e2e/checkout.spec.ts +++ b/react-checkout/e2e/checkout.spec.ts @@ -12,13 +12,13 @@ async function expectNoSidewaysScroll(page: Page) { /** Fills in an order that is valid: two mugs, shipped to Belgrade, paid by card. */ async function fillValidOrder(page: Page) { - await page.getByRole('textbox', { name: 'Email' }).fill('jana@example.com') + await page.getByRole('textbox', { name: 'Email' }).fill('jelena@example.com') await page.getByRole('button', { name: 'Add an item' }).click() const item = page.getByRole('region', { name: 'Item 1' }) await item.getByLabel('Product').selectOption('Ceramic mug') await item.getByLabel('Quantity').fill('2') await page.getByRole('radio', { name: /^Standard/ }).check() - await page.getByLabel('Full name').fill('Jana Kovač') + await page.getByLabel('Full name').fill('Jelena Jovanović') await page.getByLabel('Street and number').fill('Knez Mihailova 1') await page.getByLabel('Postal code').fill('11000') await page.getByLabel('City').fill('Belgrade') @@ -67,14 +67,14 @@ test('places an order that the server validates and prices again', async ({ // The total comes from the server, which worked it out from the validated order. await expect(page.getByText('Total paid: €42.40')).toBeVisible() expect(await confirmedOrder(page)).toEqual({ - email: 'jana@example.com', + email: 'jelena@example.com', lines: [ { product: 'mug', quantity: 2 }, { product: 'notebook', quantity: 1 }, ], delivery: 'standard', shipping: { - fullName: 'Jana Kovač', + fullName: 'Jelena Jovanović', street: 'Knez Mihailova 1', zip: '11000', city: 'Belgrade', @@ -104,7 +104,7 @@ test('stops an invalid order in the browser, before it reaches the server', asyn await expectNoSidewaysScroll(page) // The messages of rules: a format, a whole number in a range, a pattern. - await page.getByRole('textbox', { name: 'Email' }).fill('jana@example') + await page.getByRole('textbox', { name: 'Email' }).fill('jelena@example') await page.getByRole('button', { name: 'Add an item' }).click() await page.getByLabel('Quantity').fill('11') await page.getByLabel('Postal code').fill('ABC') @@ -141,7 +141,7 @@ test('shows the fields a condition asks for, and drops what it hides', async ({ await page.getByRole('radio', { name: /^Invoice/ }).check() await page.getByRole('button', { name: 'Place order' }).click() await expect(page.getByText('Enter the company name')).toBeVisible() - await page.getByLabel('Company name').fill('Kovač d.o.o.') + await page.getByLabel('Company name').fill('Jovanović d.o.o.') await page.getByRole('button', { name: 'Place order' }).click() await expect(page.getByText('Total paid: €28.00')).toBeVisible() @@ -149,7 +149,7 @@ test('shows the fields a condition asks for, and drops what it hides', async ({ delivery: 'pickup', shipping: {}, paymentMethod: 'invoice', - company: 'Kovač d.o.o.', + company: 'Jovanović d.o.o.', }) }) @@ -202,7 +202,7 @@ test('shows the server rejecting an order that got past the browser', async ({ test('speaks German in the browser and on the server, and keeps the input', async ({ page, }) => { - await page.getByRole('textbox', { name: 'Email' }).fill('jana@example') + await page.getByRole('textbox', { name: 'Email' }).fill('jelena@example') await page.getByRole('button', { name: 'Add an item' }).click() await page.getByLabel('Product').selectOption('Canvas tote bag') await page.getByLabel('Quantity').fill('3') @@ -211,7 +211,7 @@ test('speaks German in the browser and on the server, and keeps the input', asyn await page.getByRole('button', { name: 'Deutsch' }).click() await expect(page.getByRole('heading', { name: 'Kasse' })).toBeVisible() await expect(page.getByRole('textbox', { name: 'E-Mail' })).toHaveValue( - 'jana@example', + 'jelena@example', ) await expect(page.getByTestId('summary')).toContainText('3 x Stofftasche') await expect(page.getByTestId('summary')).toContainText('54,00 €') @@ -225,7 +225,7 @@ test('speaks German in the browser and on the server, and keeps the input', asyn await expect(page.getByText('Wählen Sie eine Lieferart')).toBeVisible() await expectNoSidewaysScroll(page) - await page.getByRole('textbox', { name: 'E-Mail' }).fill('jana@example.com') + await page.getByRole('textbox', { name: 'E-Mail' }).fill('jelena@example.com') await page.getByRole('radio', { name: /^Abholung/ }).check() await page.getByRole('checkbox', { name: /Verkaufsbedingungen/ }).check() diff --git a/react-checkout/server/app.test.ts b/react-checkout/server/app.test.ts index dab4fff..421c659 100644 --- a/react-checkout/server/app.test.ts +++ b/react-checkout/server/app.test.ts @@ -12,11 +12,11 @@ const app = createApp() /** An order that passes: one item, shipped, paid by card. */ const valid = { - email: 'jana@example.com', + email: 'jelena@example.com', lines: [{ product: 'mug', quantity: 2 }], delivery: 'standard', shipping: { - fullName: 'Jana Kovač', + fullName: 'Jelena Jovanović', street: 'Knez Mihailova 1', zip: '11000', city: 'Belgrade', @@ -79,7 +79,7 @@ describe('POST /api/orders', () => { it('rejects an order the browser would never send, in the language asked for', async () => { const tampered = { ...valid, - email: 'jana', + email: 'jelena', lines: [{ product: 'mug', quantity: 'many' }, { quantity: 11 }], shipping: { ...valid.shipping, zip: 'ABC' }, acceptTerms: false, diff --git a/react-checkout/shared/definition.test.ts b/react-checkout/shared/definition.test.ts index 3a3b24e..2b528c2 100644 --- a/react-checkout/shared/definition.test.ts +++ b/react-checkout/shared/definition.test.ts @@ -55,7 +55,7 @@ describe('the languages', () => { it('give the same schema its messages, each in its own words', () => { const input = { - email: 'jana', + email: 'jelena', lines: [], delivery: 'pickup', paymentMethod: 'card', diff --git a/vue-event-registration/e2e/registration.spec.ts b/vue-event-registration/e2e/registration.spec.ts index 4237b57..853a46e 100644 --- a/vue-event-registration/e2e/registration.spec.ts +++ b/vue-event-registration/e2e/registration.spec.ts @@ -29,9 +29,9 @@ async function fillAboutYou( page: Page, ticket: 'Standard' | 'Student' | 'Business', ) { - await page.getByRole('textbox', { name: 'First name' }).fill(' Ana ') - await page.getByRole('textbox', { name: 'Last name' }).fill('Horvat') - await page.getByRole('textbox', { name: 'Email' }).fill('ana@example.com') + await page.getByRole('textbox', { name: 'First name' }).fill(' Marko ') + await page.getByRole('textbox', { name: 'Last name' }).fill('Petrović') + await page.getByRole('textbox', { name: 'Email' }).fill('marko@example.com') await page.getByRole('radio', { name: new RegExp(`^${ticket}`) }).check() } @@ -80,21 +80,25 @@ test('registers a business attendee with guests, step by step', async ({ await expect(page.getByText('Nothing added yet.')).toBeVisible() await page.getByRole('button', { name: 'Add guest' }).click() const firstGuest = page.getByRole('region', { name: 'Guest 1' }) - await firstGuest.getByRole('textbox', { name: 'Name' }).fill('Ivo Horvat') + await firstGuest + .getByRole('textbox', { name: 'Name' }) + .fill('Nikola Petrović') await firstGuest .getByRole('textbox', { name: 'Email' }) - .fill('ivo@example.com') + .fill('nikola@example.com') // A new item starts with the defaults of its fields. await expect(firstGuest.getByLabel('Meal')).toHaveValue('0') await page.getByRole('button', { name: 'Add guest' }).click() const secondGuest = page.getByRole('region', { name: 'Guest 2' }) - await secondGuest.getByRole('textbox', { name: 'Name' }).fill('Mia Novak') + await secondGuest + .getByRole('textbox', { name: 'Name' }) + .fill('Milica Nikolić') await secondGuest.getByLabel('Meal').selectOption('Vegan') await expectNoSidewaysScroll(page) await next(page) await expect(currentStep(page)).toHaveText(/Invoice/) - await page.getByLabel('Company name').fill('Horvat d.o.o.') + await page.getByLabel('Company name').fill('Petrović d.o.o.') await page.getByLabel('VAT ID').fill('RS123456789') await page.getByLabel('Street and number').fill('Knez Mihailova 1') await page.getByLabel('City').fill('Belgrade') @@ -111,7 +115,7 @@ test('registers a business attendee with guests, step by step', async ({ await expect(summary).toContainText( 'Opening keynote, Hands-on forms workshop', ) - await expect(summary).toContainText('Mia Novak, Vegan') + await expect(summary).toContainText('Milica Nikolić, Vegan') await expect(summary).toContainText('Serbia') await expectNoSidewaysScroll(page) @@ -127,9 +131,9 @@ test('registers a business attendee with guests, step by step', async ({ (await page.getByTestId('output').textContent()) ?? '', ) as unknown expect(output).toEqual({ - firstName: 'Ana', - lastName: 'Horvat', - email: 'ana@example.com', + firstName: 'Marko', + lastName: 'Petrović', + email: 'marko@example.com', phone: '+381 61 234 5678', ticketType: 'business', arrival: '2027-05-10', @@ -139,10 +143,14 @@ test('registers a business attendee with guests, step by step', async ({ needsAssistance: true, assistanceDetails: 'Step-free access', guests: [ - { name: 'Ivo Horvat', email: 'ivo@example.com', meal: 'standard' }, - { name: 'Mia Novak', meal: 'vegan' }, + { + name: 'Nikola Petrović', + email: 'nikola@example.com', + meal: 'standard', + }, + { name: 'Milica Nikolić', meal: 'vegan' }, ], - company: { name: 'Horvat d.o.o.', vatId: 'RS123456789' }, + company: { name: 'Petrović d.o.o.', vatId: 'RS123456789' }, billingAddress: { street: 'Knez Mihailova 1', city: 'Belgrade', @@ -170,7 +178,7 @@ test('keeps the user on a step until its fields are valid', async ({ // The messages of rules, and of a field that only shows for a student ticket. await fillAboutYou(page, 'Student') - await page.getByRole('textbox', { name: 'Email' }).fill('ana@example') + await page.getByRole('textbox', { name: 'Email' }).fill('marko@example') await page.getByRole('textbox', { name: 'Phone' }).fill('call me') await next(page) await expect(currentStep(page)).toHaveText(/About you/) @@ -182,7 +190,7 @@ test('keeps the user on a step until its fields are valid', async ({ await expect(page.getByText('Enter your first name')).toHaveCount(0) // A failed step checks itself again as it is fixed. - await page.getByRole('textbox', { name: 'Email' }).fill('ana@example.com') + await page.getByRole('textbox', { name: 'Email' }).fill('marko@example.com') await expect(page.getByText('Enter a valid email address')).toHaveCount(0) await page.getByRole('textbox', { name: 'Phone' }).fill('') await page.getByLabel('Student ID').fill('ST-2027-01') @@ -218,11 +226,11 @@ test('keeps the user on a step until its fields are valid', async ({ await expect(currentStep(page)).toHaveText(/Guests/) await page.getByRole('button', { name: 'Add guest' }).click() const guest = page.getByRole('region', { name: 'Guest 1' }) - await guest.getByRole('textbox', { name: 'Email' }).fill('ana@example.com') + await guest.getByRole('textbox', { name: 'Email' }).fill('marko@example.com') await next(page) await expect(currentStep(page)).toHaveText(/Guests/) await expect(page.getByText("Enter the guest's name")).toBeVisible() - await guest.getByRole('textbox', { name: 'Name' }).fill('Ivo Horvat') + await guest.getByRole('textbox', { name: 'Name' }).fill('Nikola Petrović') await next(page) await expect(currentStep(page)).toHaveText(/Guests/) await expect( @@ -286,7 +294,7 @@ test('moves with Enter and with the step indicator', async ({ page }) => { await page.getByRole('button', { name: /About you/ }).click() await expect(currentStep(page)).toHaveText(/About you/) await expect(page.getByRole('textbox', { name: 'Last name' })).toHaveValue( - 'Horvat', + 'Petrović', ) // Going forward validates each step on the way, and stops at the first with errors. diff --git a/vue-event-registration/src/registration/definition.test.ts b/vue-event-registration/src/registration/definition.test.ts index 7888a0c..5e78a40 100644 --- a/vue-event-registration/src/registration/definition.test.ts +++ b/vue-event-registration/src/registration/definition.test.ts @@ -10,9 +10,9 @@ const schema = builder.build(definition) /** A registration that passes: a standard ticket with nothing optional. */ const valid = { - firstName: 'Ana', - lastName: 'Horvat', - email: 'ana@example.com', + firstName: 'Marko', + lastName: 'Petrović', + email: 'marko@example.com', ticketType: 'standard', arrival: '2027-05-10', departure: '2027-05-12', @@ -65,13 +65,17 @@ describe('the registration definition', () => { describe('the schema of the registration', () => { it('accepts a standard ticket, trims text and leaves out what is empty', () => { - const output = v.parse(schema, { ...valid, firstName: ' Ana ', phone: '' }) + const output = v.parse(schema, { + ...valid, + firstName: ' Marko ', + phone: '', + }) expect(output).toEqual(valid) }) it('reports the messages of the definition', () => { expect( - errorsOf({ ...valid, email: 'ana@example', phone: 'call me' }), + errorsOf({ ...valid, email: 'marko@example', phone: 'call me' }), ).toEqual({ email: ['Enter a valid email address'], phone: ['Use digits and spaces, like +381 61 234 5678'], @@ -115,7 +119,7 @@ describe('the schema of the registration', () => { }) it('checks each guest, and the size of the guest list', () => { - const guest = { name: 'Ivo Horvat', meal: 'vegan' } + const guest = { name: 'Nikola Petrović', meal: 'vegan' } expect( errorsOf({ ...valid, diff --git a/vue-event-registration/src/registration/summary.test.ts b/vue-event-registration/src/registration/summary.test.ts index 295b90a..98a86ce 100644 --- a/vue-event-registration/src/registration/summary.test.ts +++ b/vue-event-registration/src/registration/summary.test.ts @@ -12,9 +12,9 @@ function summaryOf(input: Record) { } const input = { - firstName: 'Ana', - lastName: 'Horvat', - email: 'ana@example.com', + firstName: 'Marko', + lastName: 'Petrović', + email: 'marko@example.com', ticketType: 'business', arrival: '2027-05-10', departure: '2027-05-12', @@ -22,10 +22,10 @@ const input = { workshopLevel: 'advanced', needsAssistance: false, guests: [ - { name: 'Ivo Horvat', email: 'ivo@example.com', meal: 'vegan' }, - { name: 'Mia Novak', meal: 'standard' }, + { name: 'Nikola Petrović', email: 'nikola@example.com', meal: 'vegan' }, + { name: 'Milica Nikolić', meal: 'standard' }, ], - company: { name: 'Horvat d.o.o.' }, + company: { name: 'Petrović d.o.o.' }, billingAddress: { street: 'Knez Mihailova 1', city: 'Belgrade', @@ -42,9 +42,9 @@ describe('summarize', () => { id: 'you', label: 'About you', rows: [ - { label: 'First name', value: 'Ana' }, - { label: 'Last name', value: 'Horvat' }, - { label: 'Email', value: 'ana@example.com' }, + { label: 'First name', value: 'Marko' }, + { label: 'Last name', value: 'Petrović' }, + { label: 'Email', value: 'marko@example.com' }, { label: 'Ticket', value: 'Business - 490 EUR, with an invoice' }, ], }, @@ -66,15 +66,18 @@ describe('summarize', () => { id: 'guests', label: 'Guests', rows: [ - { label: 'Guest 1', value: 'Ivo Horvat, ivo@example.com, Vegan' }, - { label: 'Guest 2', value: 'Mia Novak, Standard' }, + { + label: 'Guest 1', + value: 'Nikola Petrović, nikola@example.com, Vegan', + }, + { label: 'Guest 2', value: 'Milica Nikolić, Standard' }, ], }, { id: 'invoice', label: 'Invoice', rows: [ - { label: 'Company name', value: 'Horvat d.o.o.' }, + { label: 'Company name', value: 'Petrović d.o.o.' }, { label: 'Street and number', value: 'Knez Mihailova 1' }, { label: 'City', value: 'Belgrade' }, { label: 'ZIP code', value: '11000' },