-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Oleksii Kurinnyi <[email protected]>
- Loading branch information
Showing
11 changed files
with
142 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright (c) 2018-2023 Red Hat, Inc. | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
*/ | ||
|
||
import '@testing-library/jest-dom'; | ||
|
||
import React from 'react'; | ||
|
||
jest.mock('@patternfly/react-core', () => { | ||
return { | ||
...jest.requireActual('@patternfly/react-core'), | ||
// mock the Tooltip component from @patternfly/react-core | ||
Tooltip: jest.fn(props => { | ||
const { content, children, ...rest } = props; | ||
return ( | ||
<div data-testid="patternfly-tooltip"> | ||
<span data-testid="tooltip-props">{JSON.stringify(rest)}</span> | ||
<div data-testid="tooltip-content">{content}</div> | ||
<div data-testid="tooltip-placed-to">{children}</div> | ||
</div> | ||
); | ||
}), | ||
}; | ||
}); | ||
|
||
jest.mock('@/components/CheTooltip', () => { | ||
return { | ||
CheTooltip: jest.fn(props => { | ||
return React.createElement('div', null, props.children, props.content); | ||
}), | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 22 additions & 5 deletions
27
...board-frontend/src/components/CheTooltip/__tests__/__snapshots__/CheTooltip.spec.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,27 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`CheTooltip component should render CheTooltip component correctly 1`] = ` | ||
<div> | ||
some text | ||
<span> | ||
Tooltip text. | ||
exports[`CheTooltip component snapshot 1`] = ` | ||
<div | ||
data-testid="patternfly-tooltip" | ||
> | ||
<span | ||
data-testid="tooltip-props" | ||
> | ||
{"isContentLeftAligned":true,"style":{"border":"1px solid","borderRadius":"3px","opacity":"0.9"}} | ||
</span> | ||
<div | ||
data-testid="tooltip-content" | ||
> | ||
<span> | ||
Tooltip text. | ||
</span> | ||
</div> | ||
<div | ||
data-testid="tooltip-placed-to" | ||
> | ||
<div> | ||
some text | ||
</div> | ||
</div> | ||
</div> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.