Fakultas Ilmu Komputer UI
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kape
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Fasilkom UI Open Source Software
Kape
Commits
a4e83878
Commit
a4e83878
authored
8 years ago
by
M. Reza Qorib
Browse files
Options
Downloads
Patches
Plain Diff
[#140382397] #4 mencoba bikin testing untuk server.jsx
parent
39170b0f
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
assets/js/__test__/server-test.js
+12
-22
12 additions, 22 deletions
assets/js/__test__/server-test.js
with
12 additions
and
22 deletions
assets/js/__test__/server-test.js
+
12
−
22
View file @
a4e83878
import
React
from
'
react
'
;
import
ReactDOM
from
'
react-dom
'
;
import
ReactTestUtils
from
'
react-addons-test-utils
'
// ES6
import
expect
from
'
expect
'
;
import
Root
from
'
../root
'
;
describe
(
'
root
'
,
function
()
{
it
(
'
renders without problems
'
,
function
()
{
let
root
=
ReactTestUtils
.
renderIntoDocument
(
<
Root
/>
);
expect
(
root
).
toExist
();
});
it
(
'
changes without problems
'
,
function
()
{
let
root
=
ReactTestUtils
.
renderIntoDocument
(
<
Root
/>
);
const
inputNode
=
ReactDOM
.
findDOMNode
(
root
.
refs
.
input
);
const
newValue
=
'
some text
'
;
inputNode
.
value
=
newValue
;
ReactTestUtils
.
Simulate
.
change
(
inputNode
);
const
nameNode
=
ReactDOM
.
findDOMNode
(
root
.
refs
.
name
);
expect
(
nameNode
.
textContent
).
toEqual
(
newValue
);
import
expect
from
'
expect
'
;
//kebutuhan dasar
import
Server
from
"
../lib/server
"
;
import
Logger
from
"
../lib/logger
"
;
describe
(
'
server
'
,
function
()
{
it
(
'
check logged in or not
'
,
function
()
{
let
logged
=
Server
.
isLoggedIn
();
expect
(
logged
).
toEqual
(
null
);
document
.
cookie
=
"
sessionid=John Smith; expires=Thu, 18 Dec 2013 12:00:00 UTC; path=/
"
;
Logger
.
log
(
document
.
cookie
);
logged
=
Server
.
isLoggedIn
();
expect
(
logged
).
toEqual
(
"
John Smith
"
);
});
});
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment