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
preetwinder
jio
Commits
4f8d9ed2
Commit
4f8d9ed2
authored
Mar 14, 2019
by
preetwinder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migration handling and improved querying support
parent
cd07ec24
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1114 additions
and
149 deletions
+1114
-149
src/jio.storage/indexstorage2.js
src/jio.storage/indexstorage2.js
+191
-44
src/jio.storage/liststorage.js
src/jio.storage/liststorage.js
+5
-4
test/jio.storage/indexstorage2.tests.js
test/jio.storage/indexstorage2.tests.js
+908
-95
test/jio.storage/liststorage.tests.js
test/jio.storage/liststorage.tests.js
+10
-6
No files found.
src/jio.storage/indexstorage2.js
View file @
4f8d9ed2
This diff is collapsed.
Click to expand it.
src/jio.storage/liststorage.js
View file @
4f8d9ed2
...
...
@@ -37,7 +37,7 @@
var
gadget
=
this
;
return
gadget
.
_sub_storage
.
post
(
value
)
.
push
(
function
(
id
)
{
return
gadget
.
_signature_storage
.
put
(
id
,
{
"
id
"
:
id
})
return
gadget
.
_signature_storage
.
put
(
id
,
{})
.
push
(
function
()
{
return
id
;
});
...
...
@@ -47,7 +47,7 @@
var
gadget
=
this
;
return
gadget
.
_sub_storage
.
put
(
id
,
value
)
.
push
(
function
(
result
)
{
return
gadget
.
_signature_storage
.
put
(
id
,
{
"
id
"
:
id
})
return
gadget
.
_signature_storage
.
put
(
id
,
{})
.
push
(
function
()
{
return
result
;
});
...
...
@@ -78,11 +78,12 @@
};
ListStorage
.
prototype
.
hasCapacity
=
function
(
name
)
{
if
(
name
===
"
list
"
)
{
return
t
rue
;
return
t
his
.
_signature_storage
.
hasCapacity
(
'
list
'
)
;
}
return
false
;
};
ListStorage
.
prototype
.
buildQuery
=
function
()
{
return
this
.
_signature_storage
.
buildQuery
(
{}
);
return
this
.
_signature_storage
.
buildQuery
();
};
jIO
.
addStorage
(
'
list
'
,
ListStorage
);
...
...
test/jio.storage/indexstorage2.tests.js
View file @
4f8d9ed2
This diff is collapsed.
Click to expand it.
test/jio.storage/liststorage.tests.js
View file @
4f8d9ed2
...
...
@@ -162,7 +162,7 @@
};
DummyStorage2
.
prototype
.
put
=
function
(
id
,
value
)
{
equal
(
id
,
'
posted
'
);
deepEqual
(
value
,
{
'
id
'
:
'
posted
'
});
deepEqual
(
value
,
{});
return
id
;
};
...
...
@@ -202,7 +202,7 @@
};
DummyStorage2
.
prototype
.
put
=
function
(
id
,
param
)
{
equal
(
id
,
"
1
"
);
deepEqual
(
param
,
{
'
id
'
:
'
1
'
});
deepEqual
(
param
,
{});
return
id
;
};
...
...
@@ -372,6 +372,7 @@
/////////////////////////////////////////////////////////////////
module
(
"
ListStorage.hasCapacity
"
);
test
(
"
list capacity is implemented
"
,
function
()
{
expect
(
2
);
var
jio
=
jIO
.
createJIO
({
type
:
"
list
"
,
...
...
@@ -386,6 +387,10 @@
DummyStorage1
.
prototype
.
hasCapacity
=
function
()
{
return
false
;
};
DummyStorage2
.
prototype
.
hasCapacity
=
function
(
capacity
)
{
equal
(
capacity
,
'
list
'
);
return
true
;
};
ok
(
jio
.
hasCapacity
(
"
list
"
));
});
...
...
@@ -396,7 +401,7 @@
module
(
"
ListStorage.buildQuery
"
);
test
(
"
buildQuery calls substorage buildQuery
"
,
function
()
{
stop
();
expect
(
2
);
expect
(
1
);
var
jio
=
jIO
.
createJIO
({
type
:
"
list
"
,
...
...
@@ -408,12 +413,11 @@
}
});
DummyStorage2
.
prototype
.
buildQuery
=
function
(
params
)
{
deepEqual
(
params
,
{});
DummyStorage2
.
prototype
.
buildQuery
=
function
()
{
return
[{
"
id
"
:
"
1
"
},
{
"
id
"
:
"
2
"
}];
};
jio
.
buildQuery
(
{}
)
jio
.
buildQuery
()
.
then
(
function
(
result
)
{
deepEqual
(
result
,
[{
"
id
"
:
"
1
"
},
{
"
id
"
:
"
2
"
}]);
})
...
...
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