Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Commit

Permalink
Update: test snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
MadanKumarGovindaswamy committed May 23, 2024
1 parent e9ce422 commit 445b31f
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 2 deletions.
9 changes: 8 additions & 1 deletion packages/terra-hyperlink/tests/jest/Hyperlink.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,18 @@ describe('Hyperlink', () => {
expect(wrapper).toMatchSnapshot();
});

it('should render a hyperlink button when oonClick is provided', () => {
it('should render a hyperlink button when onClick is provided', () => {
const wrapper = enzymeIntl.renderWithIntl(<Hyperlink text="Default hyperlink button" onClick={() => {}} />);
expect(wrapper).toMatchSnapshot();
});

it('should render a default hyperlink button with data styling attribute', () => {
const wrapper = enzymeIntl.renderWithIntl(<Hyperlink text="Default hyperlink button" onClick={() => {}} />);
expect(wrapper.find('data-focus-styles-enabled')).toBeDefined();
expect(wrapper.prop('data-focus-styles-enabled')).toEqual("true");

Check failure on line 66 in packages/terra-hyperlink/tests/jest/Hyperlink.test.jsx

View workflow job for this annotation

GitHub Actions / build

Strings must use singlequote
expect(wrapper).toMatchSnapshot();
});

it('correctly applies the theme context className', () => {
const wrapper = enzymeIntl.mountWithIntl(
<ThemeContextProvider theme={{ className: 'orion-fusion-theme' }}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,25 @@ exports[`Hyperlink should render a default hyperlink 1`] = `
</a>
`;

exports[`Hyperlink should render a default hyperlink button with data styling attribute 1`] = `
<button
class="button-reset hyperlink default"
data-focus-styles-enabled="true"
role="link"
type="button"
>
<span
class="button-inner"
>
<span
class="inner-text"
>
Default hyperlink button
</span>
</span>
</button>
`;

exports[`Hyperlink should render a disabled hyperlink 1`] = `
<a
aria-disabled="true"
Expand Down Expand Up @@ -229,7 +248,7 @@ exports[`Hyperlink should render a external hyperlink 1`] = `
</a>
`;

exports[`Hyperlink should render a hyperlink button when oonClick is provided 1`] = `
exports[`Hyperlink should render a hyperlink button when onClick is provided 1`] = `
<button
class="button-reset hyperlink default"
data-focus-styles-enabled="true"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 445b31f

Please sign in to comment.