Skip to content

Commit

Permalink
fix(admin-ui): write test for all Gluu custom base UI components #290
Browse files Browse the repository at this point in the history
  • Loading branch information
syntrydy committed Nov 2, 2021
1 parent d0f1cc2 commit 144dabf
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
26 changes: 26 additions & 0 deletions app/routes/Apps/Gluu/Tests/GluuSecretDetail.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from 'react'
import GluuSecretDetail from '../GluuSecretDetail'
import { render, screen } from '@testing-library/react'
import i18n from '../../../../i18n'
import { I18nextProvider } from 'react-i18next'

it('Test GluuSecretDetail component', () => {
const LABEL = 'fields.application_type'
const VALUE = 'computer'
render(
<I18nextProvider i18n={i18n}>
<GluuSecretDetail
doc_category="openid_client"
doc_entry="applicationType"
value={VALUE}
up
label={LABEL}
/>
</I18nextProvider>,
)
screen.getByText(/Application Type:/)
screen.getByText('The OpenID connect Client application type.')
expect(
screen.getByText('The OpenID connect Client application type.'),
).toHaveAttribute('data-id', 'tooltip')
})
6 changes: 5 additions & 1 deletion app/routes/Apps/Gluu/Tests/GluuTypeAheadWithAdd.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { I18nextProvider } from 'react-i18next'

it('Test GluuTypeAheadWithAdd component', () => {
const LABEL = 'fields.application_type'
const NAME = 'application_type'
const NAME = 'applicationType'
const VALUE = ['Monday']
const OPTIONS = ['Monday', 'Tuesday']
render(
Expand All @@ -24,4 +24,8 @@ it('Test GluuTypeAheadWithAdd component', () => {
screen.getByText('Add')
screen.getByText('Remove')
screen.getByText(VALUE[0])
screen.getByText('The OpenID connect Client application type.')
expect(
screen.getByText('The OpenID connect Client application type.'),
).toHaveAttribute('data-id', 'tooltip')
})

0 comments on commit 144dabf

Please sign in to comment.