File tree 3 files changed +56
-0
lines changed
app/routes/Apps/Gluu/Tests
3 files changed +56
-0
lines changed Original file line number Diff line number Diff line change
1
+ import React from 'react'
2
+ import { render , screen } from '@testing-library/react'
3
+ import GluuAppSidebar from '../GluuAppSidebar'
4
+ import i18n from '../../../../i18n'
5
+ import { I18nextProvider } from 'react-i18next'
6
+
7
+ it ( 'Should show the sidebar properly' , ( ) => {
8
+ /* const scopes = []
9
+ render(
10
+ <I18nextProvider i18n={i18n}>
11
+ <GluuAppSidebar scopes={scopes} />
12
+ </I18nextProvider>,
13
+ )
14
+ screen.getByText('Sign out')
15
+ */
16
+ } )
17
+
Original file line number Diff line number Diff line change
1
+ import React from 'react'
2
+ import { render , screen } from '@testing-library/react'
3
+ import GluuInput from '../GluuInput'
4
+ import i18n from '../../../../i18n'
5
+ import { I18nextProvider } from 'react-i18next'
6
+
7
+ it ( 'Should show the input with proper text' , ( ) => {
8
+ const LABEL = 'fields.application_type'
9
+ const NAME = 'application_type'
10
+ const VALUE = 'Public'
11
+ render (
12
+ < I18nextProvider i18n = { i18n } >
13
+ < GluuInput label = { LABEL } value = { VALUE } name = { NAME } />
14
+ </ I18nextProvider > ,
15
+ )
16
+ screen . getByText ( 'Application Type:' )
17
+ expect ( screen . getByDisplayValue ( VALUE ) . id ) . toBe ( NAME )
18
+ } )
Original file line number Diff line number Diff line change
1
+ import React from 'react'
2
+ import { render , screen } from '@testing-library/react'
3
+ import GluuInputRow from '../GluuInputRow'
4
+ import i18n from '../../../../i18n'
5
+ import { I18nextProvider } from 'react-i18next'
6
+ import { Formik } from 'formik'
7
+
8
+ it ( 'Should show the input with proper text' , ( ) => {
9
+ const LABEL = 'fields.application_type'
10
+ const NAME = 'application_type'
11
+ const VALUE = 'Public'
12
+ function handler ( ) {
13
+ }
14
+ render (
15
+ < I18nextProvider i18n = { i18n } >
16
+ < GluuInputRow label = { LABEL } value = { VALUE } name = { NAME } handler = { handler } formik = { handler } />
17
+ </ I18nextProvider > ,
18
+ )
19
+ screen . getByText ( 'Application Type:' )
20
+ expect ( screen . getByDisplayValue ( VALUE ) . id ) . toBe ( NAME )
21
+ } )
You can’t perform that action at this time.
0 commit comments