1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-11 18:24:43 +02:00

Fixed import of tables and added tests

This commit is contained in:
Laurent Cozic 2018-05-14 11:36:02 +01:00
parent 526ef7e1d2
commit 2e2b35dfeb
4 changed files with 22 additions and 14 deletions

View File

@ -8,15 +8,16 @@ rsync -a "$ROOT_DIR/../ReactNativeClient/lib/" "$BUILD_DIR/lib/"
rsync -a "$ROOT_DIR/build/locales/" "$BUILD_DIR/locales/"
mkdir -p "$BUILD_DIR/data"
if [[ $TEST_FILE == "" ]]; then
(cd "$ROOT_DIR" && npm test tests-build/synchronizer.js)
(cd "$ROOT_DIR" && npm test tests-build/encryption.js
(cd "$ROOT_DIR" && npm test tests-build/ArrayUtils.js)
(cd "$ROOT_DIR" && npm test tests-build/models_Setting.js)
(cd "$ROOT_DIR" && npm test tests-build/models_Note.js)
(cd "$ROOT_DIR" && npm test tests-build/models_Folder.js)
(cd "$ROOT_DIR" && npm test tests-build/services_InteropService.js)
(cd "$ROOT_DIR" && npm test tests-build/HtmlToMd.js)
else
if [[ $TEST_FILE != "" ]]; then
(cd "$ROOT_DIR" && npm test tests-build/$TEST_FILE.js)
fi
exit
fi
(cd "$ROOT_DIR" && npm test tests-build/synchronizer.js)
(cd "$ROOT_DIR" && npm test tests-build/encryption.js
(cd "$ROOT_DIR" && npm test tests-build/ArrayUtils.js)
(cd "$ROOT_DIR" && npm test tests-build/models_Setting.js)
(cd "$ROOT_DIR" && npm test tests-build/models_Note.js)
(cd "$ROOT_DIR" && npm test tests-build/models_Folder.js)
(cd "$ROOT_DIR" && npm test tests-build/services_InteropService.js)
(cd "$ROOT_DIR" && npm test tests-build/HtmlToMd.js)

View File

@ -35,7 +35,7 @@ describe('HtmlToMd', function() {
const htmlPath = basePath + '/' + htmlFilename;
const mdPath = basePath + '/' + filename(htmlFilename) + '.md';
// if (htmlFilename !== 'inlineCodeWithLink.html') continue;
// if (htmlFilename !== 'tableWithNewLines.html') continue;
const html = await shim.fsDriver().readFile(htmlPath);
const expectedMd = await shim.fsDriver().readFile(mdPath);
@ -47,9 +47,9 @@ describe('HtmlToMd', function() {
console.info('');
console.info('Error converting file: ' + htmlFilename);
console.info('--------------------------------- Got:');
console.info(actualMd);
console.info(actualMd.split('\n'));
console.info('--------------------------------- Expected:');
console.info(expectedMd);
console.info(expectedMd.split('\n'));
console.info('--------------------------------------------');
console.info('');

View File

@ -0,0 +1,3 @@
<div>
<table style="-evernote-table:true;border-collapse:collapse;width:100%;table-layout:fixed;margin-left:0px;"><tr><td style="border-style:solid;border-width:1px;border-color:rgb(211,211,211);padding:10px;margin:0px;width:50%;"><div>line 1</div><div>line 2</div></td><td style="border-style:solid;border-width:1px;border-color:rgb(211,211,211);padding:10px;margin:0px;width:50%;"><div><br/></div></td></tr><tr><td style="border-style:solid;border-width:1px;border-color:rgb(211,211,211);padding:10px;margin:0px;width:50%;"><div>aaaaaa</div></td><td style="border-style:solid;border-width:1px;border-color:rgb(211,211,211);padding:10px;margin:0px;width:50%;"><div>line 3</div><div>line 4</div></td></tr></table>
</div>

View File

@ -0,0 +1,4 @@
| | |
| --- | --- |
| line 1<br>line 2 | |
| aaaaaa | line 3<br>line 4 |