Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Cédric Le Ninivin
jio
Commits
f5c3ac61
Commit
f5c3ac61
authored
Aug 23, 2016
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ReplicateStorage: Add test for deletion conflicting with modification not checked
parent
b067eb2b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
161 additions
and
0 deletions
+161
-0
test/jio.storage/replicatestorage.tests.js
test/jio.storage/replicatestorage.tests.js
+161
-0
No files found.
test/jio.storage/replicatestorage.tests.js
View file @
f5c3ac61
...
@@ -2219,6 +2219,167 @@
...
@@ -2219,6 +2219,167 @@
});
});
});
});
test
(
"
local deletion and remote modifications:
"
+
"
remote document modification not checked
"
,
function
()
{
stop
();
expect
(
8
);
var
id
,
context
=
this
;
this
.
jio
=
jIO
.
createJIO
({
type
:
"
replicate
"
,
check_remote_modification
:
false
,
local_sub_storage
:
{
type
:
"
uuid
"
,
sub_storage
:
{
type
:
"
memory
"
}
},
remote_sub_storage
:
{
type
:
"
uuid
"
,
sub_storage
:
{
type
:
"
memory
"
}
}
});
context
.
jio
.
post
({
"
title
"
:
"
foo
"
})
.
then
(
function
(
result
)
{
id
=
result
;
return
context
.
jio
.
repair
();
})
.
then
(
function
()
{
return
RSVP
.
all
([
context
.
jio
.
remove
(
id
),
context
.
jio
.
__storage
.
_remote_sub_storage
.
put
(
id
,
{
"
title
"
:
"
foo99
"
}
)
]);
})
.
then
(
function
()
{
return
context
.
jio
.
repair
();
})
.
then
(
function
()
{
return
context
.
jio
.
get
(
id
);
})
.
then
(
function
()
{
ok
(
false
,
"
Document should be deleted
"
);
})
.
fail
(
function
(
error
)
{
ok
(
error
instanceof
jIO
.
util
.
jIOError
);
equal
(
error
.
message
,
"
Cannot find document:
"
+
id
);
equal
(
error
.
status_code
,
404
);
})
.
then
(
function
()
{
return
context
.
jio
.
__storage
.
_remote_sub_storage
.
get
(
id
);
})
.
then
(
function
()
{
ok
(
false
,
"
Document should be remotely deleted
"
);
})
.
fail
(
function
(
error
)
{
ok
(
error
instanceof
jIO
.
util
.
jIOError
);
equal
(
error
.
message
,
"
Cannot find document:
"
+
id
);
equal
(
error
.
status_code
,
404
);
})
.
then
(
function
()
{
return
context
.
jio
.
__storage
.
_signature_sub_storage
.
get
(
id
);
})
.
then
(
function
()
{
ok
(
false
,
"
Signature should be deleted
"
);
})
.
fail
(
function
(
error
)
{
ok
(
error
instanceof
jIO
.
util
.
jIOError
);
equal
(
error
.
status_code
,
404
);
})
.
always
(
function
()
{
start
();
});
}
);
test
(
"
local modifications and remote deletion:
"
+
"
local document modification not checked
"
,
function
()
{
stop
();
expect
(
8
);
var
id
,
context
=
this
;
this
.
jio
=
jIO
.
createJIO
({
type
:
"
replicate
"
,
check_local_modification
:
false
,
local_sub_storage
:
{
type
:
"
uuid
"
,
sub_storage
:
{
type
:
"
memory
"
}
},
remote_sub_storage
:
{
type
:
"
uuid
"
,
sub_storage
:
{
type
:
"
memory
"
}
}
});
context
.
jio
.
post
({
"
title
"
:
"
foo
"
})
.
then
(
function
(
result
)
{
id
=
result
;
return
context
.
jio
.
repair
();
})
.
then
(
function
()
{
return
RSVP
.
all
([
context
.
jio
.
put
(
id
,
{
"
title
"
:
"
foo99
"
}),
context
.
jio
.
__storage
.
_remote_sub_storage
.
remove
(
id
)
]);
})
.
then
(
function
()
{
return
context
.
jio
.
repair
();
})
.
then
(
function
()
{
return
context
.
jio
.
get
(
id
);
})
.
then
(
function
()
{
ok
(
false
,
"
Document should be deleted
"
);
})
.
fail
(
function
(
error
)
{
ok
(
error
instanceof
jIO
.
util
.
jIOError
);
equal
(
error
.
message
,
"
Cannot find document:
"
+
id
);
equal
(
error
.
status_code
,
404
);
})
.
then
(
function
()
{
return
context
.
jio
.
__storage
.
_remote_sub_storage
.
get
(
id
);
})
.
then
(
function
()
{
ok
(
false
,
"
Document should be remotely deleted
"
);
})
.
fail
(
function
(
error
)
{
ok
(
error
instanceof
jIO
.
util
.
jIOError
);
equal
(
error
.
message
,
"
Cannot find document:
"
+
id
);
equal
(
error
.
status_code
,
404
);
})
.
then
(
function
()
{
return
context
.
jio
.
__storage
.
_signature_sub_storage
.
get
(
id
);
})
.
then
(
function
()
{
ok
(
false
,
"
Signature should be deleted
"
);
})
.
fail
(
function
(
error
)
{
ok
(
error
instanceof
jIO
.
util
.
jIOError
);
equal
(
error
.
status_code
,
404
);
})
.
always
(
function
()
{
start
();
});
}
);
test
(
"
signature document is not synced
"
,
function
()
{
test
(
"
signature document is not synced
"
,
function
()
{
stop
();
stop
();
expect
(
6
);
expect
(
6
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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