Skip to content
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

chore: bump planx-core (multiple schemas support) #4206

Merged
merged 12 commits into from
Jan 30, 2025

Conversation

jessicamcinchak
Copy link
Member

@jessicamcinchak jessicamcinchak commented Jan 24, 2025

Relies on theopensystemslab/planx-core#629

Testing:
I've pre-loaded some submitted session data from staging onto this pizza so that we can easily review sample payloads using the following admin endpoints:

Other schema-dependent editor features to review on the pizza:

  • When adding a FileUpload or FileUploadAndLabel component, it's data field has autocomplete suggestions from the schema
  • Publish validation checks for unsupported file or project types are working as expected

Copy link

github-actions bot commented Jan 24, 2025

Removed vultr server and associated DNS entries

@jessicamcinchak jessicamcinchak marked this pull request as ready for review January 27, 2025 16:58
@jessicamcinchak jessicamcinchak requested a review from a team January 27, 2025 17:00
} else {
nodeIds?.map(([nodeId, _nodeData]) => nodeId);
return nodeIds?.map(([nodeId, _nodeData]) => nodeId)?.length;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are unrelated to the most recent planx-core change, but came across them when investigating why the validate.test.ts tests were still passing without a mock in this module - spotted a data field issue & additionally added test coverage ! (Data field issue does not impact current live usage of these helper functions, but likely would have cropped up next time we try to use elsewhere!)

.fn()
.mockImplementation(() => ["ldc", "ldc.p", "ldc.e", "pp", "pa"]),
};
});
Copy link
Member Author

@jessicamcinchak jessicamcinchak Jan 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These mocks resolve questions raised earlier here: https://opensystemslab.slack.com/archives/C01E3AC0C03/p1737996349338569

When testing the route via supertest, then getValidSchemaValues and planx-core will be called "for real" and not require a mock (eg see modules/flows/validate/validate.test.ts >> describe("ODP Schema file type validation on diff"), but when simply unit testing like here we need to mock & include partial, realistic mockImplementation return values.

Boolean(props.type !== TextInputType.Short && characterCountLimit);
const displayCharacterCount = Boolean(
props.type !== TextInputType.Short && characterCountLimit,
);
Copy link
Member Author

@jessicamcinchak jessicamcinchak Jan 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are linting changes only picked up below here after a rebase to main - sorry for extra noise !

Copy link
Contributor

@DafyddLlyr DafyddLlyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally took a look at the planx-core PR, all looking good. One key comment here which is worth mulling over maybe - theopensystemslab/planx-core#629 (comment)

Done a code-only review, all looking great ✅

Working through the testing notes now, will update PR when done.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appreciate the extra coverage here 👍

Comment on lines +27 to +28
if (type === ComponentType.Answer) {
return nodeIds.some(([, nodeData]) => nodeData?.data?.val === fn);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch 👍

Copy link
Contributor

@DafyddLlyr DafyddLlyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All testing notes above (thank you!) covered and getting expected results ✅

@jessicamcinchak jessicamcinchak merged commit 16a0361 into main Jan 30, 2025
13 checks passed
@jessicamcinchak jessicamcinchak deleted the jess/bump-planx-core-3b39b02 branch January 30, 2025 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants