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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

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

Pizza

Deployed 864376b to https://4206.planx.pizza.

Useful links:

@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 !

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.

1 participant