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
PPL Sosial
tbcare
tbcare-web
Commits
d4a1d22d
Commit
d4a1d22d
authored
May 30, 2021
by
Nabilah Adani
Browse files
[RED] change test for information export pdf
parent
3310736c
Pipeline
#79827
failed with stages
in 1 minute and 25 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/scenes/Home/components/ExportPDFButton/index.test.tsx
View file @
d4a1d22d
...
...
@@ -7,18 +7,22 @@ const dummyImage = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASoAAAEsCAYAAA
describe
(
'
<ExportPDFButton />
'
,
()
=>
{
it
(
'
should render correctly
'
,
()
=>
{
shallow
(<
ExportPDFButton
png
=
{
dummyImage
}
type
=
{
''
}
selectedKey
=
{
''
}
dataType
=
{
''
}
chartType
=
{
true
}
information
=
{
''
}
clickable
=
{
false
}
/>);
})
it
(
'
should call downloadAsPDF
'
,
()
=>
{
const
mod
=
require
(
'
../../utilities/utils
'
);
jest
.
spyOn
(
mod
,
'
downloadAsPDF
'
);
const
btn
=
shallow
(<
ExportPDFButton
png
=
{
dummyImage
}
type
=
{
''
}
selectedKey
=
{
''
}
dataType
=
{
''
}
chartType
=
{
true
}
information
=
{
''
}
clickable
=
{
false
}
/>);
btn
.
find
(
'
Button
'
).
simulate
(
'
click
'
);
expect
(
mod
.
downloadAsPDF
).
toHaveBeenCalled
();
...
...
src/scenes/Home/components/Statistic/index.test.tsx
View file @
d4a1d22d
...
...
@@ -48,7 +48,7 @@ describe('<Statistic />', () => {
}
};
it
(
'
render diagram statistics without crashing
'
,
()
=>
{
it
(
'
render diagram statistics without crashing
'
,
()
=>
{
mount
(
<
AppContext
.
Provider
value
=
{
testProps
}
>
<
Statistic
...
...
@@ -60,7 +60,7 @@ describe('<Statistic />', () => {
);
});
it
(
'
render table statistics without crashing
'
,
()
=>
{
it
(
'
render table statistics without crashing
'
,
()
=>
{
mount
(
<
AppContext
.
Provider
value
=
{
testProps
}
>
<
Statistic
...
...
@@ -72,7 +72,7 @@ describe('<Statistic />', () => {
);
});
it
(
'
render table age statistics without crashing
'
,
()
=>
{
it
(
'
render table age statistics without crashing
'
,
()
=>
{
mount
(
<
AppContext
.
Provider
value
=
{
testProps
}
>
<
Statistic
...
...
@@ -84,8 +84,7 @@ describe('<Statistic />', () => {
);
});
it
(
'
render sex stats chart successfully
'
,
()
=>
{
mount
(
it
(
'
render sex stats chart successfully
'
,
()
=>
{
<
AppContext
.
Provider
value
=
{
testProps
}
>
<
Statistic
isTable
=
{
false
}
...
...
@@ -96,7 +95,7 @@ describe('<Statistic />', () => {
);
});
it
(
'
render kasus in time range stats chart successfully
'
,
()
=>
{
it('render kasus in time range stats chart successfully', () =>
{
mount
(
<
AppContext
.
Provider
value
=
{
testProps
}
>
<
Statistic
...
...
@@ -108,7 +107,7 @@ describe('<Statistic />', () => {
);
}
);
it
(
'
sets ignoreDateRange state after clicking ignoreDateRange button
'
,
()
=>
{
it('sets ignoreDateRange
Statistics
state after clicking ignoreDateRange button', () =>
{
const
wrapper
=
mount
(<
Statistic
isTable
=
{
false
}
type
=
{
StatisticType
.
Date
}
...
...
@@ -118,9 +117,22 @@ describe('<Statistic />', () => {
expect
(
wrapper
.
find
(
Checkbox
).
props
().
isChecked
).
toBe
(
false
);
wrapper
.
find
(
Checkbox
).
simulate
(
'
click
'
);
expect
(
wrapper
.
find
(
Checkbox
).
props
().
isChecked
).
toBe
(
true
);
})
}
);
it('sets ignoreDateRangeFilter age after clicking ignoreDateRange button', () =>
{
const
wrapper
=
mount
(<
Statistic
isTable
=
{
false
}
type
=
{
StatisticType
.
Age
}
data
=
{
statisticData
.
age
}
/>);
expect
(
wrapper
.
find
(
Checkbox
).
props
().
isChecked
).
toBe
(
false
);
wrapper
.
find
(
Checkbox
).
simulate
(
'
click
'
);
expect
(
wrapper
.
find
(
Checkbox
).
props
().
isChecked
).
toBe
(
true
);
}
);
it
(
'
render table district in time range stats chart successfully
'
,
()
=>
{
it('render table district in time range stats chart successfully', () =>
{
mount
(
<
AppContext
.
Provider
value
=
{
testProps
}
>
<
Statistic
...
...
@@ -132,7 +144,7 @@ describe('<Statistic />', () => {
);
}
);
it
(
'
sets ignoreDateRangeTable false state after clicking ignoreDateRangeTable button
'
,
()
=>
{
it('sets ignoreDateRangeTable false state after clicking ignoreDateRangeTable button', () =>
{
const
wrapper
=
mount
(<
Statistic
isTable
=
{
true
}
type
=
{
StatisticType
.
Date
}
...
...
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