Archived
2

switched to aggregation, included material sort keys

This commit is contained in:
VLE2FE
2020-06-26 15:23:29 +02:00
parent 43413001e9
commit 8aa051f0bd
3 changed files with 44 additions and 26 deletions

View File

@ -230,6 +230,20 @@ describe('/sample', () => {
done();
});
});
it('sorts the samples correctly for material keys', done => {
TestHelper.request(server, done, {
method: 'get',
url: '/samples?status=all&sort=material.name-desc',
auth: {basic: 'janedoe'},
httpStatus: 200
}).end((err, res) => {
if (err) return done(err);
should(res.body[0]).have.property('_id', '400000000000000000000002');
should(res.body[1]).have.property('_id', '400000000000000000000006');
should(res.body[2]).have.property('_id', '400000000000000000000001');
done();
});
});
it('rejects a negative page size', done => {
TestHelper.request(server, done, {
method: 'get',