Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Convert enzyme to rtl: BeaconMarker #9840

Merged
merged 15 commits into from
Jan 4, 2023

Conversation

artcodespace
Copy link
Contributor

@artcodespace artcodespace commented Dec 28, 2022

Converts enzyme to rtl. The final test has some reasonably aggressive mocking in it to try and keep the sense of the enzyme test it replaces, there may be a better way to do this

Checklist

  • Tests written for new code (and old code if feasible)
  • Linter and other CI checks pass
  • Sign-off given on the changes (see CONTRIBUTING.md)

This change is marked as an internal change (Task), so will not be included in the changelog.

@artcodespace artcodespace added the T-Task Refactoring, enabling or disabling functionality, other engineering tasks label Dec 28, 2022
});

it("updates with new locations", () => {
// we need to mock the SmartMarker here to be able to check the geoUris
const uriSmartMarker = jest.spyOn(mockSmartMarker, "default");
uriSmartMarker.mockImplementation((props) => <div data-testid={props.geoUri} />);
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you spy on maplibregl.Marker.setLngLat to assert the uri is updated instead of this? Similar to how the SmartMarker tests work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll have a look at that, thanks for the suggestion. It didn't feel good doing this and I'm in a similar scenario trying to rewrite another test

@germain-gg germain-gg removed their request for review December 30, 2022 07:56
@artcodespace artcodespace merged commit 3bcea5f into develop Jan 4, 2023
@artcodespace artcodespace deleted the alunturner/enzyme-to-rtl-beacon-marker branch January 4, 2023 10:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Task Refactoring, enabling or disabling functionality, other engineering tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants