Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions e2e/davinci-app/components/object-value.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,17 @@ export default function objectValueComponent(
formEl.appendChild(buttonEl);
}
} else {
const inputId = `phone-number-input-${collector.output.key}`;

const phoneLabel = document.createElement('label');
phoneLabel.textContent = collector.output.label || 'Phone Number';
phoneLabel.className = 'object-options-title';
phoneLabel.setAttribute('for', 'phone-number-input');
phoneLabel.setAttribute('for', inputId);

const phoneInput = document.createElement('input');
phoneInput.setAttribute('type', 'tel');
phoneInput.setAttribute('id', 'phone-number-input');
phoneInput.setAttribute('name', 'phone-number-input');
phoneInput.setAttribute('id', inputId);
phoneInput.setAttribute('name', inputId);
phoneInput.setAttribute('placeholder', 'Enter phone number');

// Add change event listener
Expand Down
8 changes: 6 additions & 2 deletions e2e/davinci-suites/src/form-fields.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test('Should render form fields', async ({ page }) => {
await page.locator('#combobox-field-key-3').check();
await page.locator('#combobox-field-key-2').uncheck();

await page.locator('#phone-number-input').fill('1234567890');
await page.getByLabel('Phone', { exact: true }).fill('1234567890');

await expect(page.getByRole('button', { name: 'Flow Button' })).toBeVisible();
await expect(page.getByRole('button', { name: 'Flow Link' })).toBeVisible();
Expand All @@ -53,9 +53,13 @@ test('Should render form fields', async ({ page }) => {
'radio-group-key': 'option2 value',
'combobox-field-key': ['option1 value', 'option3 value'],
'phone-field': {
phoneNumber: '1234567890',
phoneNumber: '(555)555-1234',
countryCode: 'GB',
},
'phone-field1': {
phoneNumber: '1234567890',
countryCode: 'CR',
},
});
});

Expand Down
Loading