Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
2021
Kelas D
Justika - Pengembangan Platform untuk UMKM
Justika UMKM Legal - Frontend
Commits
8be24a1f
Commit
8be24a1f
authored
Apr 26, 2021
by
Lia Yuliana
Browse files
[RED] add handleSubmit and onSubmit test for Form IUMK 3
parent
09b8377d
Pipeline
#72867
passed with stages
in 11 minutes and 24 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/components/FormIUMK/FormIUMK3.test.js
View file @
8be24a1f
...
...
@@ -3,6 +3,9 @@ import FormIUMK3 from './FormIUMK3'
import
{
testRender
,
makeTestStore
}
from
'
../../testUtils
'
test
(
'
renders FormIUMK3 Element
'
,
()
=>
{
const
handleSubmit
=
jest
.
fn
()
const
onSubmit
=
jest
.
fn
()
const
data
=
{
nama
:
'
PT UUN
'
,
alamat
:
'
Jakarta
'
,
...
...
@@ -13,7 +16,10 @@ test('renders FormIUMK3 Element', () => {
catatan
:
null
,
}
const
store
=
makeTestStore
()
testRender
(
<
FormIUMK3
data
=
{
data
}
/>, {store}
)
testRender
(
<
FormIUMK3
data
=
{
data
}
handleSubmit
=
{
handleSubmit
}
onSubmit
=
{
onSubmit
}
/>
,
{
store
},
)
expect
(
screen
.
getByTestId
(
'
form-iumk-3
'
)).
toBeInTheDocument
()
// Test label
...
...
@@ -48,6 +54,9 @@ test('renders FormIUMK3 Element', () => {
})
test
(
'
renders FormIUMK3 Element with catatan
'
,
()
=>
{
const
handleSubmit
=
jest
.
fn
()
const
onSubmit
=
jest
.
fn
()
const
data
=
{
nama
:
'
PT UUN
'
,
alamat
:
'
Jakarta
'
,
...
...
@@ -58,7 +67,10 @@ test('renders FormIUMK3 Element with catatan', () => {
catatan
:
'
Contoh catatan
'
,
}
const
store
=
makeTestStore
()
testRender
(
<
FormIUMK3
data
=
{
data
}
/>, {store}
)
testRender
(
<
FormIUMK3
data
=
{
data
}
handleSubmit
=
{
handleSubmit
}
onSubmit
=
{
onSubmit
}
/>
,
{
store
},
)
expect
(
screen
.
getByTestId
(
'
form-iumk-3
'
)).
toBeInTheDocument
()
expect
(
screen
.
getByTestId
(
'
form-iumk-3-input-catatan
'
)).
toBeInTheDocument
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment