[MISC][GZ] shared dirty state test suite and render helper - #633
[MISC][GZ] shared dirty state test suite and render helper#633ghazwan-gt wants to merge 1 commit into
Conversation
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| export const labelTestSuite = (renderComponent: (overrideField?: any) => void) => |
There was a problem hiding this comment.
qn: why does the param need to be changed from unknown to any? unknown seems to work fine without type errors
| import { warningTestSuite } from "../../../common/tests/warnings"; | ||
| import { dirtyStateTestSuite } from "../../../common/tests"; |
There was a problem hiding this comment.
could we include warnings in the barrel index and combine the imports?
| baseSchema: { | ||
| referenceKey: UI_TYPE, | ||
| src: IFRAME_SRC, | ||
| }, |
There was a problem hiding this comment.
hmm I don't see much savings here since we have to redeclare the schema, and it feels a little awkward that to reference the full schema we have to access it from renderComponent.schema. could we still retain the common JSON_SCHEMA in the spec file and pass that wholesale to createRenderComponent?
not sure if there are other patterns I missed!
|
|
||
| expect(formIsDirty).toBe(false); | ||
| }); | ||
| dirtyStateTestSuite({ |
There was a problem hiding this comment.
I see that this was applied for phone but not email, why is that the case?
Changes
dirtyStateTestSuiteandcreateRenderComponentutils to reduce boilerplate across field integration testsChecklist