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
pilar
pilar-web
Commits
47a4ed35
Commit
47a4ed35
authored
Jun 07, 2021
by
Shella Gabriella
Browse files
[GREEN] Menambahkan pesan & harga hampers pada transaksi
parent
bea21f3c
Pipeline
#82030
passed with stages
in 4 minutes and 26 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/__test__/transaksi/DetailTransaksi.test.js
deleted
100644 → 0
View file @
bea21f3c
import
{
cleanup
,
render
}
from
"
@testing-library/react
"
;
import
AuthContext
from
"
../../utils/contex
"
;
import
React
from
"
react
"
;
import
DetailTransaksi
from
"
../../page/transaksi/DetailTransaksi
"
;
import
{
waitFor
}
from
"
@testing-library/dom
"
;
beforeEach
(()
=>
{
fetch
.
resetMocks
();
});
afterEach
(
cleanup
);
test
(
"
Test detail loaded transaksi
"
,
async
()
=>
{
fetch
.
mockResponseOnce
(
JSON
.
stringify
({
id
:
"
8e9a8f94-cb5c-4b2d-b4f1-81ccfb9f1b0a
"
,
transaction_number
:
"
7NGVBN
"
,
user
:
"
45897cc5-968c-44cf-931d-e646b095fcaf
"
,
user_username
:
"
admin-staging
"
,
program
:
"
6d7462da-6a85-4e2b-9930-69567090a5d5
"
,
program_code
:
"
3MXZ9T
"
,
user_full_name
:
"
Hello
"
,
user_phone_number
:
"
012345
"
,
program_name
:
"
dummy 2
"
,
hampers_messages
:
""
,
hampers_price
:
"
0.00
"
,
created_at
:
"
2020-04-28T21:34:15.565614+07:00
"
,
updated_at
:
"
2020-04-28T21:34:15.565651+07:00
"
,
})
);
const
{
getByTestId
}
=
render
(
<
AuthContext
.
Provider
value
=
{{
profile
:
{
token
:
"
tester
"
}
}}
>
<
DetailTransaksi
idTransaksi
=
{
"
8e9a8f94-cb5c-4b2d-b4f1-81ccfb9f1b0a
"
}
/>
<
/AuthContext.Provider>
);
const
wait
=
getByTestId
(
"
waiting-detail-transaksi
"
);
expect
(
wait
.
textContent
).
toContain
(
"
Fetching data..
"
);
await
waitFor
(()
=>
getByTestId
(
"
page-detail-transaksi
"
));
const
data
=
getByTestId
(
"
page-detail-transaksi
"
);
expect
(
data
.
textContent
).
toContain
(
"
KELOLA TRANSAKSI
"
);
});
src/page/donasi/DetailDonasiUang.jsx
View file @
47a4ed35
...
...
@@ -53,9 +53,7 @@ const DetailDonasiUang = ({ idDonasi }) => {
display: flex;
margin: 2rem 3rem 3rem 3rem;
flex-direction: column;
justify-content: space-around;
height: 75vh;
padding-top: 100px;
`
}
>
{
error
&&
<
ErrorDiv
>
Something error
</
ErrorDiv
>
}
...
...
src/page/transaksi/DetailTransaksi.jsx
View file @
47a4ed35
...
...
@@ -320,7 +320,9 @@ const DetailTransaksi = ({ idTransaksi }) => {
<
TableRow
>
<
TableCell
>
Kode Produk
</
TableCell
>
<
TableCell
>
Nama Produk
</
TableCell
>
<
TableCell
>
Pesan (Hampers)
</
TableCell
>
<
TableCell
>
Kuantitas
</
TableCell
>
<
TableCell
>
Biaya Hampers
</
TableCell
>
<
TableCell
>
Harga Produk
</
TableCell
>
<
TableCell
>
Subtotal
</
TableCell
>
</
TableRow
>
...
...
@@ -332,7 +334,9 @@ const DetailTransaksi = ({ idTransaksi }) => {
<
Link
to
=
{
`/produk/
${
row
.
product
}
`
}
>
{
row
.
product_code
}
</
Link
>
</
TableCell
>
<
TableCell
>
{
row
.
product_name
}
</
TableCell
>
<
TableCell
>
{
row
.
hampers_messages
}
</
TableCell
>
<
TableCell
>
{
row
.
quantity
}
</
TableCell
>
<
TableCell
>
{
stringToCurrency
(
row
.
hampers_price
)
}
</
TableCell
>
<
TableCell
>
{
stringToCurrency
(
row
.
product_price
)
}
</
TableCell
>
<
TableCell
>
{
stringToCurrency
(
...
...
@@ -342,7 +346,7 @@ const DetailTransaksi = ({ idTransaksi }) => {
</
TableRow
>
))
}
<
TableRow
>
<
TableCell
rowSpan
=
{
3
}
colSpan
=
{
3
}
/>
<
TableCell
rowSpan
=
{
3
}
colSpan
=
{
5
}
/>
<
TableCell
align
=
"left"
colSpan
=
{
1
}
>
Donasi
</
TableCell
>
...
...
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