@sync-in/server
Version:
The secure, open-source platform for file storage, sharing, collaboration, and sync
69 lines (68 loc) • 2.21 kB
JavaScript
/*
* Copyright (C) 2012-2025 Johan Legrand <johan.legrand@sync-in.com>
* This file is part of Sync-in | The open source file sync and share solution
* See the LICENSE file for licensing details
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const _appbootstrap = require("../../app.bootstrap");
const _utils = require("../../infrastructure/database/utils");
const _webdav = require("./constants/webdav");
const XML_VERSION_STR = '<?xml version="1.0" encoding="utf-8" standalone="yes"?>';
describe('WebDAV (e2e)', ()=>{
let app;
beforeAll(async ()=>{
app = await (0, _appbootstrap.appBootstrap)();
await app.init();
await app.getHttpAdapter().getInstance().ready();
});
afterAll(async ()=>{
await (0, _utils.dbCloseConnection)(app);
await app.close();
});
it('should be defined', ()=>{
expect(app).toBeDefined();
});
it('PROPFIND ALLPROP /webdav => 207', async ()=>{
const res = await app.inject({
method: 'PROPFIND',
url: '/webdav',
headers: {
authorization: 'Basic am86cGFzc3dvcmQ=',
'content-type': _webdav.XML_CONTENT_TYPE,
Depth: '1'
},
body: `${XML_VERSION_STR}
<propfind xmlns:D="DAV:">
<allprop/>
</propfind>`
});
expect(res.statusCode).toEqual(207);
});
it('PROPFIND PROP /webdav => 207', async ()=>{
const res = await app.inject({
method: 'PROPFIND',
url: '/webdav',
headers: {
authorization: 'Basic am86cGFzc3dvcmQ=',
'content-type': _webdav.XML_CONTENT_TYPE,
Depth: '1'
},
body: `${XML_VERSION_STR}
<D:propfind xmlns:D="DAV:">
<D:prop>
<D:creationdate/>
<D:displayname/>
<D:getcontentlength/>
<D:getcontenttype/>
<D:getetag/>
<D:getlastmodified/>
<D:resourcetype/>
</D:prop>
</D:propfind>`
});
expect(res.statusCode).toEqual(207);
});
});
//# sourceMappingURL=webdav.e2e-spec.js.map