Skip to content

Conversation

@anandaroop
Copy link
Member

@anandaroop anandaroop commented Oct 20, 2023

The type of this PR is: Test

Decided to split this from #13041 (comment) so that I can get this on main and then include it in that PR.

Description

This takes some patterns for working with artwork filters in a react-testing-library friendly way and extracts them into shared helpers.

This was introduced in the original RTL spike for the SizeFilter spec, copied over to the KeywordFilter spec and now will be used for the ArtistSeriesFilter spec as well.

Seems like a good time to extract and document this shareable code.

@anandaroop anandaroop self-assigned this Oct 20, 2023
@anandaroop anandaroop force-pushed the anandaroop/refactor-artwork-filter-testing branch from ed91e2f to ce57784 Compare October 20, 2023 15:19
Copy link
Member Author

Choose a reason for hiding this comment

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

Decided to keep these helpers in src/Components/ArtworkFilter instead of src/DevTools because if its limited applicability to just this part of the codebase.

Comment on lines -18 to -19
// FIXME: SWC_COMPILER_MIGRATION
it.skip("updates context on filter change", () => {
Copy link
Member Author

Choose a reason for hiding this comment

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

Looks like these specs were skipped in this commit — but I found that they were green and ran in tens of milliseconds, so seems fine to un-pend this. cc @damassi

Comment on lines +13 to +15
/**
* A test helper that can be used to render components that depend
* on an enclosing `ArtworkFilterContext`.
Copy link
Member Author

Choose a reason for hiding this comment

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

Tried to get some good intellisense going…

Screenshot 2023-10-20 at 11 28 31 AM

@anandaroop
Copy link
Member Author

Going for it, so I can keep #13041 moving…

@anandaroop anandaroop merged commit 8de9660 into main Oct 20, 2023
@anandaroop anandaroop deleted the anandaroop/refactor-artwork-filter-testing branch October 20, 2023 18:05
@artsy-peril artsy-peril bot mentioned this pull request Oct 20, 2023
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