Skip to content

Commit

Permalink
fix: checkbox never optional
Browse files Browse the repository at this point in the history
fix: remove logging
  • Loading branch information
pbullhove committed Jan 10, 2024
1 parent 805d987 commit 985d9de
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion e2e/tests/plugin-default_recipe.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ test('Form default DMSS UI Recipe', async ({ page }) => {
await expect(page.getByLabel('A required string')).toHaveValue(
'This form has no dedicated UI Recipe'
)
await expect(page.getByLabel('An optional checkbox (Optional)')).toBeVisible()
await expect(page.getByLabel('An optional checkbox')).toBeVisible()
await expect(page.getByLabel('date')).toHaveValue('2023-10-17T13:30')
await expect(page.getByTestId('form-submit')).toBeVisible()
})
Expand Down
4 changes: 1 addition & 3 deletions e2e/tests/plugin-form-ReadOnlyPrimitives.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ test('Read only primitives', async ({ page }) => {

await expect(page.getByLabel('Integer only (Optional)')).not.toBeEditable()

await expect(
page.getByLabel('An optional checkbox (Optional)')
).not.toBeEditable()
await expect(page.getByLabel('An optional checkbox')).not.toBeEditable()

await expect(
page.getByLabel('A required checbox (e.g. for confirmation purposes)')
Expand Down
6 changes: 2 additions & 4 deletions e2e/tests/plugin-form-Simple.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ test('Simple form', async ({ page }) => {
})

await test.step('Check checkbox', async () => {
await page.getByLabel('An optional checkbox (Optional)').check()
await page.getByLabel('An optional checkbox').check()
//await page.getByTestId('form-submit').click()
// await expect(page.getByText('<Field is mandatory>')).toBeVisible() //Known bug (itemid:37251754)
await page
Expand All @@ -57,9 +57,7 @@ test('Simple form', async ({ page }) => {
await expect(page.getByLabel('Required string')).toHaveValue('Foo')
await expect(page.getByLabel('Numbers only (Optional)')).toHaveValue('3.14')
await expect(page.getByLabel('Integer only (Optional)')).toHaveValue('123')
await expect(
page.getByLabel('An optional checkbox (Optional)')
).toBeChecked()
await expect(page.getByLabel('An optional checkbox')).toBeChecked()
await expect(
page.getByLabel('A required checkbox (e.g. for confirmation purposes)')
).toBeChecked()
Expand Down
1 change: 0 additions & 1 deletion packages/dm-core-plugins/src/form/fields/StringField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export const StringField = (props: TField) => {
const Widget = getWidget(uiAttribute?.widget ?? 'TextWidget')
const { config } = useRegistryContext()
const readOnly = uiAttribute?.readOnly || config.readOnly
console.log(uiAttribute)
return (
<Controller
name={namePath}
Expand Down

0 comments on commit 985d9de

Please sign in to comment.