Skip to content

chore(CodeBlock): update tests#9546

Merged
tlabaj merged 3 commits intopatternfly:mainfrom
jenny-s51:iss9533
Oct 6, 2023
Merged

chore(CodeBlock): update tests#9546
tlabaj merged 3 commits intopatternfly:mainfrom
jenny-s51:iss9533

Conversation

@jenny-s51
Copy link
Copy Markdown
Contributor

What: Closes #9533

@patternfly-build
Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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
Copy Markdown
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

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