<commit_before>'use strict';
/*
 * ACHTUNG: there is a copied & modified version of this file in
 * <basedir>/tests/container/spacs/api/pad.js
 *
 * TODO: unify those two files, and merge in a single one.
 */

const common = require('../../common');
const settings = require('../../../container/loadSettings.js').loadSettings();
const supertest = require('ep_etherpad-lite/node_modules/supertest');

const api = supertest(`http://${settings.ip}:${settings.port}`);
const apiKey = common.apiKey;
const apiVersion = 1;

const testImports = {
  'malformed': {
    input: '<html><body><li>wtf</ul></body></html>',
    expectedHTML: '<!DOCTYPE HTML><html><body>wtf<br><br></body></html>',
    expectedText: 'wtf\n\n',
    disabled: true,
  },
  'nonelistiteminlist #3620': {
    input: '<html><body><ul>test<li>FOO</li></ul></body></html>',
    expectedHTML: '<!DOCTYPE HTML><html><body><ul class="bullet">test<li>FOO</ul><br></body></html>',
    expectedText: '\ttest\n\t* FOO\n\n',
    disabled: true,
  },
  'whitespaceinlist #3620': {
    input: '<html><body><ul> <li>FOO</li></ul></body></html>',
    expectedHTML: '<!DOCTYPE HTML><html><body><ul class="bullet"><li>FOO</ul><br></body></html>',
    expectedText: '\t* FOO\n\n',
    disabled: true,
  },
  'prefixcorrectlinenumber': {
    input: '<html><body><ol><li>should be 1</li><li>should be 2</li></ol></body></html>',
    expectedHTML: '<!DOCTYPE HTML><html><body><ol start="1" class="number"><li>should be 1</li><li>should be 2</ol><br></body></html>',
    expectedText: '\t1. should be 1\n\t2. should be 2\n\n',
  },
  'prefixcorrectlinenumbernested': {
    input: '<html><body><ol><li>should be 1</li><ol><li>foo</li></ol><li>should be 2</li></ol></body></html>',
    expectedHTML: '<!DOCTYPE HTML><html><body><ol start="1" class="number"><li>should be 1<ol start="2" class="number"><li>foo</ol><li>should be 2</ol><br></body></html>',
    expectedText: '\t1. should be 1\n\t\t1.1. foo\n\t2. should be 2\n\n',
  },

  /*
  "prefixcorrectlinenumber when introduced none list item - currently not supported see #3450": {
    input: '<html><body><ol><li>should be 1</li>test<li>should be 2</li></ol></body></html>',
    expectedHTML: '<!DOCTYPE HTML><html><body><ol start="1" class="number"><li>should be 1</li>test<li>should be 2</li></ol><br></body></html>',
    expectedText: '\t1. should be 1\n\ttest\n\t2. should be 2\n\n',
  }
  ,
  "newlinesshouldntresetlinenumber #2194": {
    input: '<html><body><ol><li>should be 1</li>test<li>should be 2</li></ol></body></html>',
    expectedHTML: '<!DOCTYPE HTML><html><body><ol class="number"><li>should be 1</li>test<li>should be 2</li></ol><br></body></html>',
    expectedText: '\t1. should be 1\n\ttest\n\t2. should be 2\n\n',
  }
  */
  'ignoreAnyTagsOutsideBody': {
    description: 'Content outside body should be ignored',
    input: '<html><head><title>title</title><style></style></head><body>empty<br></body></html>',
    expectedHTML: '<!DOCTYPE HTML><html><body>empty<br><br></body></html>',
    expectedText: 'empty\n\n',
  },<commit_msg>tests: Re-enable import/export test that is now working<commit_after>'use strict';
/*
 * ACHTUNG: there is a copied & modified version of this file in
 * <basedir>/tests/container/spacs/api/pad.js
 *
 * TODO: unify those two files, and merge in a single one.
 */

const common = require('../../common');
const settings = require('../../../container/loadSettings.js').loadSettings();
const supertest = require('ep_etherpad-lite/node_modules/supertest');

const api = supertest(`http://${settings.ip}:${settings.port}`);
const apiKey = common.apiKey;
const apiVersion = 1;

const testImports = {
  'malformed': {
    input: '<html><body><li>wtf</ul></body></html>',
    expectedHTML: '<!DOCTYPE HTML><html><body>wtf<br><br></body></html>',
    expectedText: 'wtf\n\n',
    disabled: true,
  },
  'nonelistiteminlist #3620': {
    input: '<html><body><ul>test<li>FOO</li></ul></body></html>',
    expectedHTML: '<!DOCTYPE HTML><html><body><ul class="bullet">test<li>FOO</ul><br></body></html>',
    expectedText: '\ttest\n\t* FOO\n\n',
    disabled: true,
  },
  'whitespaceinlist #3620': {
    input: '<html><body><ul> <li>FOO</li></ul></body></html>',
    expectedHTML: '<!DOCTYPE HTML><html><body><ul class="bullet"><li>FOO</ul><br></body></html>',
    expectedText: '\t* FOO\n\n',
  },
  'prefixcorrectlinenumber': {
    input: '<html><body><ol><li>should be 1</li><li>should be 2</li></ol></body></html>',
    expectedHTML: '<!DOCTYPE HTML><html><body><ol start="1" class="number"><li>should be 1</li><li>should be 2</ol><br></body></html>',
    expectedText: '\t1. should be 1\n\t2. should be 2\n\n',
  },
  'prefixcorrectlinenumbernested': {
    input: '<html><body><ol><li>should be 1</li><ol><li>foo</li></ol><li>should be 2</li></ol></body></html>',
    expectedHTML: '<!DOCTYPE HTML><html><body><ol start="1" class="number"><li>should be 1<ol start="2" class="number"><li>foo</ol><li>should be 2</ol><br></body></html>',
    expectedText: '\t1. should be 1\n\t\t1.1. foo\n\t2. should be 2\n\n',
  },

  /*
  "prefixcorrectlinenumber when introduced none list item - currently not supported see #3450": {
    input: '<html><body><ol><li>should be 1</li>test<li>should be 2</li></ol></body></html>',
    expectedHTML: '<!DOCTYPE HTML><html><body><ol start="1" class="number"><li>should be 1</li>test<li>should be 2</li></ol><br></body></html>',
    expectedText: '\t1. should be 1\n\ttest\n\t2. should be 2\n\n',
  }
  ,
  "newlinesshouldntresetlinenumber #2194": {
    input: '<html><body><ol><li>should be 1</li>test<li>should be 2</li></ol></body></html>',
    expectedHTML: '<!DOCTYPE HTML><html><body><ol class="number"><li>should be 1</li>test<li>should be 2</li></ol><br></body></html>',
    expectedText: '\t1. should be 1\n\ttest\n\t2. should be 2\n\n',
  }
  */
  'ignoreAnyTagsOutsideBody': {
    description: 'Content outside body should be ignored',
    input: '<html><head><title>title</title><style></style></head><body>empty<br></body></html>',
    expectedHTML: '<!DOCTYPE HTML><html><body>empty<br><br></body></html>',
    expectedText: 'empty\n\n',
  },
{'fraction_non_alphanumeric': 0.23720247799152266, 'fraction_numerical': 0.01793283338767525, 'mean_word_length': 4.537003610108303, 'pattern_counts': {'":': 4, '<': 319, '<?xml version=': 0, '>': 319, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2635956', 'n_tokens_mistral': 2271, 'n_tokens_neox': 2196, 'n_words': 417}