Add WebDav server, fully functional!
Some more code cleanup.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { assertEquals } from 'std/assert/assert_equals.ts';
|
||||
import {
|
||||
convertFormDataToObject,
|
||||
convertObjectToDavXml,
|
||||
convertObjectToFormData,
|
||||
escapeHtml,
|
||||
generateHash,
|
||||
@@ -247,48 +246,3 @@ Deno.test('that convertObjectToFormData works', () => {
|
||||
assertEquals(convertFormDataToObject(output), convertFormDataToObject(test.expected));
|
||||
}
|
||||
});
|
||||
|
||||
Deno.test('that convertObjectToDavXml works', () => {
|
||||
const tests: { input: Record<string, any>; expected: string }[] = [
|
||||
{
|
||||
input: {
|
||||
url: 'https://bewcloud.com',
|
||||
},
|
||||
expected: `<url>https://bewcloud.com</url>`,
|
||||
},
|
||||
{
|
||||
input: {
|
||||
a: 'Website',
|
||||
a_attributes: {
|
||||
href: 'https://bewcloud.com',
|
||||
target: '_blank',
|
||||
},
|
||||
},
|
||||
expected: `<a href="https://bewcloud.com" target="_blank">Website</a>`,
|
||||
},
|
||||
{
|
||||
input: {
|
||||
article: {
|
||||
p: [
|
||||
{
|
||||
strong: 'Indeed',
|
||||
},
|
||||
{
|
||||
i: {},
|
||||
},
|
||||
'Mighty!',
|
||||
],
|
||||
},
|
||||
article_attributes: {
|
||||
class: 'center',
|
||||
},
|
||||
},
|
||||
expected: `<article class="center"><p><strong>Indeed</strong></p>\n<p><i /></p>\n<p>Mighty!</p></article>`,
|
||||
},
|
||||
];
|
||||
|
||||
for (const test of tests) {
|
||||
const result = convertObjectToDavXml(test.input);
|
||||
assertEquals(result, test.expected);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user