refactor: include latest changes from core#145

This commit is contained in:
Rainer Killinger
2022-01-21 15:30:23 +01:00
parent 482dec345c
commit 9d8fe643a5
13 changed files with 316 additions and 260 deletions

View File

@@ -44,7 +44,7 @@ describe('Bulk routes', async function () {
it('should create bulk', async function () {
const {status, body, error} = await testApp
.post(bulkRoute.urlFragment)
.post(bulkRoute.urlPath)
.set('Content-Type', 'application/json')
.send(request);
@@ -56,13 +56,13 @@ describe('Bulk routes', async function () {
it('should return (throw) error if a bulk with the provided UID cannot be found when adding to a bulk', async function () {
await testApp
.post(bulkRoute.urlFragment)
.post(bulkRoute.urlPath)
.set('Content-Type', 'application/json')
.send(request);
const bulkAddRouteUrlFragment = bulkAddRoute.urlFragment.toLocaleLowerCase().replace(':uid', 'a-wrong-uid');
const bulkAddRouteurlPath = bulkAddRoute.urlPath.toLocaleLowerCase().replace(':uid', 'a-wrong-uid');
const {status} = await testApp
.post(bulkAddRouteUrlFragment)
.post(bulkAddRouteurlPath)
.set('Content-Type', 'application/json')
.send(book);
@@ -71,13 +71,13 @@ describe('Bulk routes', async function () {
it('should add to a created bulk', async function () {
const response = await testApp
.post(bulkRoute.urlFragment)
.post(bulkRoute.urlPath)
.set('Content-Type', 'application/json')
.send(request);
const bulkAddRouteUrlFragment = bulkAddRoute.urlFragment.toLocaleLowerCase().replace(':uid', response.body.uid);
const bulkAddRouteurlPath = bulkAddRoute.urlPath.toLocaleLowerCase().replace(':uid', response.body.uid);
const {status, body} = await testApp
.post(bulkAddRouteUrlFragment)
.post(bulkAddRouteurlPath)
.set('Content-Type', 'application/json')
.send(book);
@@ -87,13 +87,13 @@ describe('Bulk routes', async function () {
it('should return (throw) error if a bulk with the provided UID cannot be found when closing a bulk (done)', async function () {
await testApp
.post(bulkRoute.urlFragment)
.post(bulkRoute.urlPath)
.set('Content-Type', 'application/json')
.send(request);
const bulkDoneRouteUrlFragment = bulkDoneRoute.urlFragment.toLocaleLowerCase().replace(':uid', 'a-wrong-uid');
const bulkDoneRouteurlPath = bulkDoneRoute.urlPath.toLocaleLowerCase().replace(':uid', 'a-wrong-uid');
const {status} = await testApp
.post(bulkDoneRouteUrlFragment)
.post(bulkDoneRouteurlPath)
.set('Content-Type', 'application/json')
.send({});
@@ -102,13 +102,13 @@ describe('Bulk routes', async function () {
it ('should close the bulk (done)', async function () {
const response = await testApp
.post(bulkRoute.urlFragment)
.post(bulkRoute.urlPath)
.set('Content-Type', 'application/json')
.send(request);
const bulkDoneRouteUrlFragment = bulkDoneRoute.urlFragment.toLocaleLowerCase().replace(':uid', response.body.uid);
const bulkDoneRouteurlPath = bulkDoneRoute.urlPath.toLocaleLowerCase().replace(':uid', response.body.uid);
const response2 = await testApp
.post(bulkDoneRouteUrlFragment)
.post(bulkDoneRouteurlPath)
.set('Content-Type', 'application/json')
.send({});