Skip to content

Commit 144dabf

Browse files
committed
fix(admin-ui): write test for all Gluu custom base UI components #290
1 parent d0f1cc2 commit 144dabf

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import React from 'react'
2+
import GluuSecretDetail from '../GluuSecretDetail'
3+
import { render, screen } from '@testing-library/react'
4+
import i18n from '../../../../i18n'
5+
import { I18nextProvider } from 'react-i18next'
6+
7+
it('Test GluuSecretDetail component', () => {
8+
const LABEL = 'fields.application_type'
9+
const VALUE = 'computer'
10+
render(
11+
<I18nextProvider i18n={i18n}>
12+
<GluuSecretDetail
13+
doc_category="openid_client"
14+
doc_entry="applicationType"
15+
value={VALUE}
16+
up
17+
label={LABEL}
18+
/>
19+
</I18nextProvider>,
20+
)
21+
screen.getByText(/Application Type:/)
22+
screen.getByText('The OpenID connect Client application type.')
23+
expect(
24+
screen.getByText('The OpenID connect Client application type.'),
25+
).toHaveAttribute('data-id', 'tooltip')
26+
})

app/routes/Apps/Gluu/Tests/GluuTypeAheadWithAdd.test.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { I18nextProvider } from 'react-i18next'
66

77
it('Test GluuTypeAheadWithAdd component', () => {
88
const LABEL = 'fields.application_type'
9-
const NAME = 'application_type'
9+
const NAME = 'applicationType'
1010
const VALUE = ['Monday']
1111
const OPTIONS = ['Monday', 'Tuesday']
1212
render(
@@ -24,4 +24,8 @@ it('Test GluuTypeAheadWithAdd component', () => {
2424
screen.getByText('Add')
2525
screen.getByText('Remove')
2626
screen.getByText(VALUE[0])
27+
screen.getByText('The OpenID connect Client application type.')
28+
expect(
29+
screen.getByText('The OpenID connect Client application type.'),
30+
).toHaveAttribute('data-id', 'tooltip')
2731
})

0 commit comments

Comments
 (0)