Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
PPL Sosial
tbcare
tbcare-web
Commits
0b607fe8
Commit
0b607fe8
authored
Jun 06, 2021
by
Nabilah Adani
Browse files
[RED] added new unit test in utils
parent
5b54f8de
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/scenes/Home/components/ExportPDFButton/index.test.tsx
View file @
0b607fe8
...
...
@@ -11,7 +11,8 @@ describe('<ExportPDFButton />', () => {
selectedKey
=
{
''
}
dataType
=
{
''
}
chartType
=
{
true
}
information
=
{
''
}
totalCount
=
{
''
}
information
=
{
[
0
,
1
]
}
clickable
=
{
false
}
/>);
})
it
(
'
should call downloadAsPDF
'
,
()
=>
{
...
...
@@ -22,7 +23,8 @@ describe('<ExportPDFButton />', () => {
selectedKey
=
{
''
}
dataType
=
{
''
}
chartType
=
{
true
}
information
=
{
''
}
totalCount
=
{
''
}
information
=
{
[
0
,
1
]
}
clickable
=
{
false
}
/>);
btn
.
find
(
'
Button
'
).
simulate
(
'
click
'
);
expect
(
mod
.
downloadAsPDF
).
toHaveBeenCalled
();
...
...
src/scenes/Home/utilities/utils.test.tsx
View file @
0b607fe8
import
{
translate
}
from
'
./utils
'
import
{
translate
,
translateTypetoKey
,
translateToMonth
,
translateChartType
}
from
'
./utils
'
describe
(
'
utils
'
,
()
=>
{
it
(
'
translates jenis kelamin
'
,
()
=>
{
const
ret_val
=
translate
(
"
male
"
);
expect
(
ret_val
).
toEqual
(
"
Pria
"
);
})
it
(
'
translates tipe data
'
,
()
=>
{
const
ret_val
=
translateTypetoKey
(
"
Kecamata
"
);
expect
(
ret_val
).
toEqual
(
"
district
"
);
})
it
(
'
translates bulan
'
,
()
=>
{
const
ret_val
=
translateToMonth
(
"
01
"
);
expect
(
ret_val
).
toEqual
(
"
Januari
"
);
})
it
(
'
translates tipe chart
'
,
()
=>
{
const
ret_val
=
translateChartType
(
false
);
expect
(
ret_val
).
toEqual
(
"
Bar
"
);
})
})
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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