Fakultas Ilmu Komputer UI

Commit 7cf4cb30 authored by Shafiya Adzhani's avatar Shafiya Adzhani
Browse files

[CHORES] fix lint and format issue

parent 92efad18
Pipeline #67455 passed with stages
in 4 minutes and 56 seconds
This diff is collapsed.
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
......@@ -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()
......
......@@ -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>
......
......@@ -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">
{' '}
......
......@@ -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.'}),
......
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;
}
......@@ -14,7 +14,7 @@ const Homepage = ({location}) => {
if (location?.state) {
toast.success(location.state.message)
}
}, [])
}, [location])
return (
<div data-testid="homepage">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment