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(CodeBlock): update tests #9546

Merged
merged 3 commits into from
Oct 6, 2023
Merged

chore(CodeBlock): update tests #9546

merged 3 commits into from
Oct 6, 2023

Conversation

jenny-s51
Copy link
Contributor

What: Closes #9533

@patternfly-build
Copy link
Contributor

patternfly-build commented Aug 29, 2023

const { asFragment } = render(<CodeBlockAction>action</CodeBlockAction>);
expect(asFragment()).toMatchSnapshot();
});
test('CodeBlock content renders with class pf-v5-c-code-block__content by default', () => {
Copy link
Contributor

@tlabaj tlabaj Sep 5, 2023

Choose a reason for hiding this comment

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

Can you follow what Adam is doing in his PR for updating our test to not have hard coded styles. This will make it easier when updating versions of PF classes in the future.

Copy link
Contributor

@thatblindgeye thatblindgeye left a comment

Choose a reason for hiding this comment

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

Just some comments below, can we also add tests for:

  • in CodeBlock, that passing actions works (could just pass a div with a simple string and check that the string renders)
  • basic snapshot tests for CodeBlockAction and CodeBlockCode
  • In CodeBlockCode, that the pf-v5-c-code-block__pre class renders by default and that className being passed works

@tlabaj tlabaj merged commit 274db5b into patternfly:main Oct 6, 2023
10 checks passed
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.

Code block test revamp
4 participants