Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: update tests

Abdullah Attac75f750215fd
diff --git a/apps/web/__e2e__/editor.test.ts b/apps/web/__e2e__/editor.test.ts
index 420cd03b3..e4d77d7f8 100644
--- a/apps/web/__e2e__/editor.test.ts
+++ b/apps/web/__e2e__/editor.test.ts
@@ -277,12 +277,15 @@ test("creating a new note and toggling read-only mode should not empty editor co
expect(await notes.editor.getContent("text")).toBe(NOTE.content);
});
-test("count number of words in an opened note", async ({ page }) => {
+test("#1468 count words separated by newlines", async ({ page }) => {
const app = new AppModel(page);
await app.goto();
const notes = await app.goToNotes();
- NOTE.content = "1\n2\n3\na\nb\nc\nd\ne\nali\nwaqar"; //10
- await notes.createNote(NOTE);
+
+ await notes.createNote({
+ content: "1\n2\n3\na\nb\nc\nd\ne\nali\nwaqar",
+ title: NOTE.title
+ });
expect((await notes.editor.getWordCount()) === 10).toBeTruthy();
});
diff --git a/apps/web/__e2e__/navigation.test.ts b/apps/web/__e2e__/navigation.test.ts
index be494369b..7627447d8 100644
--- a/apps/web/__e2e__/navigation.test.ts
+++ b/apps/web/__e2e__/navigation.test.ts
@@ -43,6 +43,7 @@ for (const route of routes) {
const item = await app.navigation.findItem(route.header);
await item?.click();
+ expect(item).toBeDefined();
expect(await app.getRouteHeader()).toBe(route.header);
});
}
diff --git a/apps/web/__e2e__/notes.test.ts-snapshots/export-html-Chromium-linux.txt b/apps/web/__e2e__/notes.test.ts-snapshots/export-html-Chromium-linux.txt
index e6ce6d8d8..041315cd0 100644
--- a/apps/web/__e2e__/notes.test.ts-snapshots/export-html-Chromium-linux.txt
+++ b/apps/web/__e2e__/notes.test.ts-snapshots/export-html-Chromium-linux.txt
@@ -11,6 +11,174 @@
<meta name="created-on" content="xxx" />
<meta name="last-edited-on" content="xxx" />
+ <style>
+ img {
+ max-width: 100% !important;
+ height: auto !important;
+ border-radius: 5px;
+ }
+
+ body {
+ background-color: transparent !important;
+ color: #202124;
+ font-family: "Open Sans", "Noto Sans", Frutiger, Calibri, Myriad, Arial,
+ Ubuntu, Helvetica, -apple-system, BlinkMacSystemFont, sans-serif;
+ }
+
+ h1,
+ h2,
+ h3,
+ h4,
+ h5,
+ h6 {
+ color: #212121;
+ }
+
+ pre.codeblock {
+ overflow-x: auto;
+ }
+
+ iframe {
+ max-width: 100% !important;
+ background-color: transparent !important;
+ }
+
+ li > p {
+ margin-top: 0px;
+ margin-bottom: 10px;
+ }
+
+ .checklist > li {
+ list-style: none;
+ margin: 0.25em 0;
+ }
+
+ .checklist > li::before {
+ content: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%234C4C4C%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A");
+ cursor: pointer;
+ height: 1.1em;
+ margin-left: -2.5em;
+ margin-top: 0em;
+ position: absolute;
+ width: 1.5em;
+ padding-left: 1em;
+ }
+
+ .checklist li.checked::before {
+ content: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%23008837%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A");
+ }
+
+ .checklist li.checked {
+ color: #505050;
+ }
+
+ [dir="rtl"] .checklist > li::before {
+ margin-left: 0;
+ margin-right: -1.5em;
+ }
+
+ blockquote {
+ border-left: 5px solid #e5e5e5;
+ padding-left: 10px;
+ margin-top: 0px;
+ }
+
+ code:not(pre code) {
+ background-color: #f7f7f7;
+ border: 1px solid #e5e5e5;
+ border-radius: 5px;
+ padding: 3px 5px 0px 5px;
+ font-family: ui-monospace, SFMono-Regular, SF Mono, Consolas,
+ Liberation Mono, Menlo, monospace !important;
+ font-size: 10pt !important;
+ }
+
+ .ProseMirror code > span {
+ font-family: ui-monospace, SFMono-Regular, SF Mono, Consolas,
+ Liberation Mono, Menlo, monospace !important;
+ }
+
+ pre {
+ padding: 10px;
+ background-color: #e5e5e5;
+ border-radius: 5px;
+ font-family: ui-monospace, SFMono-Regular, SF Mono, Consolas,
+ Liberation Mono, Menlo, monospace !important;
+ margin-bottom: 16px !important;
+ }
+
+ table {
+ border-collapse: collapse;
+ margin: 0;
+ overflow: hidden;
+ table-layout: fixed;
+ }
+
+ table td,
+ table th {
+ border: 1px solid #e5e5e5;
+ box-sizing: border-box;
+ min-width: 1em;
+ padding: 3px 5px;
+ position: relative;
+ vertical-align: top;
+ }
+
+ table td > *,
+ table th > * {
+ margin-bottom: 0;
+ }
+
+ table th {
+ background-color: #f7f7f7;
+ font-weight: bold;
+ text-align: left;
+ }
+ table p {
+ margin: 0;
+ }
+
+ code[class*="language-"],
+ pre[class*="language-"]
+ {
+ color: #F8F8F2;
+ background: #282A36;
+ text-shadow: none;
+ font-family: PT Mono, Consolas, Monaco, "Andale Mono", "Ubuntu Mono",
+ monospace;
+ text-align: left;
+ white-space: pre;
+ word-spacing: normal;
+ word-break: normal;
+ word-wrap: normal;
+ line-height: 1.5;
+
+ -moz-tab-size: 4;
+ -o-tab-size: 4;
+ tab-size: 4;
+
+ -webkit-hyphens: none;
+ -moz-hyphens: none;
+ -ms-hyphens: none;
+ hyphens: none;
+ }
+
+ pre[class*="language-"]
+ {
+ background: #282A36;
+ border-radius: 0.5em;
+ padding: 1em;
+ margin: 0.5em 0;
+ overflow: auto;
+ height: auto;
+ }
+
+ :not(pre) > code[class*="language-"],
+ pre[class*="language-"]
+ {
+ background: #282A36;
+ }
+ </style>
</head>
<body>
<h1>Test 1</h1>