Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@MariaAga
Copy link
Member

removed render multiple fills as its tested in other tests in the file

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the Slot.test.js test suite from enzyme/IntegrationTestHelper to React Testing Library (RTL). The refactoring modernizes the testing approach by replacing snapshot tests with more maintainable query-based assertions.

Key Changes

  • Migrated all test cases from enzyme to React Testing Library
  • Removed snapshot-based assertions in favor of RTL queries (findByText, queryByText, getByText)
  • Removed the "render multiple fills" test as it's covered by other tests in the suite

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
Slot.test.js Refactored test suite to use RTL, replacing enzyme mounts and snapshots with async queries and DOM assertions
Slot.test.js.snap Removed entire snapshot file as tests no longer rely on snapshots

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 89 to +96
it('default slot', () => {
const wrapper = integrationTestHelper.mount(
renderWithStore(
<Slot id="slot-4" multi>
<SlotComponent text="Default Value" />
</Slot>
);

wrapper.update();
expect(wrapper.find('Slot')).toMatchSnapshot();
expect(screen.getByText('Default Value')).toBeInTheDocument();
Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

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

The test 'default slot' should be marked as async since it may need to wait for React state updates, or it should use 'await screen.findByText' instead of 'screen.getByText' for consistency with other tests. Using 'getByText' synchronously may cause flakiness if the component takes time to render.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

I dont think this change is needed

Copy link
Contributor

@adamlazik1 adamlazik1 left a comment

Choose a reason for hiding this comment

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

LGTM. I don't have permissions to merge but I from my side it is ready to be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.