Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
8a6de06b
Commit
8a6de06b
authored
9 years ago
by
pkupczyk
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-2005 : V3 AS API - JS tests - more dataset tests
SVN: 34267
parent
f546d4f2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/dataset.js
+49
-1
49 additions, 1 deletion
...sts/1/as/webapps/openbis-v3-api-test/html/test/dataset.js
with
49 additions
and
1 deletion
js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/dataset.js
+
49
−
1
View file @
8a6de06b
define
([
'
jquery
'
,
'
openbis
'
,
'
test/common
'
],
function
(
$
,
openbis
,
common
)
{
define
([
'
jquery
'
,
'
openbis
'
,
'
test/common
'
,
'
dto/entity/dataset/DataSetUpdate
'
,
'
dto/id/dataset/DataSetPermId
'
],
function
(
$
,
openbis
,
common
,
DataSetUpdate
,
DataSetPermId
)
{
return
function
()
{
return
function
()
{
QUnit
.
module
(
"
Dataset tests
"
);
QUnit
.
module
(
"
Dataset tests
"
);
...
@@ -36,5 +36,53 @@ define([ 'jquery', 'openbis', 'test/common' ], function($, openbis, common) {
...
@@ -36,5 +36,53 @@ define([ 'jquery', 'openbis', 'test/common' ], function($, openbis, common) {
});
});
});
});
QUnit
.
test
(
"
searchDataSets()
"
,
function
(
assert
)
{
var
c
=
new
common
(
assert
);
var
done
=
assert
.
async
();
$
.
when
(
c
.
createFacadeAndLogin
(),
c
.
createDataSetSearchCriterion
(),
c
.
createDataSetFetchOptions
()).
then
(
function
(
facade
,
criterion
,
fetchOptions
)
{
criterion
.
withCode
().
thatEquals
(
"
20130415093804724-403
"
);
return
facade
.
searchDataSets
(
criterion
,
fetchOptions
).
done
(
function
()
{
facade
.
logout
()
})
}).
done
(
function
(
dataSets
)
{
c
.
assertObjectsCount
(
Object
.
keys
(
dataSets
),
1
);
var
dataSet
=
dataSets
[
0
];
c
.
assertEqual
(
dataSet
.
getCode
(),
"
20130415093804724-403
"
,
"
Code
"
);
done
();
}).
fail
(
function
(
error
)
{
c
.
fail
(
error
.
message
);
done
();
});
});
QUnit
.
test
(
"
updateDataSets()
"
,
function
(
assert
)
{
var
c
=
new
common
(
assert
);
var
done
=
assert
.
async
();
var
update
=
new
DataSetUpdate
();
update
.
setDataSetId
(
new
DataSetPermId
(
"
20130415100308111-409
"
));
update
.
setProperty
(
"
DESCRIPTION
"
,
"
new 409 description
"
);
$
.
when
(
c
.
createFacadeAndLogin
(),
c
.
createDataSetFetchOptions
()).
then
(
function
(
facade
,
fetchOptions
)
{
return
facade
.
updateDataSets
([
update
]).
then
(
function
()
{
return
facade
.
mapDataSets
([
update
.
getDataSetId
()
],
fetchOptions
).
done
(
function
()
{
facade
.
logout
()
});
})
}).
done
(
function
(
dataSets
)
{
c
.
assertObjectsCount
(
Object
.
keys
(
dataSets
),
1
);
var
dataSet
=
dataSets
[
update
.
getDataSetId
().
getPermId
()];
c
.
assertEqual
(
dataSet
.
getCode
(),
update
.
getDataSetId
().
getPermId
(),
"
Code
"
);
c
.
assertEqual
(
dataSet
.
getProperties
()[
"
DESCRIPTION
"
],
update
.
getProperties
()[
"
DESCRIPTION
"
],
"
Property DESCRIPTION
"
);
done
();
}).
fail
(
function
(
error
)
{
c
.
fail
(
error
.
message
);
done
();
});
});
}
}
});
});
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