-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(admin-ui): write test for all Gluu custom base UI components #290
- Loading branch information
Showing
3 changed files
with
22 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
jest.spyOn(global.console, 'log').mockImplementation(jest.fn()); | ||
jest.spyOn(global.console, 'warn').mockImplementation(jest.fn()); | ||
import '@testing-library/jest-dom' | ||
|
||
it('Jans-admin UI test setup', () => { | ||
}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from 'react' | ||
import { render, screen } from '@testing-library/react' | ||
import GluuTooltip from '../GluuTooltip' | ||
import i18n from '../../../../i18n' | ||
import { I18nextProvider } from 'react-i18next' | ||
|
||
it('Test gluutooltip', () => { | ||
render( | ||
<I18nextProvider i18n={i18n}> | ||
<GluuTooltip doc_category="openid_client" doc_entry="applicationType"> | ||
<p>A custom component</p> | ||
</GluuTooltip> | ||
</I18nextProvider>, | ||
) | ||
screen.getByText('A custom component') | ||
screen.getByText('The OpenID connect Client application type.') | ||
expect( | ||
screen.getByText('The OpenID connect Client application type.'), | ||
).toHaveAttribute('data-id', 'tooltip') | ||
}) |