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

feat: Remove duplicated Destination enums, add Send test coverage #3843

Merged
merged 7 commits into from
Oct 25, 2024

Conversation

DafyddLlyr
Copy link
Contributor

@DafyddLlyr DafyddLlyr commented Oct 24, 2024

What does this PR do?

Also...

Picked up a few associated refactors in the frontend Send component, alongside adding some test coverage for the Send component.

What's the motivation here?

As part of the GOSS integration I'm aiming to write some docs on "how to set up a send integration". This work is aiming to simplify this process so that it hopefully boils down to just the following -

  • Add to SendIntegration array in planx-core
  • Write API to handle integration
  • Add secrets
  • Add label in planx-new Editor component

Hopefully then TypeScript will do a lot of the heavy lifting for the places where there are references to SendIntegrations that need to be updated.

There's still some room for improvement here I think - there's repeated logic in a few places still, but I'll pick up additional changes in another PR if they feel necessary. This is a big enough PR for now!

@DafyddLlyr DafyddLlyr changed the title dp/integrations single source of truth feat: Remove duplicated SendDestination enums, add Send test coverage Oct 24, 2024
@DafyddLlyr DafyddLlyr changed the title feat: Remove duplicated SendDestination enums, add Send test coverage feat: Remove duplicated Destination enums, add Send test coverage Oct 24, 2024
const url = `${
import.meta.env.VITE_APP_API_URL
}/create-send-events/${sessionId}`;
const request: any = useAsync(async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This any was the cause of a bug where event ids are not logged to the breadcrumb.

The list below has request.value.bops, request.value.uniform etc, but it should be request.value.data.bops, request.value.data.uniform etc

Copy link

github-actions bot commented Oct 24, 2024

Removed vultr server and associated DNS entries

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These ids will be UUIDs, just correctly updating mock here.

@DafyddLlyr DafyddLlyr marked this pull request as ready for review October 24, 2024 09:13
Copy link
Member

@jessicamcinchak jessicamcinchak left a comment

Choose a reason for hiding this comment

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

Nice simplifications throughout here, thanks !

Code looks good, but I admittedly have not tried manual submissions for each destination on the pizza - are we trusting E2E coverage there or waiting until staging or what do you think?

breadcrumbs: {
findProperty: {
data: {
"property.localAuthorityDistrict": ["Some local authority district"]
Copy link
Member

@jessicamcinchak jessicamcinchak Oct 24, 2024

Choose a reason for hiding this comment

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

nit: more realistic mock here would be ["Buckinghamshire", "Historic district name"] - eg because I think we want to confirm we are correctly filtering modern council name out of property.localAuthorityDistrict array !

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah of course - very good catch - best to be as explicit and through as possible here.

Updated in 480d86b

bopsSendEventId: hasuraEventsResponseMock.bops.event_id,
uniformSendEventId: hasuraEventsResponseMock.uniform.event_id,
}));
});
Copy link
Member

Choose a reason for hiding this comment

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

Test coverage is long overdue, clear & thorough here, thank you!!

@DafyddLlyr
Copy link
Contributor Author

Code looks good, but I admittedly have not tried manual submissions for each destination on the pizza - are we trusting E2E coverage there or waiting until staging or what do you think?

Likewise - I've not manually tested each submission here, just the event creation which this should only be touching.

I've got a good degree of confidence that current test coverage is good here 👍

@DafyddLlyr DafyddLlyr merged commit 812faf7 into main Oct 25, 2024
12 checks passed
@DafyddLlyr DafyddLlyr deleted the dp/integrations-single-source-of-truth branch October 25, 2024 10:24
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