-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(test) O3-3939: Add test to repeat component #385
base: main
Are you sure you want to change the base?
Conversation
@WodPachua are you still working on this? |
Was trying to add another/more tests... had made the draft for your review if am on the right track |
src/components/repeat/repeat.test.ts
Outdated
it('Should update field ID in expressions when adding repeated fields', () => { | ||
const expression = "infantStatus !== 'someValue'"; | ||
const fieldIds = ['birthDate', 'infantStatus', 'deathDate']; | ||
const updatedExpression = updateFieldIdInExpression(expression, 2, fieldIds); | ||
|
||
expect(updatedExpression).toEqual("infantStatus_2 !== 'someValue'"); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@WodPachua I like the test but the scope of work begs for testing the repeat component itself and not just the helpers. You want to render a form with a "repeatable" field, and then test out things like:
- Asserting that clicking the "Add" button clones the field at origin
- Test out submission (Assert that both the origin and its instances' values are submitted successfully)
- Edit mode (Assert that a repeat field with instances is properly initialised (hydrated) as expected)
@WodPachua are you still working on this? |
|
Have already noted the changes proposed on slack |
@WodPachua you probably want to do something like this. |
Requirements
Summary
Added test to the repeat component in the form engine
Screenshots
Related Issue
O3-3939
Other