-
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
56 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react' | ||
import { render, screen } from '@testing-library/react' | ||
import GluuAppSidebar from '../GluuAppSidebar' | ||
import i18n from '../../../../i18n' | ||
import { I18nextProvider } from 'react-i18next' | ||
|
||
it('Should show the sidebar properly', () => { | ||
/* const scopes = [] | ||
render( | ||
<I18nextProvider i18n={i18n}> | ||
<GluuAppSidebar scopes={scopes} /> | ||
</I18nextProvider>, | ||
) | ||
screen.getByText('Sign out') | ||
*/ | ||
}) | ||
|
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,18 @@ | ||
import React from 'react' | ||
import { render, screen } from '@testing-library/react' | ||
import GluuInput from '../GluuInput' | ||
import i18n from '../../../../i18n' | ||
import { I18nextProvider } from 'react-i18next' | ||
|
||
it('Should show the input with proper text', () => { | ||
const LABEL = 'fields.application_type' | ||
const NAME = 'application_type' | ||
const VALUE = 'Public' | ||
render( | ||
<I18nextProvider i18n={i18n}> | ||
<GluuInput label={LABEL} value={VALUE} name={NAME} /> | ||
</I18nextProvider>, | ||
) | ||
screen.getByText('Application Type:') | ||
expect(screen.getByDisplayValue(VALUE).id).toBe(NAME) | ||
}) |
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,21 @@ | ||
import React from 'react' | ||
import { render, screen } from '@testing-library/react' | ||
import GluuInputRow from '../GluuInputRow' | ||
import i18n from '../../../../i18n' | ||
import { I18nextProvider } from 'react-i18next' | ||
import { Formik } from 'formik' | ||
|
||
it('Should show the input with proper text', () => { | ||
const LABEL = 'fields.application_type' | ||
const NAME = 'application_type' | ||
const VALUE = 'Public' | ||
function handler(){ | ||
} | ||
render( | ||
<I18nextProvider i18n={i18n}> | ||
<GluuInputRow label={LABEL} value={VALUE} name={NAME} handler={handler} formik={handler}/> | ||
</I18nextProvider>, | ||
) | ||
screen.getByText('Application Type:') | ||
expect(screen.getByDisplayValue(VALUE).id).toBe(NAME) | ||
}) |