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
Fasilkom UI Open Source Software
Kape
Commits
dafdd8b5
Commit
dafdd8b5
authored
Mar 29, 2017
by
M. Reza Qorib
Browse files
[#140654507] #12 Refactor component name
parent
b9ec122f
Changes
4
Hide whitespace changes
Inline
Side-by-side
assets/js/__test__/components/ApplyModal-test.jsx
View file @
dafdd8b5
/* eslint-disable no-unused-expressions */
import
React
from
'
react
'
;
import
ReactTestUtils
from
'
react-addons-test-utils
'
;
import
Modal
Pendaftaran
from
'
../../components/ApplyModal
'
;
import
Apply
Modal
from
'
../../components/ApplyModal
'
;
describe
(
'
ApplyModal
'
,
()
=>
{
it
(
'
renders without problem
'
,
()
=>
{
const
modalPendaftaran
=
ReactTestUtils
.
renderIntoDocument
(
<
Appl
icanc
yModal
id
=
{
4
}
data
=
{
{
key
:
'
value
'
}
}
buttonTitle
=
"submit"
/>);
<
ApplyModal
id
=
{
4
}
data
=
{
{
key
:
'
value
'
}
}
buttonTitle
=
"submit"
/>);
expect
(
modalPendaftaran
).
to
.
exist
;
});
it
(
'
open without problem
'
,
()
=>
{
const
modalPendaftaran
=
ReactTestUtils
.
renderIntoDocument
(
<
Appl
icanc
yModal
id
=
{
4
}
data
=
{
{
key
:
'
value
'
}
}
buttonTitle
=
"submit"
/>);
<
ApplyModal
id
=
{
4
}
data
=
{
{
key
:
'
value
'
}
}
buttonTitle
=
"submit"
/>);
const
modal
=
ReactTestUtils
.
findRenderedDOMComponentWithTag
(
modalPendaftaran
,
'
Button
'
);
ReactTestUtils
.
Simulate
.
click
(
modal
);
...
...
assets/js/components/ApplyModal.jsx
View file @
dafdd8b5
...
...
@@ -2,7 +2,7 @@ import React from 'react';
import
{
Modal
,
Button
,
Icon
,
TextArea
,
Form
}
from
'
semantic-ui-react
'
;
import
ModalAlert
from
'
./ModalAlert
'
;
export
default
class
Apl
icanc
yModal
extends
React
.
Component
{
export
default
class
Ap
p
lyModal
extends
React
.
Component
{
static
propTypes
=
{
data
:
React
.
PropTypes
.
object
.
isRequired
,
id
:
React
.
PropTypes
.
number
.
isRequired
,
...
...
assets/js/components/Lowongan.jsx
View file @
dafdd8b5
import
React
from
'
react
'
;
import
{
Button
,
Image
as
ImageComponent
,
Item
,
Rating
,
Icon
}
from
'
semantic-ui-react
'
import
ModalPendaftaran
from
'
./Modal
Pendaftaran
'
;
import
ModalPendaftaran
from
'
./
Apply
Modal
'
;
const
paragraph
=
<
ImageComponent
src
=
"http://semantic-ui.com/images/wireframe/short-paragraph.png"
/>;
...
...
@@ -26,7 +26,7 @@ export default class Lowongan extends React.Component {
<
h4
>
PT. Koding Kuat
</
h4
>
<
h5
>
JL.Kali deres utara no.1 Jakarta Barat, DKI Jakarta
</
h5
>
<
ModalPendaftaran
id
=
{
1
}
data
=
{
{
header
:
'
Deskripsi Lowongan
'
,
description
:
'
Lorem ipsum dolor sit amet
'
}
}
buttonTitle
=
"Daftar"
/>
<
ApplicancyModal
id
=
{
1
}
data
=
{
{
header
:
'
Deskripsi Lowongan
'
,
description
:
'
Lorem ipsum dolor sit amet
'
}
}
buttonTitle
=
"Daftar"
/>
</
Item
.
Content
>
</
Item
.
Content
>
...
...
assets/js/components/Vacancy.jsx
View file @
dafdd8b5
import
React
from
'
react
'
;
import
{
Button
,
Image
as
ImageComponent
,
Item
,
Rating
}
from
'
semantic-ui-react
'
;
import
ModalPendaftaran
from
'
./ModalPendaftaran
'
;
import
ApplyModal
from
'
./ApplyModal
'
;
import
Storage
from
'
../lib/Storage
'
;
import
Server
from
'
../lib/Server
'
;
...
...
@@ -48,7 +48,7 @@ export default class Vacancy extends React.Component {
<
h4
>
{
this
.
props
.
data
.
company
.
name
}
</
h4
>
<
h5
>
{
this
.
props
.
data
.
company
.
address
}
</
h5
>
<
Modal
Pendaftaran
<
Apply
Modal
id
=
{
this
.
props
.
data
.
id
}
data
=
{
{
header
:
this
.
props
.
data
.
name
,
description
:
this
.
props
.
data
.
description
}
}
buttonTitle
=
"Daftar"
/>
...
...
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