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
2021
Kelas D
Justika - Pengembangan Platform untuk UMKM
Justika UMKM Legal - Frontend
Commits
7cf4cb30
Commit
7cf4cb30
authored
Mar 29, 2021
by
Shafiya Adzhani
Browse files
[CHORES] fix lint and format issue
parent
92efad18
Pipeline
#67455
passed with stages
in 4 minutes and 56 seconds
Changes
9
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
package-lock.json
View file @
7cf4cb30
This diff is collapsed.
Click to expand it.
package.json
View file @
7cf4cb30
...
...
@@ -8,6 +8,8 @@
"
@testing-library/react
"
:
"
^11.2.5
"
,
"
@testing-library/user-event
"
:
"
^12.8.1
"
,
"
autoprefixer
"
:
"
^10.2.5
"
,
"
axios
"
:
"
^0.21.1
"
,
"
msw
"
:
"
^0.28.0
"
,
"
postcss
"
:
"
^8.2.8
"
,
"
react
"
:
"
^17.0.1
"
,
"
react-dom
"
:
"
^17.0.1
"
,
...
...
src/App.js
View file @
7cf4cb30
import
Homepage
from
'
./pages/homepage
'
import
Register
from
"
./components/Registrasi/Register
"
;
import
Login
from
"
./components/Autentikasi/Login
"
;
import
{
Router
}
from
"
@reach/router
"
;
import
Register
from
'
./components/Registrasi/Register
'
import
{
Router
}
from
'
@reach/router
'
function
App
()
{
return
(
...
...
@@ -9,10 +8,9 @@ function App() {
<
Router
>
<
Homepage
path
=
"
/
"
/>
<
Register
path
=
"
/register
"
/>
<
Login
path
=
"
/login
"
/>
<
/Router
>
<
/div
>
)
;
)
}
export
default
App
src/App.test.js
View file @
7cf4cb30
...
...
@@ -12,7 +12,9 @@ test('renders Navbar Element', () => {
test
(
'
renders Hero
'
,
()
=>
{
render
(
<
App
/>
)
const
titleElement
=
screen
.
getByText
(
/Stop Legal Platform/i
)
const
subtitle1Element
=
screen
.
getByText
(
/Untuk para pelaku usaha kecil dan menengah./i
)
const
subtitle1Element
=
screen
.
getByText
(
/Untuk para pelaku usaha kecil dan menengah./i
,
)
const
subtitle2Element
=
screen
.
getByText
(
/Aman, Mudah, Terjangkau!/i
)
expect
(
titleElement
).
toBeInTheDocument
()
expect
(
subtitle1Element
).
toBeInTheDocument
()
...
...
src/components/Card/Card.js
View file @
7cf4cb30
...
...
@@ -6,10 +6,15 @@ const Card = ({index, image, title, text, url}) => {
<
div
className
=
{
`flex flex-col justify-between bg-white px-5 py-6 rounded-xl
${
index
!=
2
&&
'
lg:mr-11 xl:mr-11 2xl:mr-11
'
}
shadow-lg`
}
data
-
testid
=
{
`card-
${
index
}
`
}
}
shadow-lg`
}
data
-
testid
=
{
`card-
${
index
}
`
}
>
<
div
>
<
img
className
=
"
mb-2.5
"
data
-
testid
=
{
`card-img-
${
index
}
`
}
src
=
{
image
}
><
/img
>
<
img
className
=
"
mb-2.5
"
data
-
testid
=
{
`card-img-
${
index
}
`
}
src
=
{
image
}
><
/img
>
<
h1
className
=
"
heading-3 mb-7
"
>
{
title
}
<
/h1
>
<
/div
>
<
div
>
...
...
src/components/Registrasi/Register.js
View file @
7cf4cb30
...
...
@@ -250,7 +250,7 @@ const Register = () => {
<
div
className
=
"
flex flex-col py-4
"
>
<
p
className
=
"
regular-text text-center
"
>
Dengan
menekan
tombol
’
Daftar
’
,
Anda
telah
membaca
dan
Dengan
menekan
tombol
&
quot
;
Daftar
&
quot
;
,
Anda
telah
membaca
dan
menyetujui
<
span
className
=
"
text-popblue font-semibold
"
>
{
'
'
}
...
...
src/components/Registrasi/Register.test.js
View file @
7cf4cb30
...
...
@@ -216,7 +216,7 @@ test('register error if confirm password does not match with password', async ()
test
(
'
can click toggle mask password to show or hide password
'
,
async
()
=>
{
render
(
<
Register
/>
)
fireEvent
.
click
(
screen
.
getByTestId
(
'
hide-password
'
))
const
maskPassword
=
await
screen
.
getByTestId
(
'
password-input
'
)
const
maskPassword
=
screen
.
getByTestId
(
'
password-input
'
)
expect
(
maskPassword
.
type
).
toBe
(
'
text
'
)
fireEvent
.
click
(
screen
.
getByTestId
(
'
show-password
'
))
expect
(
maskPassword
.
type
).
toBe
(
'
password
'
)
...
...
@@ -225,7 +225,7 @@ test('can click toggle mask password to show or hide password', async () => {
test
(
'
can click toggle mask confirm password to show or hide password
'
,
async
()
=>
{
render
(
<
Register
/>
)
fireEvent
.
click
(
screen
.
getByTestId
(
'
hide-confirm-password
'
))
const
maskPassword
=
await
screen
.
getByTestId
(
'
confirm-password-input
'
)
const
maskPassword
=
screen
.
getByTestId
(
'
confirm-password-input
'
)
expect
(
maskPassword
.
type
).
toBe
(
'
text
'
)
fireEvent
.
click
(
screen
.
getByTestId
(
'
show-confirm-password
'
))
expect
(
maskPassword
.
type
).
toBe
(
'
password
'
)
...
...
@@ -237,14 +237,6 @@ test('data is sent to the server', async () => {
rest
.
post
(
'
http://localhost:8000/api/v1/auth/register/
'
,
(
req
,
res
,
ctx
)
=>
{
const
userData
=
[
{
email
:
'
sigendud@email.com
'
,
phone_number
:
'
89520998871
'
,
password
:
'
akusehat01
'
,
confirm_password
:
'
akusehat01
'
,
},
]
return
res
(
ctx
.
status
(
200
),
ctx
.
json
({
message
:
'
Akun berhasil terdaftar
'
}),
...
...
@@ -254,14 +246,6 @@ test('data is sent to the server', async () => {
rest
.
post
(
'
http://localhost:8000/api/v1/auth/register/
'
,
(
req
,
res
,
ctx
)
=>
{
const
userData
=
[
{
email
:
'
sigendud@email.com
'
,
phone_number
:
'
89520998871
'
,
password
:
'
akusehat01
'
,
confirm_password
:
'
akusehat01
'
,
},
]
return
res
(
ctx
.
status
(
400
),
ctx
.
json
({
password
:
'
account with this email already exists.
'
}),
...
...
src/index.css
View file @
7cf4cb30
body
{
margin
:
0
;
font-family
:
-apple-system
,
BlinkMacSystemFont
,
"
Segoe UI
"
,
"
Roboto
"
,
"
Oxygen
"
,
"
Ubuntu
"
,
"
Cantarell
"
,
"
Fira Sans
"
,
"
Droid Sans
"
,
"
Helvetica Neue
"
,
font-family
:
-apple-system
,
BlinkMacSystemFont
,
'
Segoe UI
'
,
'
Roboto
'
,
'
Oxygen
'
,
'
Ubuntu
'
,
'
Cantarell
'
,
'
Fira Sans
'
,
'
Droid Sans
'
,
'
Helvetica Neue
'
,
sans-serif
;
-webkit-font-smoothing
:
antialiased
;
-moz-osx-font-smoothing
:
grayscale
;
}
code
{
font-family
:
source-code-pro
,
Menlo
,
Monaco
,
Consolas
,
"
Courier New
"
,
font-family
:
source-code-pro
,
Menlo
,
Monaco
,
Consolas
,
'
Courier New
'
,
monospace
;
}
src/pages/homepage.js
View file @
7cf4cb30
...
...
@@ -14,7 +14,7 @@ const Homepage = ({location}) => {
if
(
location
?.
state
)
{
toast
.
success
(
location
.
state
.
message
)
}
},
[])
},
[
location
])
return
(
<
div
data
-
testid
=
"
homepage
"
>
...
...
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