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
2021
Kelas D
PT Gizi Sehat - Dietela
Dietela Mobile
Commits
53cccfa8
Commit
53cccfa8
authored
May 17, 2021
by
Doan Andreas Nathanael
Browse files
[RED] add test for params to diet recom form
parent
9c0cb6c5
Changes
1
Show whitespace changes
Inline
Side-by-side
src/scenes/questionnaire/ReadOnlyDietProfile/index.test.tsx
View file @
53cccfa8
import
React
from
'
react
'
;
import
{
render
}
from
'
utils/testing
'
;
import
{
render
,
waitFor
}
from
'
utils/testing
'
;
import
*
as
ROUTES
from
'
constants/routes
'
;
import
axios
from
'
axios
'
;
import
ReadOnlyDietProfile
from
'
.
'
;
import
{
mockDietQuestionnaire
}
from
'
__mocks__/dietQuestionnaire
'
;
jest
.
useFakeTimers
();
jest
.
mock
(
'
axios
'
);
const
mockAxios
=
axios
as
jest
.
Mocked
<
typeof
axios
>
;
describe
(
'
ReadOnlyDietProfile
'
,
()
=>
{
it
(
'
renders correctly
'
,
()
=>
{
render
(<
ReadOnlyDietProfile
/>,
ROUTES
.
clientProfileNutritionist
,
{
routeParams
:
mockDietQuestionnaire
,
});
});
it
(
'
shows "Klien belum mengisi diet questionnaire" text if no questionnaire answer is provided yet
'
,
()
=>
{
const
{
getByText
}
=
render
(
<
ReadOnlyDietProfile
/>,
...
...
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