Skip to content
Snippets Groups Projects
Commit 4ec3b7f3 authored by Gospodin Bodurov's avatar Gospodin Bodurov
Browse files

Initial commit

parent ea889efc
No related branches found
No related tags found
1 merge request!6Implement pseudo plain parsing
import { diffStringsUnified } from "jest-diff";
import { describe, test } from "@jest/globals";
import { getDOMDocuments, getTestCasesDirs } from "./utils";
import { PlainNormalizer } from "../src";
import { amendOutlookNodes } from "../src/HTMLNormalizer/strategies/outlook";
const path = require("path");
const TESTS_GLOBAL_PATH = "/files/outlook-outlook";
......@@ -38,9 +41,12 @@ const createDescribePseudoPlainTestCases = (testsPath: string) =>
testCasePath
);
var normalizedReceivedPseudoPlainText = PlainNormalizer.normalizePlain(amendOutlookNodes(receivedHtmlDocument.body.textContent));
var normalizedSentPseudoPlainText = PlainNormalizer.normalizePlain(sentHtmlDocument.body.textContent);
const difference = diffStringsUnified(
receivedHtmlDocument.body.textContent,
sentHtmlDocument.body.textContent
normalizedReceivedPseudoPlainText,
normalizedSentPseudoPlainText
);
console.log(difference);
......@@ -51,7 +57,7 @@ describe("[Pseudo PLAIN] Outlook-Outlook normalization", () => {
const describeFunction = createDescribePseudoPlainTestCases(testsPath);
// ["01"] - is a filter. Pass here names of directories with test cases you want to check
describe("Emails Chrome", describeFunction("chrome", null, ["01"]));
describe("Emails Chrome", describeFunction("chrome", null, []));
// describe(
// "Emails Edge",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment