Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
etherpad-lite
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
Container registry
Model registry
Operate
Environments
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
runcon
etherpad-lite
Commits
c9b0c689
Commit
c9b0c689
authored
Dec 29, 2014
by
John McLear
Browse files
Options
Downloads
Patches
Plain Diff
move pad tests - still need to do copy pad and some other functionality IE force
parent
302ceb66
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
tests/backend/specs/api/pad.js
+128
-0
128 additions, 0 deletions
tests/backend/specs/api/pad.js
with
128 additions
and
0 deletions
tests/backend/specs/api/pad.js
+
128
−
0
View file @
c9b0c689
...
...
@@ -61,6 +61,16 @@ describe('Permission', function(){
-> setText(padId)
-> getLastEdited(padID) -- Should be when setText was performed
-> padUsers(padID) -- Should be when setText was performed
-> setText(padId, "hello world")
-> getLastEdited(padID) -- Should be when pad was made
-> getText(padId) -- Should be "hello world"
-> movePad(padID, newPadId) -- Should provide consistant pad data
-> getText(newPadId) -- Should be "hello world"
-> movePad(newPadID, originalPadId) -- Should provide consistant pad data
-> getText(originalPadId) -- Should be "hello world"
-> getLastEdited(padID) -- Should not be 0
*/
describe
(
'
deletePad
'
,
function
(){
...
...
@@ -265,7 +275,125 @@ describe('padUsers', function(){
});
})
describe
(
'
deletePad
'
,
function
(){
it
(
'
deletes a Pad
'
,
function
(
done
)
{
api
.
get
(
endPoint
(
'
deletePad
'
)
+
"
&padID=
"
+
testPadId
)
.
expect
(
function
(
res
){
if
(
res
.
body
.
code
!==
0
)
throw
new
Error
(
"
Pad Deletion failed
"
)
})
.
expect
(
'
Content-Type
'
,
/json/
)
.
expect
(
200
,
done
)
});
})
var
originalPadId
=
testPadId
;
var
newPadId
=
makeid
();
describe
(
'
createPad
'
,
function
(){
it
(
'
creates a new Pad with text
'
,
function
(
done
)
{
api
.
get
(
endPoint
(
'
createPad
'
)
+
"
&padID=
"
+
testPadId
)
.
expect
(
function
(
res
){
if
(
res
.
body
.
code
!==
0
)
throw
new
Error
(
"
Pad Creation failed
"
)
})
.
expect
(
'
Content-Type
'
,
/json/
)
.
expect
(
200
,
done
)
});
})
describe
(
'
setText
'
,
function
(){
it
(
'
Sets text on a pad Id
'
,
function
(
done
)
{
api
.
get
(
endPoint
(
'
setText
'
)
+
"
&padID=
"
+
testPadId
+
"
&text=hello world
"
)
.
expect
(
function
(
res
){
if
(
res
.
body
.
code
!==
0
)
throw
new
Error
(
"
Pad Set Text failed
"
)
})
.
expect
(
'
Content-Type
'
,
/json/
)
.
expect
(
200
,
done
)
});
})
describe
(
'
getText
'
,
function
(){
it
(
'
Gets text on a pad Id
'
,
function
(
done
)
{
api
.
get
(
endPoint
(
'
getText
'
)
+
"
&padID=
"
+
testPadId
)
.
expect
(
function
(
res
){
if
(
res
.
body
.
code
!==
0
)
throw
new
Error
(
"
Pad Get Text failed
"
)
if
(
res
.
body
.
data
.
text
!==
"
hello world
\n
"
)
throw
new
Error
(
"
Pad Text not set properly
"
);
})
.
expect
(
'
Content-Type
'
,
/json/
)
.
expect
(
200
,
done
)
});
})
describe
(
'
getLastEdited
'
,
function
(){
it
(
'
Gets when pad was last edited
'
,
function
(
done
)
{
api
.
get
(
endPoint
(
'
getLastEdited
'
)
+
"
&padID=
"
+
testPadId
)
.
expect
(
function
(
res
){
if
(
res
.
body
.
lastEdited
===
0
)
throw
new
Error
(
"
Get Last Edited Failed
"
)
})
.
expect
(
'
Content-Type
'
,
/json/
)
.
expect
(
200
,
done
)
});
})
describe
(
'
movePad
'
,
function
(){
it
(
'
Move a Pad to a different Pad ID
'
,
function
(
done
)
{
api
.
get
(
endPoint
(
'
movePad
'
)
+
"
&sourceID=
"
+
testPadId
+
"
&destinationID=
"
+
newPadId
+
"
&force=true
"
)
.
expect
(
function
(
res
){
console
.
log
(
res
.
body
);
if
(
res
.
body
.
code
!==
0
)
throw
new
Error
(
"
Moving Pad Failed
"
)
})
.
expect
(
'
Content-Type
'
,
/json/
)
.
expect
(
200
,
done
)
});
})
describe
(
'
getText
'
,
function
(){
it
(
'
Gets text on a pad Id
'
,
function
(
done
)
{
api
.
get
(
endPoint
(
'
getText
'
)
+
"
&padID=
"
+
newPadId
)
.
expect
(
function
(
res
){
if
(
res
.
body
.
data
.
text
!==
"
hello world
\n
"
)
throw
new
Error
(
"
Pad Get Text failed
"
)
})
.
expect
(
'
Content-Type
'
,
/json/
)
.
expect
(
200
,
done
)
});
})
describe
(
'
movePad
'
,
function
(){
it
(
'
Move a Pad to a different Pad ID
'
,
function
(
done
)
{
api
.
get
(
endPoint
(
'
movePad
'
)
+
"
&sourceID=
"
+
newPadId
+
"
&destinationID=
"
+
testPadId
+
"
&force=false
"
)
.
expect
(
function
(
res
){
if
(
res
.
body
.
code
!==
0
)
throw
new
Error
(
"
Moving Pad Failed
"
)
})
.
expect
(
'
Content-Type
'
,
/json/
)
.
expect
(
200
,
done
)
});
})
describe
(
'
getText
'
,
function
(){
it
(
'
Gets text on a pad Id
'
,
function
(
done
)
{
api
.
get
(
endPoint
(
'
getText
'
)
+
"
&padID=
"
+
testPadId
)
.
expect
(
function
(
res
){
if
(
res
.
body
.
data
.
text
!==
"
hello world
\n
"
)
throw
new
Error
(
"
Pad Get Text failed
"
)
})
.
expect
(
'
Content-Type
'
,
/json/
)
.
expect
(
200
,
done
)
});
})
describe
(
'
getLastEdited
'
,
function
(){
it
(
'
Gets when pad was last edited
'
,
function
(
done
)
{
api
.
get
(
endPoint
(
'
getLastEdited
'
)
+
"
&padID=
"
+
testPadId
)
.
expect
(
function
(
res
){
if
(
res
.
body
.
lastEdited
===
0
)
throw
new
Error
(
"
Get Last Edited Failed
"
)
})
.
expect
(
'
Content-Type
'
,
/json/
)
.
expect
(
200
,
done
)
});
})
/*
-> movePadForce Test
*/
var
endPoint
=
function
(
point
){
return
'
/api/
'
+
apiVersion
+
'
/
'
+
point
+
'
?apikey=
'
+
apiKey
;
...
...
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
sign in
to comment