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
00b94a14
Commit
00b94a14
authored
May 24, 2021
by
doanandreas
Browse files
[GREEN] add further testing for profile diet recommendation
parent
11c94481
Pipeline
#78625
passed with stages
in 28 minutes and 13 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/__mocks__/clientList.ts
0 → 100644
View file @
00b94a14
import
{
UserRole
}
from
'
services/auth/models
'
;
import
{
Client
}
from
'
services/profiles/models
'
;
export
const
mockClientList
:
Client
[]
=
[
{
user
:
{
id
:
1
,
name
:
'
Doan Di Dinding
'
,
email
:
'
doan@dinding.com
'
,
role
:
UserRole
.
CLIENT
,
},
diet_profile_id
:
1
,
diet_questionnaire_id
:
1
,
diet_recommendation_id
:
1
,
},
];
src/scenes/questionnaire/ProfileDietRecommendation/index.test.tsx
View file @
00b94a14
import
React
from
'
react
'
;
import
{
render
}
from
'
utils/testing
'
;
import
{
render
,
waitFor
}
from
'
utils/testing
'
;
import
*
as
ROUTES
from
'
constants/routes
'
;
import
ProfileDietRecommendation
from
'
.
'
;
jest
.
mock
(
'
react-native-toast-message
'
);
jest
.
mock
(
'
axios
'
);
jest
.
mock
(
'
react-native-document-picker
'
);
describe
(
'
ProfileDietRecommendation
'
,
()
=>
{
it
(
'
renders correctly
'
,
()
=>
{
render
(<
ProfileDietRecommendation
/>,
ROUTES
.
profileDietRecommendation
,
{
...
...
@@ -13,4 +17,23 @@ describe('ProfileDietRecommendation', () => {
},
});
});
it
(
'
shows correct name
'
,
async
()
=>
{
const
{
queryByText
}
=
render
(
<
ProfileDietRecommendation
/>,
ROUTES
.
profileDietRecommendation
,
{
routeParams
:
{
name
:
'
Doan
'
,
id
:
1
,
},
},
);
await
waitFor
(()
=>
expect
(
queryByText
(
/Rekomendasi/i
)).
toBeTruthy
());
});
afterAll
(()
=>
{
jest
.
clearAllMocks
();
});
});
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